ive got a coin toss simulation game where score is kept.
function = coin_toss(s(0),N)% coin toss simulation
% a coin is tossed n times, at each point a score is given +1 for heads
% and -1 for tails.
N=input(10)for k=1:Nrand_number=rand;if random_number<0.5random_number(k,1)=-1;elserandom_number(k,1)=1;for i=1:N, s(0)=-1 s(N)= s(N-1)+random_numberendendend
I basicly want to have an output of the scores after each flip divided by the flip number in a vector e.g
[(-1/1),(s(1)/2),(s(2),3)…….. (s(N)/(N+1)] [-1,
Best Answer