Implement a function named calculate_probability that computes the probability of reaching exactly the N-th position in a sequence, given an initial probability P of a specific event occurring.
Inputs
The function takes two parameters:
N (int): An integer representing the target position (N >= 1).
P (int): An integer between 0 and 100 inclusive representing the probability of a specific event occurring (as a percentage).
Outputs
The function returns a float representing the calculated probability of reaching exactly the N-th position, rounded to six decimal places.
Implementation Details
The function should first initialize a list, Prob, to store probabilities for positions 0 through N.
For positions 0 to 3, the specified values are:
Prob[0] = 0
Prob[1] = 0
Prob[2] = P / 100
Prob[3] = 1 - (P / 100)
For positions from 4 to N, the probability should be calculated using the formula: