please Use MATLAB to solve the below questions there are some kind of similar examples for this
Fantastic news! We've Found the answer you've been seeking!
Question:
please Use MATLAB to solve the below questions
there are some kind of similar examples for this question which may help you to solve the below problems
guideline
examples
questions
Transcribed Image Text:
no_trials = 8; trials = [1, 0, 1, 1, 0, 1, 1, 0]; %3! We can now use the MATLAB command sum and a logical array to work out the total heads and tails total_no_heads = sum(trials == 1) total_no_tails = sum(trials == 0) • We can now use the MATLAB command cumsum and a logical array to work out the cumulative heads and tails cuml_no_heads = cumsum(trials == 1) cuml_no_tails = cumsum(trials == 0) >> total_no_heads = sum (trials 1) total no heads = > total_no_tails = sum (trials == 0) total_no tails = 3 » cuml_no_heads = cumsum (trials == 1) cuml_no heads = 4 >> cuml_no_ tails = cumsum (trials cuml_no_tails = 2 2 3 3. 3. no_trials = 8; trials = [1, 0, 1, 1, 0, 1, 1, 0]; cumsum(trials==1)./(1:no_trials)*100 1. Simulate a fair coin toss over 1000 trials Plot the frequency of heads and the frequency of tails per trial. a. b. Plot the relative frequency of heads and the frequency of tails per trial. c. Simulate an unfair coin toss with P(X = H) = 0.7, P(X = T) = 0.3 2. Each run of your program can be considered as an experiment and is by nature stochastic. This means that the results will differ on each run due to the randomness. Adapt your code to repeat the fair coin toss experiment 10 times with each experiment consisting of 100 trials. Average the frequency of heads and the frequency of tails seen after each experiment. i.e. You are averaging the results of the 10 experiments. How does this compare with the simulation of 1000 trials? no_trials = 8; trials = [1, 0, 1, 1, 0, 1, 1, 0]; %3! We can now use the MATLAB command sum and a logical array to work out the total heads and tails total_no_heads = sum(trials == 1) total_no_tails = sum(trials == 0) • We can now use the MATLAB command cumsum and a logical array to work out the cumulative heads and tails cuml_no_heads = cumsum(trials == 1) cuml_no_tails = cumsum(trials == 0) >> total_no_heads = sum (trials 1) total no heads = > total_no_tails = sum (trials == 0) total_no tails = 3 » cuml_no_heads = cumsum (trials == 1) cuml_no heads = 4 >> cuml_no_ tails = cumsum (trials cuml_no_tails = 2 2 3 3. 3. no_trials = 8; trials = [1, 0, 1, 1, 0, 1, 1, 0]; cumsum(trials==1)./(1:no_trials)*100 1. Simulate a fair coin toss over 1000 trials Plot the frequency of heads and the frequency of tails per trial. a. b. Plot the relative frequency of heads and the frequency of tails per trial. c. Simulate an unfair coin toss with P(X = H) = 0.7, P(X = T) = 0.3 2. Each run of your program can be considered as an experiment and is by nature stochastic. This means that the results will differ on each run due to the randomness. Adapt your code to repeat the fair coin toss experiment 10 times with each experiment consisting of 100 trials. Average the frequency of heads and the frequency of tails seen after each experiment. i.e. You are averaging the results of the 10 experiments. How does this compare with the simulation of 1000 trials?
Expert Answer:
Related Book For
Fundamentals of Electric Circuits
ISBN: 9780073301150
3rd edition
Authors: Matthew Sadiku, Charles Alexander
Posted Date:
Students also viewed these mathematics questions
-
1. Simulate a fair coin toss over 1000 trials Plot the frequency of heads and the frequency of tails per trial. b. Plot the relative frequency of heads and the frequency of tails per trial. c....
-
Can you simulate two sequential coin tosses and compute the relative frequencies per trial?
-
Simulate the throwing of two dice over a 1000 trials. Compute the relative frequencies per trial?
-
What is the output of the following program: #include using namespace std; void Push(int x[], int y[], int n) { int i = 0, j = n - 1; while (i
-
Match the organ or gland with the enzyme(s) it secretes. Enzymes may be used more than once. An organ or gland may secrete more than one enzyme. A peptidase (1) salivary glands B amylase (serous...
-
Repeat Problem 5.18 for a five-tap zero-forcing equalizer. Data From Problem 5.18 Given the following channel pulse response: p c (-4T) = -0.01; p c (-3T) = 0.02; p c (-2T) = -0.05; p c (-T) = 0.07;...
-
An asset has the estimated salvage values for various lives, shown in the table below. For each possible life from 1 to 6 by 1, determine the capital recovery cost for MARR of 8 percent/year. EOY NCF...
-
The normal capacity of a factory is 8,000 units per month. Cost and production data follow: Standard application rate for fixed overhead . . . . . . . . . . . . . . . . . . $0.50 per unit Standard...
-
Instructions: Place the six steps of the accounting cycle in the correct order. Rank the options below. Prepare financial statements.Prepare financial statements. open choices for ranking No answer...
-
During the month of July, the Town of Lynton recorded the following information related to purchases Amount of Purchase Order Actual Cost General government $ 559,000 $ 499,000 Public safety 744,200...
-
The problem I'm facing with this code is it isn't printing force The output should match this exactly I beleive it has something to do with the display function but I might be wrong. The main.cpp...
-
Explain how each of the following may contribute to the effectiveness of monetary policy: establishing news conferences following some FOMC meetings; announcing that the FOMC has an inflation goal of...
-
If I receive a 5% increase in wages and the inflation rate is 5%, am I better off, worse off, or the same? Explain
-
Investment A returns 2400 in t = 6. Investment B returns 2800 in t = 8. At what interest rate do both investments have the same present value in t = 0 (Give your answer as a decimal, i.e. answer 0.06...
-
Ricky quits his job earning $150,000/year and converts a house that he owns into a museum for his large collection of antique clocks. Before this, Ricky had been renting the house out for...
-
How are the structure and function of global societies and global cultures similar and different than global economies and global politics?
-
Littleton Books has the following transactions during May. May 2 Purchases books on account from Readers Wholesale for $2,500, terms 2/10, n/30. May 3 Pays cash for freight costs of $120 on books...
-
A Alkynes can be made by dehydrohalogenation of vinylic halides in a reaction that is essentially an E2 process. In studying the stereochemistry of this elimination, it was found that...
-
Find vo (t) in the circuit of Fig. 16.46. 1 H
-
Find the Laplace transform of each of the following functions: (a) t2 cos (2t + 30)u(t) (b) 3t4e-2t u(t) (c) 2tu(T) - 4 d/dt (t) (d) 2e-(t-1) u(t) (e) 5u(t/2) (f) 6e-t/3 u(t) (g) dn/dtn (t)
-
Find v 0 (t), for all t > 0, in the circuit of Fig. 16.41. 1 H 0.5F u() A
-
Go to www.mindtools.com/pages/article/newTMC_07.htm and read the article on managing risks. What does the article say about creating a systematic methodology for managing project risks? How does this...
-
This chapter suggests that considering contractual arrangements is an important factor when managing the project scope. What are the advantages and limitations of turnkey and cost-plus contracts?
-
On January 14, 2011, Secretary of Homeland Security Janet Napolitano made it official: the Virtual Fence Project was to be officially canceled. In her statement explaining the decision, Napolitano...
Study smarter with the SolutionInn App