add octave 03 and 04

This commit is contained in:
Andrew 2019-11-22 22:51:59 +07:00
parent 8fecab6dcf
commit 389e4c7dbd
8 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# Ôóíêöèÿ ìîäåëèðóåò nexp ýêñïåðèìåíòîâ ïî ïîäáðàñûâàíèþ ìîíåòêè
# nflip ðàç
function [s] = flip_stats(nflip, nexp)
s = zeros(1, nflip+1);
for i = 1:nexp;
r = sum_heads(coin_flip(nflip));
s(r+1) = s(r+1) + 1;
endfor
endfunction