| Reference | Downloads | Github

Three-Armed Bandit Task

I am using PsychoPy 3 version 2021.1.3 with MacOS Big Sur.
In this probabilistic learning task for reinforcement learning, there are three shapes(circle, square, triangle) and I am trying to assign probabilities of getting it correct for each shape. Three of the shapes will be presented and the participant will have to choose one shape. I am trying to make circle to have 60% correct and 40% incorrect for each trial, and the other shapes to have 20% of correct and 80 incorrect for each trial. I don’t know how to start writing the code. Please, help me write the python code for it.
Thank you in advance,


One way would be to have a list E.g. shapes = [β€˜c’,’c’,’c’,’t’,’s’] and then shuffle(shapes) before each trial and have the correct answer as shapes[0]

Alternatively, use a spreadsheet with 3 circle rows for each triangle and square row.

1 Like

Thank you! I already did it with an excel spreadsheet. I was wondering how I could do it with python codes though. What would the python code be?