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, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
question
Computers and Technology, 24.06.2019 13:20
In the insert table dialog box, you select the checkbox to create the first row as the header of the table.
Answers: 3
You know the right answer?
(Using Matlab):For this Project you will simulate sequentially flipping a coin 10000 times. Keep tra...
Questions
question
English, 24.10.2020 09:30
question
Social Studies, 24.10.2020 09:30
question
Biology, 24.10.2020 09:30
question
Health, 24.10.2020 09:30
question
English, 24.10.2020 09:30
Questions on the website: 13722361