subject

(Using Matlab):For this Project you will simulate sequentially flipping a coin 10000 times. Keep track of every time you get 'heads' and plot the running estimate of the probability of getting 'heads'
with this coin. Plot this running estimate along with a horizontal line at the expected value of
0.5 in a subplot. You will animate the running estimate line. In the second subplot you will
have a animated bar plot with the x axis being heads and tails and the y axis is a running
estimate of the number of heads or tails. The x axis tick marks must say heads and tails for
each bar. To create the random data, you will use the following code shown below; where n is the
number of coin flips. In the data heads is represented as O and tails is represented as 1. The axis of
the bar and line plot cannot change as the animation goes on. You do not have to animate the
horizontal line. You may use any code cover in class to complete this.
The probability of an outcome can be computed using the following formula:
h
P=
ht
Where h is the current total of heads result and t is the current total of tails result
To generate the data, you will use the following code (Copy this exactly):
d - randi (2, n, 1)-2;
To create an animated bar plot, you just repeated plot the bar plot with the updated results.
To set the x axis tick marks to say heads and tails for each bar, you will use the following
code:
str - (Heads''Tails);
set (gca, 'XTickLabel', str, 'XTick', 1:numel (str))
To set the y axis limits for the bar plot you can use the code: ylim

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
What is the process in which the software development team compiles information to determine the final product.
Answers: 3
question
Computers and Technology, 22.06.2019 03:30
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
When is an original work considered public domain? a. when posted via social media b. when it is posted on the internet c. when a copyright symbol is not included with the piece of work d. when explicit permission is given by the author / owner
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
You know the right answer?
(Using Matlab):For this Project you will simulate sequentially flipping a coin 10000 times. Keep tra...
Questions
question
Physics, 13.10.2020 14:01
question
Mathematics, 13.10.2020 14:01
question
Mathematics, 13.10.2020 14:01
question
Biology, 13.10.2020 14:01
Questions on the website: 13722363