I need code that can do the following for 1,000 coin flips. I am new to MATLAB s
ID: 3734682 • Letter: I
Question
I need code that can do the following for 1,000 coin flips. I am new to MATLAB so please keep the code simple. Thanks
2) Random variables Write a program to simulate the flipping of three fair coins and count the number of times that you get 0, 1, 2, and 3 heads. You will need to use the rand function and you can use for loops and if conditionals to the counts, or you can use the method similar to that shown in class to simulate the throw of two dice. Use the following code to print out a string and a number. disp ( sprintf("Zero heads- %d", answer); The sprintf command is similar to printf in C. You will need to print out 4 values for 3 heads, 2 heads, 1 head, and zero heads.Explanation / Answer
sprintf("Heads are ",heads_counter);
% I hope u may get something from this. Thanks in advance.....
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.