0

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

  1. 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?

  2. what is the probability person A (first person) hits X, and then person B hits X.

Kiann
  • 531
  • 1
  • 6
  • 20
  • For scenario 1, `P(A)==1/8+(7/8)^4*1/8+(7/8)^8*1/8+...=1/8*(r^0+r^1+r^2+...)` where r=(7/8)^4. So `r=(7/8)^4;1/8*Sum[r^i,{i,0,Infinity}] == 512/1695` You modify that slightly to find P(B). I am a confused by scenario 2. Your description says everything stops the moment someone hits X, but scenario 2 says "A hits and then B hits." Please check all this carefully to make certain that everything is correct. – Bill Mar 25 '19 at 19:26
  • For scenario 1 you might also think a little. what additional calculation could you perform to give some more confidence that the result might be correct or definitely show that the result is incorrect. – Bill Mar 25 '19 at 21:11

1 Answers1

1

As described in the comment

Sum[(7/8)^(4i)(1/8),{i,0,Infinity}]
(*512/1695*)
Bill
  • 3,664
  • 1
  • 12
  • 9