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
A mobile device user is having problems launching apps and texting. The user touches an app to launch it, but the app icon next
dalvyx [7]

Answer:

The screen protector may be interfering with the touch response

Explanation:

Screen protectors or commonly called screen guards are used to protect phone screens. In case they fall to the ground, these protectors act as shields to keep the phone screen from getting damaged. However screen protectors if not positioned or fixed properly may also cause hindrance to effective touch response as they become barriers to the touch screen.

8 0
2 years ago
For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
Ronch [10]
When shooting panoramic you would want to control the exposure yourself, much rather than the camera..... A panoramic is one big picture correct, so you would want all of them to be the same exposure level, now some cameras may lock on, and others may not......your correct answer would be TRUE does this make sense?
8 0
3 years ago
9) Which date is assigned the serial number of 1?
goldenfox [79]

9) Which date is assigned the serial number of 1?

A. January 1, 1700

B. January 1, 2000

  • C. January 1, 1900

D. January 1, 1800

7 0
2 years ago
Read 2 more answers
Which of the following is NOT a computer peripheral?
Marianna [84]

Answer:CPU stands for the central processing unit. CPU is not a peripheral device.

Explanation:

CPU stands for the central processing unit. CPU is not a peripheral device.

7 0
1 year ago
The ____ command can be used to view the contents of a record when it is anticipated that the record will need to be modified. I
GREYUIT [131]

Answer:

The correct answer is B)

Explanation:

The commit command allows us to:

• Consolidate, confirm

• committing refers to the idea of confirming a set of provisional changes permanently.

• A popular use is at the end of a database transaction.

•

The LOCK TABLE command should be used:

• when a lock of the mode specified in the table can be acquired.

• The command will wait for everything you need to get the lock,

• In case you cannot acquire the lock immediately, the NOWAIT option is specified so that the command cancels the transaction.

6 0
3 years ago
Other questions:
  • How to take a key off a keyboard without breaking it?
    14·1 answer
  • First write a method to calculate the greatest common divisor (GCD) of two positive integers using Euclid’s algorithm (also know
    10·1 answer
  • Which of the following people was a member of FFA?
    7·1 answer
  • Identify a factor that is unlikely to influence the length of time people wait in the lunch line.
    8·2 answers
  • The ________ identifies staff reaction and response times as well as inefficiencies or previously unidentified vulnerabilities.
    5·1 answer
  • One of the best ways to shoot a picture is to frame the subject in the middle of the screen or viewer. T or F
    14·2 answers
  • True false.
    10·2 answers
  • jeff has just upgraded from windows 7 to windows 10 and he is confused. He has started several universal apps but he can't figur
    11·1 answer
  • Which of the following is an example of intellectual property?
    15·1 answer
  • Use the svd() function in matlab to compute a, the rank-1 approximation of a. clearly state what a, is, rounded to 4 decimal pla
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!