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
1.) Write the formula, which assigns double x to double n raised to the double z power.
andrezito [222]

Answer:

1.) Write the formula, which assigns double x to double n raised to the double z power.

Answer: 2\times x → 2\times n^(2\times z<u>)</u>

2.) Write a formula, which will add 5 to the cube of double t times double n, and assign it to double x.

Answer: 5\plus 2\times t^3→2\times x

3.) Write a formula, which will assign double x to square root of the sum of the squares of the lengths of the two legs of a triangle. Declare double leg1, and double leg2, in order to find the hypotenuse. (Pythagorean Theorem)

Answer: 2\times x → \sqrt \{(l^2)_1 + (l^2)_2\}= hypotenuse

4.) Write a program that find the distance between two values on the number line by taking the absolute value of their difference. Assign the answer to double x. The two numbers have been declared as follows:

double num1, num2

Answer: length = \sqrt\{|num2 - num1\|} → 2\times x

Explanation:

.

3 0
3 years ago
Which of the following is NOT true about mobile app development:
Arte-miy333 [17]

Answer:

The answer is C.

Explanation:

Websites are far quicker to develop than apps.

7 0
3 years ago
There are a number of types of digital memory available, such as hard disk drive (HDD), random access memory (RAM), solid state
elena55 [62]

Answer and Explanation:

In my view, there is no benefit to having several types of digital storage, but it would be helpful when there is only single SSD format of different sizes, therefore it would be very convenient for an individual to select storage memory and doesn't get frustrated although several choices contribute to uncertainty about what to purchase rather than what is better for the machine. So, only a single centralized memory and the only one that is deemed perfect for your device so far.

(a)...Yeah, then it'll be easier and even more efficient for individuals to have a single standard because there'd be only that standard and then no more ambiguity, although it is quicker or lighter and would have been sufficient to send.

(b)...No, I wouldn't be using the very same piece of hardware if I were considering multiple processing categories because I would require memory interface types for various functions, so those won't all require the very same memory, however, I would like various storage of various sizes and I'm using memory interface categories effectively.

6 0
3 years ago
If you found out that your friend was blogging unsafely, which of the following would be a good action to take
emmasim [6.3K]
A is the best and safest answer. you don't want to sound like you are trying to control them or tell them what they should or should not do. <span />
3 0
3 years ago
Read 2 more answers
Write an expression whose value is the concatenation of the three strigs name1, name2, and name3, separated by commas
krek1111 [17]

Answer:

name1+","+name2+","+name3

Explanation:

Given

name1, name2 and name3

Required

Concatenate, separated by comma (,)

To concatenate, we simply use the + operator.

So, the expression is:

name1+","+name2+","+name3

3 0
3 years ago
Other questions:
  • The likelihood of the occurrence of a vulnerability multiplied by the value of the information asset - the percentage of risk mi
    12·1 answer
  • Someone who is young, lacks funds, and really wants to gain technical skills while serving his or her nation should consider
    15·1 answer
  • Think about the five steps to writing an algorithm. Why is each step necessary? Why is it important to be precise when writing c
    15·1 answer
  • Using the Sakila database, create a query that displays the film title, description, as well the actor first and last name for a
    12·1 answer
  • Why is it important to be part of a team in times you fail and in times you succeed?​
    15·1 answer
  • What is a good safety precaution to take when opening a computer case?
    9·1 answer
  • What kind of word is the pronoun in bold letters?
    5·2 answers
  • HURRY
    8·1 answer
  • Gun to yo head any last words??
    10·2 answers
  • What is computer software?​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!