Rewards per room

33 Views Asked by At

I have the following problem.

  • A person visits multiple rooms.
  • In each room there is a box with a prize.
  • The person can only be awarded one prize.
  • There is equal chance that the person gets awarded a prize in room 1 or room 5.
  • We don't know what rooms the person will visit. They usually start in room 1 but they might go to room 2 or 3 or not visit any other rooms at all
  • Each room should have a good chance to give the person a reward. If the person goes to room 1 to room 4, they should have a good chance of getting a reward in room 4 as they are in room 1. If the person only visits room 1, they should have a good chance of getting a reward in room 5 if they come back the next day and go to room 5 only if they did not get a reward previously. Remember, the user can only be rewarded ONCE.

What algorithm can I use to decide to reward the user in each room so that regardless of the rooms or order of the rooms the person visits, there is always a good chance they will get rewarded in each room?