generation of random no.

1 Ansicht (letzte 30 Tage)
SAHIL SAHOO
SAHIL SAHOO am 4 Sep. 2022
Beantwortet: Walter Roberson am 4 Sep. 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 Kommentar
James Tursa
James Tursa am 4 Sep. 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)]

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Sep. 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.

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by