Question: Numerical simulation assignment. Write a program in MATLAB ( or , if you prefer, Python ) to generate two independent random samples of n coin

Numerical simulation assignment. Write a program in MATLAB (or, if you prefer,
Python) to generate two independent random samples of n coin tosses.1 You should assume
the coin is fair, with probability of heads or tails equal to 50%. Set up the code to repeat the
entire procedure (two independent tosses of n coins)100 times,2 and record what percentage
of those 100 trials give the same number of heads on both sets of n tosses. Plot the results
(on a log-log scale) for 1<= n <=100. Superimpose (in a different color) a plot of the function
you obtained in exercise 5. If you have not used MATLAB before, it has built in tutorials to
help you get started. For this assignment you will want to learn about the rand command,
the hold on command (for plotting one curve on top of another) and the loglog command
(for making a log-log plot).3 You can generate a 1000\times 10 array of binary random variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!