简体   繁体   中英

Simplifying recursive formula in geometric (or arithmetic) series

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 (ie 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 (eg candidate A) is the first one to get X (a certain value I specify). Similarly, what is the probability the 2nd person (eg 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.

As described in the comment

Sum[(7/8)^(4i)(1/8),{i,0,Infinity}]
(*512/1695*)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM