1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Julli [10]
3 years ago
15

Suppose that instead of swapping element A[i] with a random element from the subarray A[i..n], we swapped it with a random eleme

nt from anywhere in the array: PERMUTE-WITH-ALL (A) 1, n = A.length 2, for i = 1 to n 3, swap A[i] with A[RANDOM(1, n)] Does this code produce a uniform random permutation? Why or why not?
Computers and Technology
1 answer:
Anastaziya [24]3 years ago
7 0

Answer:

The answer to this question can be defined as follows:

Explanation:

Its Permute-with-all method, which doesn't result in a consistent randomized permutation. It takes into account this same permutation, which occurs while n=3. There's many 3 of each other, when the random calls, with each one of three different values returned and so, the value is=  27. Allow-with-all trying to call possible outcomes as of 3! = 6  

Permutations, when a random initial permutation has been made, there will now be any possible combination 1/6 times, that is an integer number m times, where each permutation will have to occur m/27= 1/6. this condition is not fulfilled by the Integer m.

Yes, if you've got the permutation of < 1,2,3 > as well as how to find out design, in which often get the following with permute-with-all  chances, which can be defined as follows:

\bold{PERMUTATION \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                           PROBABILITY}

\bold{  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4/27= 0.14 }\\\bold{ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 5/27=0.18}\\

\bold{            \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \               5/27=0.18}\\\bold{\ \ \ \ \  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                       5/27=0.18}

\bold{    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \                                                  4/27=0.14}

Although these ADD to 1 none are equal to 1/6.

You might be interested in
The __________ operator increases the value of the variable by 1 after the original value is used in the expression in which the
Irina18 [472]

Answer:

postincrement.

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

The postincrement operator increases the value of the variable by 1 after the original value is used in the expression in which the variable appears.

7 0
3 years ago
Which element can be changed using the Print pane? Check all that apply
asambeis [7]

Answer:B C D E

Explanation:

EDGE 2021

3 0
3 years ago
Suggest a reason why it was constructed there?​
valina [46]
Can you post the work assigned so I can better understand?
6 0
3 years ago
The main thing that adjusting the aperture controls when taking an image is?
Pani-rosa [81]
The temperature controller
6 0
3 years ago
How many days till earth ends
expeople1 [14]
Several Billion years
5 0
3 years ago
Other questions:
  • Jean-Ann works in the finance business. She analyzes insurance applications in order to determine the level of risk involved in
    11·1 answer
  • Material science focuses on<br><br> A) Heat<br> B) Solids<br> C) Liquids<br> D) Gasses
    7·2 answers
  • What was the second phone made in the world called?
    5·1 answer
  • 2. Because technology is always changing, there are new applications being developed constantly. (1 point)
    9·2 answers
  • Trainers at Tom’s Athletic Club are encouraged to enroll new members. Write an application that allows Tom to enter the names of
    10·1 answer
  • Which is an internet service? <br> A.) antivirus <br> B.) chat <br> C.) firewall<br> D.) router
    6·2 answers
  • Mrs. Brown is a teacher at the elementary school. As the school year begins, she sends a couple of email messages to her student
    11·1 answer
  • Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee points
    14·2 answers
  • How should you best communicate<br> this information to Keisha?<br> (Select all that apply.)
    13·1 answer
  • The minimum recommended standards for the operating system, processor, primary memory (RAM), and storage capacity for certain so
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!