# Dice probability counting intermediate results?

I'm having trouble figuring out how to determine the probabilities for this specific dice mechanic (the game in question is Bang, the Dice Game but I'll try to generalize it).

In this game, rolls act like Yahtzee, where you roll three times, choosing any of them to keep or reroll based on what you get. However, one of the results (lets say 1) has an IMMEDIATE negative consequence when you roll it (losing 1 health for example). You can reroll this result to a better one, but that roll is still counted.

My question is, for a Yahtzee-like game, what is the probability of getting this negative result (a 1 in 6 chance) a given number of times, including those obtained during intermediate rolls? For example, if you roll five dice and get two 1s, then reroll all five and get three 1s, then reroll all five and get no more 1s, that's a total of 5.

It's going to depend on how many dice you reroll. Which again is going to depend on what final result you're aiming for, and how you try to reach it. But if you know the total number of die rolls you make, then it's relatively easy: Binomial distribution, with $$p = \frac16$$.
Specifically, if you somehow know that you're going to roll a total of $$10$$ dice, say (for any other number just swap $$10$$ with that number), then the probability of getting $$3$$ ones, say (for any other number, just swap the $$3$$ with that number), is $$\binom{10}{3}\left(\frac16\right)^3\left(\frac56\right)^{10-3}$$ (That first bracket is a binomial coefficient, the two others are regular fractions.)