I am trying to implement a recursive function, but that is too computationally intensive. I think there are certain ways to simplify recursive functions into geometric (or arithmetic) series.
If it can be simplified, than I can just code the simplified formulae.
My hypothetical situation is this :
I have 4 candidates, and each candidates picks a number, from a given array, consecutively. The array has 8 values inside, and the probability of picking any one value in the array is the same (i.e. 1/8).
Hence, at time = 0, candidate 1 randomly picks a number. if that number = X (such as 6), then the loop stops. If candidate 1 doesn't pick X, then it goes to candidate 2, and candidate 2 randomly picks a number. If that number = X, then loop stops. If all 4 candidates don't pick X, then it goes back to candidate 1, and start all over again.
Given 4 person (or N = 4 consecutive candidates), and a 8 possibilities for each time-slice, I am trying to compute two scenarios
what is the probability the first person (e.g. candidate A) is the first one to get X (a certain value I specify). Similarly, what is the probability the 2nd person (e.g. B) is the first person to get X?
what is the probability person A (first person) hits X, and then person B hits X.