Azzera filtri
Azzera filtri

generation of random no.

2 visualizzazioni (ultimi 30 giorni)
SAHIL SAHOO
SAHIL SAHOO il 4 Set 2022
Risposto: Walter Roberson il 4 Set 2022
y0=[0; 0; 0; 0; 0; sqrt(0.05); sqrt(0.05); sqrt(0.05) ; sqrt(0.05); sqrt(0.05); 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]
can it's possibple that first 10 number in this will be random and rest wil be zero?
  1 Commento
James Tursa
James Tursa il 4 Set 2022
Please be more specific. You can use the rand( ) function to generate as many random numbers as you want. E.g.,
[rand(10,1);zeros(10,1)]

Accedi per commentare.

Risposta accettata

Walter Roberson
Walter Roberson il 4 Set 2022
Yes, it is possible that the y vector you showed is the outcome of a random process.
You have two states, 0 and sqrt(0.5). Your initial 10 elements could be rewritten as sqrt(0.5)*[0 0 0 0 0 1 1 1 1 1]. If we suppose IIRD (independent identical random distribution) we could use an of several models, including Uniform Random Distribution with equal weights. That is, we could imagine a system in which fair coins are flipped. What would be the probability of that particular outcome in that model? It would be 1 (particular outcome) in 2^10 possible outcomes. Which would be 1 in 1024. And since that is not "zero" the answer has to be that, Yes, it could be the outcome of a random system.

Più risposte (0)

Categorie

Scopri di più su Random Number Generation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by