Please use MatLab to do the following question Consider an e

Please use MatLab to do the following question:

Consider an experiment of tossing a biased coin n = 100 times and recording the number of heads. Let the probability of heads be p = 0.7. Create a function that returns a vector of t = 10000 trials of the experiment. The signature of the function should be

trials = function(n, t, p).

Solution

Number of Heads in n tosses of a biased coin with probability p to be Head is given by the Binomial Distribution.

Had some problem in Matlab, so could not test. This should work.

% n = 100, t = 10000, p = 0.7
function trials = binoTest(n, t, p)
   % Create a vector.
trials = []
   % Create a vector
x = 0:1:n;
  
for j = 1:n:t
a = binopdf(x,n,p);
       trials = [trials, a];
end
end

Please use MatLab to do the following question: Consider an experiment of tossing a biased coin n = 100 times and recording the number of heads. Let the probabi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site