Question: Write a Matlab program called CoinTosses to carry out the experiment of tossing a fair coin n times where n is a user input. Print

Write a Matlab program called CoinTosses to carry out the experiment of tossing a fair coin n times where n is a user input.

Print out the outcome (example : for n=5, THTTH)

Calculate the probability of getting Heads and the probability of getting Tails.

This is what I have so far.. I am also not sure what I should be typing into the command window. When I type n =5, I only get 5 outcome.

Write a Matlab program called CoinTosses to carry out the experiment of

function toss- cointosses(n, k) ok is probability of heads ninput( 'How many times do you want to toss a fair coin?:'); 4 head0; for i- 1:n 7 if rand

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!