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 22:40
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
question
Computers and Technology, 24.06.2019 21:40
is on drugs i swear i ask a question and its not showing whats going
Answers: 2
You know the right answer?
(Using Matlab):For this Project you will simulate sequentially flipping a coin 10000 times. Keep tra...
Questions
Questions on the website: 13722363