필터 지우기
필터 지우기

generation of random no.

조회 수: 2 (최근 30일)
SAHIL SAHOO
SAHIL SAHOO 2022년 9월 4일
답변: Walter Roberson 2022년 9월 4일
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