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
-
Describe the process of periodontal disease.
-
Prudence Professor made an agreement to teach at Colorado Mesa University for one year for $80,000. Discuss whether (a) Prudence can delegate her teaching position to her friend, Honor Johnson, a...
-
The following information from Buchanan Company's current operations is available: Required a. Prepare a multiple-step income statement. Disregard earnings per share. b. Prepare a single-step income...
-
Journalize the transactions of Ward Technology Solutions. Include an explanation with each journal entry. Use the following accounts: Cash; Accounts Receivable; Office Supplies; Prepaid Advertising;...
-
1 of 1 5.78 / 13 look for slow-moving inventory. C. Perform cash cutoff tests by inspecting documentation, Existence. completeness. valuation and allocation. and rights and obligations for cash...
-
Scenario and General Fund budgetary journal entries The scenario: Croton City maintains four governmental-type funds: a General Fund, a Library Special Revenue Fund, a Capital Projects Fund, and a...
-
The figures in the table below represent the only income payments received by households. Rent Wages Interest and profit bn 5 75 20 Assume that there are injections into and withdrawals from the...
-
The following information is available from Ruby's financial records as at December 1, 2022. Cash $25,000 Furniture 8,000 Content of Home 5,000 House 300,000 Line of Credit 45,000 Mortgage 285,000...
-
Acme Company uses process costing. During the current month, the third processing department's beginning work in process inventory includes 2,400 units that are 45% complete with respect to direct...
-
Design a marketing strategy for Indian Oil Corporation ( IOC ) to invest in urban Berlin Discuss the various products in your petro retail station that could cater to the specific customers ? Justify...
-
Basic but detailed Information about the firm under consideration, including its historical evolution, areas of activity, i.e., type of goods/service it provides, geographical operations, management...
-
We observe that Portfolio R has the lowest standard deviation of the residuals. Of course, we know from the econometric theory that the expected value of the residuals is zero. Would it be possible...
-
Please number each question and give a clear answer Describe ecological research design and tell how this research design is different than cross-sectional research design. Discuss two variables of...
-
Planning: Creating an Audience Profile; Collaboration: Team Projects. Compare the Facebook pages of three companies in the same industry. Analyze the content on all available tabs. What can you...
-
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
-
What differences distinguish succession planning, chief executive transition, and emergency planning?
-
Discuss the benefi ts of hiring an outside interim chief executive. What are the pros and cons of a board member acting as the interim chief executive?
-
COSO identified five interrelated components of internal controls. Which of the following is not one of those five? a. risk assessment b. internal control policies c. monitoring d. information and...
Study smarter with the SolutionInn App