THe following code generates random numbers with a given probability of success:
n=[randi([0 1],1,8) ones(1,8)];
n= n(randperm(10));
If the above lines are repeated random (unpridictable) values will be generated:
This is n for the first run:
n = 1 0 1 0 0 1 1 1 1 1
This is n for the second run:
n = 1 1 1 0 1 1 1 1 1 1
How can I make the generator picking the number of already selected as failure(0) with higher probability?
That is the probability person 2, 3 and 4 in the second round has more probability of loosing. This does not mean that they have to fail.
The entries 1 to 10 are 10 different user outputs.
ok let us say always a max of 30% of entries will be 0. In every time the above is executed. However this is done randomly. So a max of any 3 of the 10 can be zero.
I do not want the probability of success to change.Just to control which one is zero.
To clarify further What I want: If 3 will be chosen “randomly” to be zero then let the previously chosen three have higher probability to be picked and not be picked.
Here’s a solution with the following logic:
Note that I assume that it is equally likely to have 0,1,2, or 3 failures.