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 You should assume
the coin is fair, with probability of heads or tails equal to Set up the code to repeat the
entire procedure two independent tosses of n coins times, and record what percentage
of those trials give the same number of heads on both sets of n tosses. Plot the results
on a loglog scale for n Superimpose in a different color a plot of the function
you obtained in exercise 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 loglog plot You can generate a times array of binary random variables
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
