Last active
December 3, 2020 04:46
-
-
Save renatojobal/5da85864e933837d6bd3e043bd567564 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = [14 15 16 17 18 19 20]; % Vector con los eventos favorables | |
% Obtenemos un vector de 100 elementos | |
y = []; | |
% La manera para que cada numero entre 14 y 20 tenga la misma probabilidad de aparaecer | |
% es que cada número aparesca 14 veces dentro del vector | |
for i = 1:14 | |
y(end+1) = x(1); | |
y(end+1) = x(2); | |
y(end+1) = x(3); | |
y(end+1) = x(4); | |
y(end+1) = x(5); | |
y(end+1) = x(6); | |
y(end+1) = x(7); | |
end | |
y(end+1) = 0; | |
y(end+1) = 0; | |
y | |
% Podemos ver que para cada numero el número de repeticiones que se encuentra el número es la misma | |
p14 = length(find(y==14)) | |
p15 = length(find(y==15)) | |
p16 = length(find(y==16)) | |
p17 = length(find(y==17)) | |
p18 = length(find(y==18)) | |
p19 = length(find(y==19)) | |
p20 = length(find(y==20)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment