Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this question the answer has to be in programming script in mat lab.. Please

ID: 2085824 • Letter: F

Question


For this question the answer has to be in programming script in mat lab.. Please..im using matlab_r2017.

Question 1 (10 Points) When a fair die is rolled, the number uppermost is equally likely to be any integer between 1 and 6. MAT function generates uniformly distributed pseudorandom integers. Use this documented MATLAB program (dietoss.m) to simulate a fair die roll of N 10, 100, 1000 and 10,000 times. For each trial, count the number of sixes thrown by constructing a logical vector and counting the number of appears. Use MATLAB's vectorizing commands for logical operators in your solution. Estimate the probability of throwing a six by dividing the number of sixes by 1 Compare each to the theoretical expected value of 1/6. times 6 0, 100, 1000 and 10,000 respectively.

Explanation / Answer

Matlab Code:

countofSix = [];
probabilty = [];
num = 0;
for i=1:10
if randi(6)==6
num = num + 1;
end
end
countofSix = [countofSix num];
probabilty = [probabilty num/10];

num = 0;
for i=1:100
if randi(6)==6
num = num + 1;
end
end
countofSix = [countofSix num];
probabilty = [probabilty num/100];
num = 0;
for i=1:1000
if randi(6)==6
num = num + 1;
end
end
countofSix = [countofSix num];
probabilty = [probabilty num/1000];

num = 0;
for i=1:10000
if randi(6)==6
num = num + 1;
end
end
countofSix = [countofSix num]
probabilty = [probabilty num/10000]

output:

countofSix = [countofSix num]

probabilty = [probablty num/10000]

countofSix = 1 15 182 1623

probablty =

0.10000 0.15000 0.18200 0.16230

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote