Question: First, create a $ 1 0 , 0 0 0 times 1 0 0 $ matrix called * * mymat * * using a
First, create a $times $ matrix called mymat using a for loop, where the rbinom line of code is used times to populate each row of the matrix. You are filling in a whole row of the matrix all at once with the above line of code. Next, using another for loop or the same for loop create a vector x where each component of x is the mean of the corresponding row of the matrix. Notice that calculating the mean of each row will give you the proportion of s in that row. Then make a histogram of the x vector. Do not print the matrix or the vector or else you will get very long output in your output pdf file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
