Hi,
I am writing a little program which uses a sub which invokes itself in a recursive loop as a translation from python-code.
I find that one parameter (numCoins) diminishes each time the recursion takes place while the parameter itself never is changed.
How is this possible?
I attached the code.
thnx in advance
PS: the program is ment to calculate the probability for a run of at least K Heads in N times flipping a coin.
I am writing a little program which uses a sub which invokes itself in a recursive loop as a translation from python-code.
I find that one parameter (numCoins) diminishes each time the recursion takes place while the parameter itself never is changed.
How is this possible?
I attached the code.
thnx in advance
PS: the program is ment to calculate the probability for a run of at least K Heads in N times flipping a coin.