Not sure how to make the title perfect, but I'll try to explain the best I can:
So I'm trying to make a calculator for finding the probability of getting s successes in a row given t trials with a probability of p (x-axis); a binomial. So far, I've found a formula that basically calculates how many of the possible trials doesn't result in the s-long streak; in other words, if you have 5 trials, then you'd have 32 possible outcomes, and if you're looking for a streak of 5, 31 of those 32 do not have a streak of 5. It goes as follows:
g(x) = {2^t if t<s
sum(i=1, s)g(t-i) if t>=s```
From that, I would have to apply a probability curve to this value to get the correct final probability. However, I am struggling to find the actual algorithm/formula to do so. At first, I tried applying this:
```p^(log_0.5( (2^t-g(t))/2^t)```
But while I thought this was correct, I compared it to the actual results and it did not match. The actual results I could find for several combinations are listed [here](https://www.desmos.com/calculator/dmszzwbof6), where `n = t`, `a = 2^t`, and `b = g(t)` for different `s` values as `s` goes from `t` to `1` (*note: some of the equations when n=8 aren't exact*). I know that, for each of these polynomials, the degree is equal to `n` and each coefficient in the polynomial sums up to `1`. In addition, if `b = a-1`, the polynomial equates to `x^n`, while if `b = 1`, the polynomial equates to `-(1-x)^n + 1`. I've tried several ways to make a formula that gets the correct curve when given the a/b values but I haven't succeeded; though, I believe the final solution would use summation for finding a larger polynomial's degree. Other than that, I'm basically lost. Any help?