generation of random no.

2 次查看(过去 30 天)
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 个评论
James Tursa
James Tursa 2022-9-4
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)]

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-9-4
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by