Sorry for the dumb wording, or asking a question that may have been answered before, I'm not familiar with the vocabulary so I don't really know how to ask the question or what to search for.
I can best explain what I'm looking for with an example.
Let's say you have a bag of marbles, 4 red and 1 blue. Whenever you pull a red marble, you replace it with a blue marble and return it to the bag, the odds of pulling a blue marble on the next turn are increased. Whenever you pull a blue marble you return all of the original red mables marbles back to the bag and remove all but 1 blue marble.
On turn 1 there's a 20% chance to pull the blue marble. If you pulled a red on turn 1, then there is a 40% chance to pull a blue on Turn 2, but if you did pull the blue on Turn 1 then there's a 20% chance to pull the blue on Turn 2.
So at first you have 20% chance, if you fail then you have a 40% chance, if you fail again then you have a 60% chance, if you fail again you have an 80% chance, and if you fail that you are gauranteed to get ablue on the 5th turn. Every time you pull a blue it resets back to 20%.
I wrote a program to simulate 1000 turns in a row, ran it multiple times, and I get results ranging from 375-420 blues per 1000 turns.
So I believe the answer is somewhere between 37.5% and 42%, but is there some sort of formula that can be used to calculate how likely you are to pull a blue without knowing what happened on previous turns?
I found a kind of similar question this and was able to adapt that answer to my problem.
$$\sum\limits_{n=1}^{5}\bigg(n\cdot0.2n\cdot\prod\limits_{j=0}^{n-1}(1-0.2j)\bigg)$$
This gives me ~39.8% which also happens to line up with my expected result, and very close to the center of the range I thought it was in (38.75%, only off by 0.05%!)
This sums the chance of each attempt
Add them all up, it will take 0.2 + 0.64 + 0.864 + 0.6144 + 0.192 = 2.5104 attempts per "win", or 1 / 2.5104 = ~39.8% chance per attempt.