Effacer les filtres
Effacer les filtres

generation of random no.

2 vues (au cours des 30 derniers jours)
SAHIL SAHOO
SAHIL SAHOO le 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 commentaire
James Tursa
James Tursa le 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)]

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 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.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by