google binomial probability. pretty straight forward. essentially you look at the probability of rolling 1-12, then you look at the number of possible outcomes (eg: success first 12 rolls, failure the rest, success first 13 rolls, failure the rest, etc).
no idea why you posted in programmer's haven.
This post was edited by carteblanche on Jan 17 2016 08:18am