# Creating an Interaction that Uses Probability

Sep 15, 2020

I'm thinking about a decision making scenario where the responses to a particular choice are probabilistic in their appearance as opposed to determined based on the choice. So if I have 3 choices, I don't just get outcome A for choice #1, outcome B for choice #2 and outcome C for choice #3. Instead if I pick choice #1 it might be 20% chance of getting A, 30% chance of getting B and 50% chance of getting C.

I did a search of "articulate storyline" and "probability" but not much came up. I found this Random Number Challenge but only one of the 27 examples offers the opportunity to download the file. The rest are pretty cool to see in action but don't really help me out in learning how to set them up.

When it comes to math, I'm a special kind of stupid so are there more examples out there of files that can be downloaded that would show how folks set up their variables to be probabilistic or are there any tutorials out there that would take you through how to set up variables in a probabilistic way?

###### 10 Replies

For the example you cited, I would create ten possible outcomes:, using ten variables. Two of them would be equal to outcome A, three equal to outcome B, and five equal to outcome C. then use the random number function to generate a random number between 1 and 10. Create ten triggers: show outcome 1(A) if random number is 1, show outcome 2(A) if random number is 2, etc.

That's helpful. Thank you Walt. So you would order the ten triggers as
follows?

1 = 1a
2 = 2a
3 = 1b
4 = 2b
5 = 3b
6 = 1c
7 = 2c
8 = 3c
9 = 4c
10= 5c

1 = 1c
2 = 1a
3 = 1b
4 = 2c
5 = 3c
6 = 2b
7 = 2a
8 = 4c
9 = 3b
10 = 5c

Would you see spreading the choices out instead of grouping them as better,
worse or the same?

What I meant was to assign these values to the variables:

Variable1 = A
Variable2 = A
Variable3 = B
Variable4 = B
Variable5 = B
Variable6 = C
Variable7 = C
Variable8 = C
Variable9 = C
Variable10 = C

Then if the random number is 1, show Variable1, which is choice A.

If you want to mix them up, it won't hurt anything, but if somebody has to come in in the future and do maintenance on the project, this allows them to see at a glance what the percentages are.  The mixing up is done by the random generation function.

Wait, Stop! I'm afraid that this might not work the way you want it to . I made this suggestion thinking that the random number function was dynamic. After researching more, I find that it is static; that it generates only one random number when the project starts. That means you need create only three triggers: choose option A if RandomNumber is between 1 - 2, choose option B if RandomNumber is between 3 - 5, choose option C if RandomNumber is between 6 - 10. The first time you click the object, you will get an unpredictable result. But the problem is that it will be random only once. If it is clicked again, the random number will be the same, and the choice will be the same.

If the learner goes through each scenario only once, that approach will work for you. You just need a different variable for each scenario, and it will work. If you want to give multiple opportunities through the scenario, you will need to use javascript to do that. It's not too difficult, but I don't have time to do a sample right now.

You can add a trigger to adjust a variable to random number when they retake the scenario

Thank you again Walt. I was hoping to use this in a branching scenario and
so the project would have multiple decision points where I wanted to apply
probability to the outcome of the learner's choice at each decision point.
For now I will try and rethink my approach given this information.

I've been giving you bad advice based on a poor understanding of the random number function. Thanks to Phil and more research, I can now definitively tell you that what you want is possible, and easy.

Check the attached sample. If you click Option 1 repeatedly, you should see result #2 slightly more often than result #1, and result #3 about as often as the other two combined. In fact, if you click it 10,000 times, you will probably see these results:

#1 20%

#2 30%

#3 50%