Average of 2 sets of random numbers

1 visualización (últimos 30 días)
Aren Arslanyan
Aren Arslanyan el 20 de Sept. de 2020
Comentada: Adam Danz el 20 de Sept. de 2020
I need to create a fair sided coin, tails=-1 and heads=+1, and run a random number generator that gives the results of a 100 flips, 1000 flips

Respuestas (1)

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 20 de Sept. de 2020
Take a look at the binomial generator, it does what you want to.
  1 comentario
Adam Danz
Adam Danz el 20 de Sept. de 2020
+1
Another option that doesn't req. Stat & ML Toolbox:
n = 10; % Number of coin flips
f = round(rand(1,n)).*2-1;
% f =
% -1 -1 1 -1 -1 1 1 -1 1 -1

Iniciar sesión para comentar.

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by