Write a Matlab code that will generate a random number which
Write a Matlab code that will generate a random number, which can take only two possible values H (representing a heads outcome in a random coin toss) and T (representing a tails in a random coin toss). Generate a sequence of toss outcomes of 10 random trials. Count how many times H and T are generated out of the 10 outcomes. How can you estimate the probability of H and T in this case? Repeat the experiment with a 100, 500 and 1000 outcomes generated. Estimate the probabilities in each case. What do you notice? Hints: Random numbers with equal probability are generated in Matlab using the command function rand(). Read the help on Matlab to know how to use the function by typing help rand in Matlab command line.
Hand in your Matlab code, which has to be running without errors and show clearly the answers to questions in this assignment and any relevant graphs/figures you got from Matlab.
Solution
