Question
Question 1(a) Bis not yet a probability distribution. Why not? What do we need to do to Bto make it a probability distribution? (Hint: Use
Question 1(a)
Bis not yet a probability distribution. Why not? What do we need to do to
Bto make it a probability distribution? (Hint: Use the comments in the code chunk below to guide you) (1 mark)
Step 3Write the code to convert
Binto a probability distribution. Use the comments in the code block to guide you. (1 marks)
Write the new vector
Bin in the text box below.
Question 1(b)Using the concept of Expectation that you learnt in Assignment 2, write code to compute the expected value of
X. (1 mark)
This represents the expected number of trials before an attacker uncovers the secret. Is it low or high in your opinion? Explain your reason.(1 mark)
If the probability of successful guessing was equal in all trials, we would say the
Xwas uniformly distributed. What would be the expected number of guesses if X was uniformly distributed? Use the code block below and the code to calculate expected value to find out. (Hint: first write out what the probability of success in each trial would be.)(1 marks)
When the probability of success is uniformly distributed, is the expected value of
Xlower or higher than before? Can you think of why this happens?(1 mark)
Question 1(c)Define a variance function which acts on a vector
Pxas in 1(a). Use this command to compute the variance of
X. Also compute the variance of
Xif it had a uniform distribution. (1 mark)
Observing the variance when X has the distribution
Pxand when it is uniformly distributed, what does the value of the variance tell you about the number of trials for the attacker to succeed? (1 mark)
Question 1(d)We now define a function()
psuccess()which acts on a vector
Pxas in 1(a) and computes the probability of success in guessing the keyafter
kguesses. Note that this function takes 2 arguments. Use this to compute the probability of success after 3 guesses when
Pxis as in 1(a). Write code to print out the value of this probability. (1 mark)
What do you observe about the chances of success after 3 trials? Is this distribution
Pxfavouring the attacker, who wants to uncover the key or the cryptographer, who wants to protect the key? ( 1mark)
Question 1(e)
The probability distribution
Pxwas intentionally designed to satisfy the condition[1]>[2]>...
Px[1]>Px[2]>...and this gives the attacker an edge. Let us see what happens if the probability distribution is permuted.
In general, the distribution
Pxcan be permuted, i.e., the components of
Pxcan be reordered. We will need to use thepermute()function from the packagegtools'. Installgtoolsusing theTools->Install Packages` process described in the first tutorial.
What is the new (permuted) probability of success after 3 trials? Is it higher or lower than before? (1 mark)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started