Generate 10000 numbers using RAND with probability
11 次查看(过去 30 天)
显示 更早的评论
- Given a sequence of U(0,1) random numbers, obtain and describe an algorithm that generate binary random numbers with the following point masses:
P{X = 0} = 0.3, P{X = 1} = 0.7
- Use MATLAB (0, ) random number generator “rand” to generate 10,000 random numbers with the above distribution.
- Compute the average value of the 10,000 numbers generated. Compare it with the theoretical mean.
- Give the percentages of the numbers generated that are equal to -1,0, and 1, respectively. Compare them with the point masses and make a comment.
回答(2 个)
Ganesh shankar ram
2022-11-15
Generate Random Sequences of length 10000
uniformly distributed over the interval 0 and0.5
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!