While is a structure to iterate from one value to other, it is used to repeat a code for a given number of times.
Example:
p <- [0.3, 0.7];
i = 0;
while i < 2:
result <- 0 [p] 1;
leak(result);
i = i + 1;
Output of variable p:
Probability of the distribution happen | Distribution | Value |
---|---|---|
0.29 | 0.16 | 0.3 |
0.84 | 0.7 | |
0.42 | 0.50 | 0.3 |
0.50 | 0.7 | |
0.29 | 0.84 | 0.3 |
0.16 | 0.7 |
Output of variable result:
Probability of the distribution happen | Distribution | Value |
---|---|---|
0.50 | 1.00 | 0.00 |
0.50 | 1.00 | 1.00 |