Question: It's matlab coding only Write a MATLAB script to simulate tossing coins. First ask the user how many times (call it n) he/she wants to

 It's matlab coding only Write a MATLAB script to simulate tossing
It's matlab coding only

Write a MATLAB script to simulate tossing coins. First ask the user how many times (call it n) he/she wants to toss the coins. Use randi function to generate random integers of 1 or 2. Assume 1 represents Heads and 2 represents Tails. 1. Toss a coin n times and calculate how many times it lands Heads up. 2. Toss two coins simultaneously n times and calculate how many times they land the same (both Heads up or both Tails up). 3. Toss three coins simultaneously n times and calculate how many times at least one of them lands Heads up. Run your code for n = 10, 100, 1000 and report the results using fprintf Hint: To answer part 3, it is easier to calculate the complimentary event (How many times none of the three coins land Heads up, or in other words, how many times all three coins land Tails up)

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!