Question

CRYPTOGRAPHY PROBABILITY DISTRIBUTION Bad Shuffles Consider the following card shuffling algorithm. There are three cards in...

CRYPTOGRAPHY PROBABILITY DISTRIBUTION
Bad Shuffles

Consider the following card shuffling algorithm. There are three cards in the deck and they are
each represented by an element in {X, Y, Z}. [Bonus marks if you use the deck {W, X, Y, Z}]
Algorithm Shuffle
---------------------------------------------------
deck := [X,Y,Z]
for i from 0 to 2 do
j := RANDOM(i)
swap values of deck[i] and deck[j]
end for
return deck
---------------------------------------------------
For each of the following definitions of RANDOM(i), compute the probability distribution of all six
valid hands, [X, Y, Z], [X, Z, Y ], [Z, X, Y ], etc., at the end of the algorithm. Show your work.
a) RANDOM(k) returns an integer chosen uniformly at random from the set {0, 1, 2}. Here, any
of the three possibilities are equally returned.
b) RANDOM(k) returns an integer chosen uniformly at random from k to 2 (inclusive). Here,
values less than k are not returned.
c) RANDOM(k) returns an integer chosen uniformly at random from the set {0, 1, 2} \ {k}. Here,
the value of k is never returned.
Your answer should give the probability of each possible hand. Briefly comment about the results
of the three algorithms.
Hint: Draw a tree starting with the un-shuffled deck [X, Y, Z] where the different outputs of the
RANDOM function yield a child (modified deck). The leaves are the tree are possible hands. The
probability of a leaf node (specific hand) is the product of the probabilities of the nodes on the
path from the root to that leaf.
Example: Suppose we use the functon RANDOM(k) -> k. The probability distribution is given by
Pr{[X, Y, Z]} = 1
Pr{[X, Z, Y ]} = 0
Pr{[Y, X, Z]} = 0
Pr{[Y, Z, X]} = 0
Pr{[Z, X, Y ]} = 0
Pr{[Z, Y, X]} = 0

Homework Answers

Answer #1

a) Here probability of j=0 is 1/3, j=1 is 1/3, j=2 is 1/3

for [X,Y,Z]:

i should be equal to j.

so for i=0, j should be 0 (prob = 1/3)

for i=1, j should be 1 (prob=1/3)

for i=2, j should be 2 (prob=1/3)

Hence probability is 1/27.

similarly probabilities of all 6 combinations is 1/27.

b) if i=0, j=0,1,2

if i=1, j=1,2

if i=2, j=2

P[X,Y,Z] = (1/3)*(1/2)*(1) = 1/6

P[X,Z,Y] = (1/3)*(1/2)* 0 =0

Similarly, P[Z,Y,X]=0

P[Z,X,Y]=0

P[Y,Z,X]= 0

P[Y,X,Z] = (1/3)*(0)* 1 = 0

c) if i=0, j=1,2

if i=1, j=0,2

if i=2, j=0,1

P[X,Y,Z] = 0

And probability of all other cominations is (1/2)*(1/2)*(1/2) = 1/8

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The following is Algorithm 8 from §5.4. Note that it uses the following definition of the...
The following is Algorithm 8 from §5.4. Note that it uses the following definition of the fibonacci sequence: fn = fn−1 + fn−2, f1 = 1, f0 = 0. procedure iterative fibonacci(n: nonnegative integer) if n = 0 then return 0 else x := 0 y := 1 for i := 1 to n − 1 do z := x + y x := y y := z end for return y end if end procedure Prove this algorithm is...
Provide an example of a probability distribution of discrete random variable, Y, that takes any 4...
Provide an example of a probability distribution of discrete random variable, Y, that takes any 4 different integer values between 1 and 20 inclusive; and present the values of Y and their corresponding (non-zero) probabilities in a probability distribution table. Calculate: a) E(Y) b) E(Y2 ) and c) var(Y). d) Give examples of values of ? and ? , both non-zero, for a binomial random variable X. Use either the binomial probability formula or the binomial probability cumulative distribution tables...
Consider the following probability distribution table: X 1 2 3 4 P(X) .1 .2 .3 .4...
Consider the following probability distribution table: X 1 2 3 4 P(X) .1 .2 .3 .4 If Y = 2+3X, E(Y) is: A.7 B.8 C.11 D.2 19. If Y=2+3X, Var (Y) is: A.9 B.14 C.4 D.6 20. Which of the following about the binomial distribution is not a true statement? A. The probability of success is constant from trial to trial. B. Each outcome is independent of the other. C. Each outcome is classified as either success or failure. D....
Suppose X is a random variable whose probability distribution is given by the following table: X...
Suppose X is a random variable whose probability distribution is given by the following table: X 0 2 4 6 P(X) 0.11 0.12 0.52 0.25 For each item below, write the capital letter which corresponds to the correct value. Some letters may not be used and some letters may be used more than once. • P(X is even)? • P(X < 4)? • P(X ≤ 4)? • P(X 6= 2)? • P(X = 2 and X = 6)? • P(1...
2. Using the historical records, a manufacturing firm has developed the following probability distribution for the...
2. Using the historical records, a manufacturing firm has developed the following probability distribution for the number of days required to get components from its suppliers. The distribution is here, where the random variable x is the number of days. I answered part a. please complete parts b thru c below. x P(x) 3 .............. 0.14 4 .............. 0.46 5 .............. 0.29 6 ............... 0.075 7 ................ 0.035 a. What is the average lead time for the​ component? The average...
Probability & Statistics Sec-3 with Dr. Kishore Kumar P. K. for Sem II 2020 Home My...
Probability & Statistics Sec-3 with Dr. Kishore Kumar P. K. for Sem II 2020 Home My courses EN MATH4130-3 KK 2020-2 OFA - ONLINE FINAL ASSIGNMENT Final Online Assignment Questions Question 1 Not yet answered Marked out of 10.0 Not flaggedFlag question Question text A1.1. The following are the points to draw a less than ogive curve from a frequency distribution. (7, 4), (14, 12), (21, 24), (28, 39), (35, 49), (42, 56), (49, 61), (56, 64), (63, 65) a)     ...
For this assignment you will implement a simple calculator or interpreter that reads arithmetic expressions from...
For this assignment you will implement a simple calculator or interpreter that reads arithmetic expressions from a file. Specifically, you will implement the following function: /* * Reads one arithmetic "expression" at a time from a file stream, computes, then * returns the result. If there are additional expressions in the file, they are * read and computed by successive calls to “calculator”. * * “Expressions” are groups of operations (add, subtract, multiply, divide). Your * calculator will read and...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21,...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21, all players who are still standing win. But the players that are not standing have already lost. If the Dealer does not go over 21 but stands on say 19 points then all players having points greater than 19 win. All players having points less than 19 lose. All players having points equal to 19 tie. The program should stop asking to hit if...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as...
Do the following problems. 1. Each of three barrels from a manufacturing line are classified as either above (a) or below (b) the target weight. Provide the ordered sample space. 2. The heat on each of two soldered parts is measured and labeled as either low (l), medium (m), or high (h). State the number of elements in the ordered sample space. 3. Consider the set of Beatles songs with a primary writer as either Paul McCartney (P) or John...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT