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
Which cell formatting is most likely to use $?
TiliK225 [7]
Currency is the correct answer
4 0
3 years ago
Read 2 more answers
Acrynom for wys or wyg
REY [17]
What you said? And what you get?
8 0
2 years ago
What keyboard command opens the Go To dialog box?
Harlamova29_29 [7]

If you mean the search for a phrase or word function on a page,

Left Ctrl + F

7 0
3 years ago
Read 2 more answers
Tech A says that no matter which way the vehicle turns, the inside wheel must always turn less sharply than the outside wheel. T
vodomira [7]
The answer is c because the perpendicular bicector alligns.
5 0
2 years ago
What can a user do using the Contact Group dialog box? Check all that apply.
RSB [31]

Answer:

1,2,4,5,7

Explanation:

Had the question

3 0
2 years ago
Read 2 more answers
Other questions:
  • To display or distribute information from a database, programmers or database administrators create ___ .
    12·1 answer
  • How do you uninstall sc update?
    13·2 answers
  • Most browsers allow you to maintain your most frequently visited websites. what is this called? Special place holder, secret lis
    6·2 answers
  • Assume the availability of class named DateManager that provides a static method, printTodaysDate, that accepts no arguments and
    11·1 answer
  • OSHA standards appear in the ___________ and are then broken down into ____________.
    9·1 answer
  • What is the term used for a set of programs that acts as an interface between the applications that are running on a computer an
    13·1 answer
  • What is blogging
    15·2 answers
  • Applications require you to provide the following basic elements: social security number, experience, and favorite memories. Tru
    11·1 answer
  • 100 POINTS NEED THIS BEFORE 11:59 TODAY!!!!!!!!!!!!!!!
    8·1 answer
  • One word for The characters typed by a user using a<br> keyboard.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!