Generate a random sequence with assigned probabiity

1 回表示 (過去 30 日間)
Shailee Yagnik
Shailee Yagnik 2019 年 10 月 16 日
回答済み: Jeff Miller 2019 年 10 月 17 日
Suppose we have 4 symbols [1 2 3 4] with each having probability []0.5 0.1250 0.1250 0.250]
How can i generate a sequence randomly accordiing to the assigned probabilities?

回答 (1 件)

Jeff Miller
Jeff Miller 2019 年 10 月 17 日
Homework? OK, here's a hint: Imagine that you have an array with 8 positions and that you choose array positions randomly (each position has probability 0.125). Now imagine that some of the symbols 1-4 appear in more than one in array position.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by