Step 1: The R command runif() in the code block below generates 24 random numbers between 0 and 1, drawn from a uniform distribution. Notice that every time you run the code block you will get a different vector AA.

A<-runif(24, min=0, max=1)
A
Step 2 Write the value of AA you generated prior, as a vector in the code block below. Run the code to view the vector BB.
A<-c( )
B<-rep(0, times=length(A)) #creating a vector of 0s, of length same as A
B
for(k in 1:length(A)){
B[k]<-prod(A[1:k])
}
B
Question 1(a) BB is not yet a probability distribution. Why not? What do we need to do to BB to make it a probability distribution? (Hint: Use the comments in the code chunk below to guide you) (1 mark)
Step 3 Write the code to convert BB into a probability distribution. Use the comments in the code block to guide you. (1 marks)
# a command to find the sum of all the entries in B
# a command to rescale B so that the sum of all the entries in B is 1
#observe the sum of all entries of B now and check that it adds to 1.

**Complete Answer:**