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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:30, nickddj12
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. after being presented with kyle's research, the company changed the way in which it made long-distance phone calls and cut their expenses in this area by 75 percent. the new system the kyle's company most likely adopted was wired communications switching stations voip hdtv
Answers: 3
image
Computers and Technology, 22.06.2019 23:30, TheBurntToast
What is the digital revolution and how did it change society? what are the benefits of digital media?
Answers: 1
image
Computers and Technology, 24.06.2019 16:30, Dajuan2x
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject after the midsemester exams and the end-of-semester exams. she divides the midsemester and end-of-semester information into two separate worksheets, sheet 1 and sheet 2. how will she rename the two worksheets?
Answers: 2
image
Computers and Technology, 24.06.2019 22:50, Bubba06
Which of these might be an example of an advertiser's target group? a. people who have no access to media b. people the advertisers know nothing about c. people who watch a variety of tv shows d. people who live in the same region of the country
Answers: 2
You know the right answer?
(Using Matlab):For this Project you will simulate sequentially flipping a coin 10000 times. Keep tra...

Questions in other subjects:

Konu
History, 26.10.2020 18:00
Konu
English, 26.10.2020 18:00