Optimal Pulling Strategy in Love Live School Idol Festival
by greenturtle3141, Jun 23, 2022, 11:31 PM
Reading Difficulty: 2-3/5
Prerequisites: Know what an expected value is
The Premise
Love Live! School Idol Festival is a gacha rhythm game. You can spend a currency called Love Gems in the gacha system to obtain more powerful characters/cards that can help you earn higher scores.
There are multiple gacha systems in the game. The one we'll focus on in this post is Box Scouting.

Imagine a deck of 100 cards. Among them, there is exactly one card that we consider to have value, which we will call Hanayo. Hanayo's position in the deck is chosen uniformly at random. I can now pay love gems to take cards from the top of the deck until I get Hanayo. Specifically, I have two options. I can either:
QUESTION: What strategy should I follow for obtaining Hanayo so that the expected number of love gems spent is minimized?
To get our feet wet, let's start with a warm-up problem.
Problem 1: What is the expected number of love gems spent when doing only single pulls?
Of course, this is probably not the best strategy, but this is certainly a good starting point. How can we determine this?
We compute this using "casework":
Now we just use the formula for expected value by summing over these 100 "cases":
![$$\mathbb{E}[\text{Love Gems Spent}] = \sum_{n=1}^{100} \left(\frac{1}{100}\right)(5n) = \frac{1}{20}\sum_{n=1}^{100}n$$](//latex.artofproblemsolving.com/8/e/4/8e4f7bea837b1286bee0d76d124351d7fb358a62.png)
That sounds about right! The maximum love gems we could possibly spent is
, so by linearity we should really only expect to spend about half that much to get Hanayo.
Surely this strategy can't be that good. 11-pulling is more efficient because you get to pull more cards per love gem (
cards per love gem, vs.
cards per love gem for single-pulls). Shouldn't the following strategy be much better?
Problem 2: What is the expected number of love gems spent when following this mostly-11-pull strategy?
Computing the expectation is again a matter of "casework".
Altogether:
And indeed that is less than the expectation from the previous strategy, which was
. Hooray, we've proven that this strategy is so much bett-
...hold on, that is a really NARROW margin! The 11-pulls strategy is better by less than half a love gem. How could this be?
Exercise 1: What exactly is the disadvantage of doing only 11-pulls?
Think about it before proceeding! This is a critical point.
Answer
This doesn't mean that 11-pulls are inferior! It just means that there are situations in which the 11-pull is better and situations in which the single pulls are better.
Exercise 2: Can you (roughly) figure out what those situations are?
The answer to this will lay the groundwork for the next section.
Answer
With that discussion in tow, the next plausible strategy should be clear:
"Keep doing 11-pulls while the deck is still large. Then, at some point, switch to single pulls."
Specifically, here is our strategy: For some fixed integer
, we do the following:
Problem 3: What is the expected number of love gems spent in this strategy, for each value of
? Moreover, which value of
minimizes this expectation?
Observe that the case
was our "stupid" only-single-pulls strategy, and the case
is our not-as-stupid-11-pulls-strategy. This should let us verify whether or not we have a correct formula in the end.
Let's get into the casework!
Bringing these cases together:
![$$\mathbb{E}[\text{Love Gems Spent}] = \left[\sum_{n=1}^k \left(\frac{11}{100}\right)(50n)\right] + \left[\sum_{n=1}^{100-11k} \left(\frac{1}{100}\right)\left(50k + 5n\right)\right]$$](//latex.artofproblemsolving.com/5/8/0/58017cef86b8cf5cb2452bcf512ba41b7f707895.png)
After a lot of algebra (or Wolfram Alpha
) this comes out to:
Plugging in
and
, this formula spits out
and
respectively. This is a good indicator that our formula is probably correct!
Now let's plot this formula in Desmos for a good view of what's going on:

Remarkable! The graph is a parabola, meaning that indeed, a strategy that goes "in between" the first two strategies we considered will actually be better! In particular our new strategy with
is best. That is, the best strategy as of now is to do the following:
love gems in expectation, saving around 7 love gems over the previous two strategies. Yay!
Er.
Probably not.
...
I mean, come on, our newest strategy seems so tight and optimized, there really is no way you could do better. Not by much, anyway.
...
And yet, as a math person, you'd get this horrible itch if you just leave the problem be now, because these intuitive feelings are not proof. How can we produce hard, irrefutable evidence that this third strategy is the absolute best, over ALL possible pulling strategies that could possibly exist?
Final problem: Prove that the "
" pulling strategy is the best one.
Our angle of attack will be to prove this inductively. Let
be the expected number love gems spent to get Hanayo in a deck of
cards, when following the best strategy. Can we get a recursive formula for
?
Indeed, we can. Since we can either do a single pull or an 11-pull, we can essentially "check both options" and choose the better of the two. In math form:
In English: "If you do a single pull, you will spend 5 love gems. Then, either you got Hanayo or there is an
chance that you now have a deck of
cards, and now you follow the best strategy for this smaller deck. If you do a an 11-pull, you will spend 50 love gems. Then, either you got Hanayo or there is an
chance that you now have a deck of
cards, and now you follow the best strategy for this smaller deck. These are the two best possible outcomes, so choose the one that spends the least number of love gems in expectation."
But this only makes any sense whatsoever if there are at least 11 cards left. What about if
?
is fully defined, so now we just recursively find all values of
up to infinity in order to prove our claim.
...nah, we're smarter than that. Observe first that
because
. So for a deck of 11 cards, we choose to do a single pull. In fact, we'd be doing all single pulls, since that's our strategy for all single pulls. As long as the best thing to do for a deck of
cards is a single pull, we have that the best strategy for
is ONLY single pulls, and moreover we would have the formula
.
Therefore, we have that:
as long as the best thing to do for decks of sizes up to
cards was to do a single pull, because again, for all such deck sizes we can use the
formula.
This formula will break as SOON as this minimum does NOT choose the left side. Therefore, the smallest value of
in which
will be the FIRST value of
in which the best thing to do is an 11-pull.
If you do the algebra and/or graph both sides, we'll see that this value of
is
. (Funnily enough, both sides are equal for
, meaning that you could do whatever you want. Perhaps you could argue that in this case you should do an 11-pull to save time since it doesn't matter.)
Our summary of findings up to now:
So far, this is consistent with the hypothesis that our latest strategy is the best one! This is because after four 11-pulls, the deck size ends up being
, and then the above findings say that indeed, you now must do an 11-pull.
Now we need to extrapolate our findings to show that for all deck sizes of at least
, the best strategy is an 11-pull.
First, we prove this inductively for
. If for such an
, we have that the best strategy for
is to first do an 11-pull and then do single pulls, then:

![$$\min\left(5 + \frac{n-1}{n}\left[50 + \frac{n-12}{n-1}f(n-12)\right], 50 + \frac{n-11}{n} \cdot \frac{5(n-10)}{2}\right)$$](//latex.artofproblemsolving.com/1/8/0/1807c0ce798a8a4a72167ac0dfcf0309e935c0d6.png)
Some algebra and/or Desmos will show that the left side is always strictly larger than the right side. This implies by induction that the best strategy is to do an 11-pull and then always single pulls for
, and moreover the formula for the expectation is
.
To finish, we need to prove the following claim: For every
, the formula for the expectation for
where
is given by
. We prove this inductively! In the previous paragraph, we showed the base case
. Now assume that the claim holds for some
. We now just need to prove the claimed formula for all
by... using induction. Yeah, an induction inside an induction. The base case would be
, and then you finish the proof for all
in this interval. I think it would not be worth your time to write it out, but what's important is that the optimal strategy can indeed be proven!
We can try and shorten this proof by proving the following claim:
CLAIM: If for a deck of
cards, the best strategy is to do an 11-pull, then the same is true for a deck of
cards.
The following argument comes from "tanoshii".
LEMMA: Let
. If it is known that Hanayo is at the bottom of the deck, then it is optimal to do an 11-pull.
Proof.
Because of the efficiency argument, minimizing the number of love gems spent is now clearly a matter of how many 11-pulls you can squeeze in. Snice
, we can do an 11-pull, thus doing an 11-pull is an optimal strategy. 
To finish the proof of the claim, take a deck of
cards, and note that either Hanayo is at the bottom of the deck or she is not. If she is, then an 11-pull is optimal by the lemma. If not, then the bottom card is not Hanayo, and we can view the problem as just a deck of
cards, in which the best thing to do is an 11-pull by the inductive hypothesis.
...and, voila?
It's certainly a very beautiful argument, and one of my curiosities left over is figuring out how one would formalize it.
Anyways, isn't it simply remarkable how much math came out of a dumb gacha game? Look carefully and you truly can find math anywhere.
tl;dr
Do exactly five 11-pulls, then keep doing single pulls. This is the best possible strategy and it spends
love gems on average.
Prerequisites: Know what an expected value is
The Premise
Love Live! School Idol Festival is a gacha rhythm game. You can spend a currency called Love Gems in the gacha system to obtain more powerful characters/cards that can help you earn higher scores.
There are multiple gacha systems in the game. The one we'll focus on in this post is Box Scouting.

Imagine a deck of 100 cards. Among them, there is exactly one card that we consider to have value, which we will call Hanayo. Hanayo's position in the deck is chosen uniformly at random. I can now pay love gems to take cards from the top of the deck until I get Hanayo. Specifically, I have two options. I can either:
- Spend 5 love gems to take just the topmost card ("Single Pull"), or
- Spend 50 love gems to take the top 11 cards ("11-Pull"), provided that there exist that many cards left.
QUESTION: What strategy should I follow for obtaining Hanayo so that the expected number of love gems spent is minimized?
To get our feet wet, let's start with a warm-up problem.
Problem 1: What is the expected number of love gems spent when doing only single pulls?
Of course, this is probably not the best strategy, but this is certainly a good starting point. How can we determine this?
We compute this using "casework":
- The probability that Hanayo is the first card is
, and in this case we'd spend only
love gems.
- The probability that Hanayo is the second card is
, and in this case we'd spend
love gems.
- The probability that Hanayo is the
th card is
, and in this case we'd spend
love gems.
- The probability that Hanayo is the
th card is
, and in this case we'd spend
love gems.
Now we just use the formula for expected value by summing over these 100 "cases":
![$$\mathbb{E}[\text{Love Gems Spent}] = \sum_{n=1}^{100} \left(\frac{1}{100}\right)(5n) = \frac{1}{20}\sum_{n=1}^{100}n$$](http://latex.artofproblemsolving.com/8/e/4/8e4f7bea837b1286bee0d76d124351d7fb358a62.png)


Can we do better?
Surely this strategy can't be that good. 11-pulling is more efficient because you get to pull more cards per love gem (


- Keep doing 11-pulls.
- If Hanayo is not obtained by the 9th such 11-pull, do a single pull to obtain the remaining card (which must be Hanayo).
Problem 2: What is the expected number of love gems spent when following this mostly-11-pull strategy?
Computing the expectation is again a matter of "casework".
- For each
, the probability that Hanayo is in the
th range of 11 cards (i.e. the cards in positions
,
, ...,
, and
) is exactly
, and in this case we'd spend
love gems.
- The probability that Hanayo is the very last card is
, and in this case we'd spend
love gems.
Altogether:
![$$\mathbb{E}[\text{Love Gems Spent}] = \left[\sum_{n=1}^9 \left(\frac{11}{100}\right)(50n)\right] + \left(\frac{1}{100}\right)(455) = \boxed{252.05}$$](http://latex.artofproblemsolving.com/c/4/f/c4fc0dc799ae40b83ab276469c16878d743c2ee2.png)

...hold on, that is a really NARROW margin! The 11-pulls strategy is better by less than half a love gem. How could this be?
Exercise 1: What exactly is the disadvantage of doing only 11-pulls?
Think about it before proceeding! This is a critical point.
Answer
The disadvantage is that if you do an 11-pull and Hanayo comes early in the 11-pull, then you're wasting the love gems spent on all the later cards pulled!
Imagine if Hanayo was at the top of the deck, and you do an 11-pull. Then you spent 50 love gems to get Hanayo, when you could've just spent 5.
Imagine if Hanayo was at the top of the deck, and you do an 11-pull. Then you spent 50 love gems to get Hanayo, when you could've just spent 5.
This doesn't mean that 11-pulls are inferior! It just means that there are situations in which the 11-pull is better and situations in which the single pulls are better.
Exercise 2: Can you (roughly) figure out what those situations are?
The answer to this will lay the groundwork for the next section.
Answer
Imagine if the deck had a million cards. Then it's so unlikely that Hanayo is near the top of the deck that it's a good idea to do 11-pulls. Here, the love gems saved by doing the "efficient" 11-pull deal wins out over the danger of wasting love gems to unnecessary pulls, because the probability of this danger is very low.
However, once the deck gets really small, the probability of this danger starts increasing, to the extent that is might start to win out over the "efficiency" of 11-pulls.
Hence, the rough motto is "11-pulls are better when the deck is larger."
However, once the deck gets really small, the probability of this danger starts increasing, to the extent that is might start to win out over the "efficiency" of 11-pulls.
Hence, the rough motto is "11-pulls are better when the deck is larger."
Can we do better?
With that discussion in tow, the next plausible strategy should be clear:
"Keep doing 11-pulls while the deck is still large. Then, at some point, switch to single pulls."
Specifically, here is our strategy: For some fixed integer

- Do exactly
11-pulls at the start.
- Do
single pulls.
Problem 3: What is the expected number of love gems spent in this strategy, for each value of


Observe that the case


Let's get into the casework!
- For
, the probability that Hanayo is in the
th range of 11 cards is
, and in this case we spend
love gems.
- For
, the probability that Hanayo is the
card is
, and in this case we spend
love gems.
Bringing these cases together:
![$$\mathbb{E}[\text{Love Gems Spent}] = \left[\sum_{n=1}^k \left(\frac{11}{100}\right)(50n)\right] + \left[\sum_{n=1}^{100-11k} \left(\frac{1}{100}\right)\left(50k + 5n\right)\right]$$](http://latex.artofproblemsolving.com/5/8/0/58017cef86b8cf5cb2452bcf512ba41b7f707895.png)







Now let's plot this formula in Desmos for a good view of what's going on:

Remarkable! The graph is a parabola, meaning that indeed, a strategy that goes "in between" the first two strategies we considered will actually be better! In particular our new strategy with

- Do exactly five 11-pulls.
- If Hanayo is not obtained, do 45 single pulls until she is obtained.

Can we do better?
Er.
Probably not.
...
I mean, come on, our newest strategy seems so tight and optimized, there really is no way you could do better. Not by much, anyway.
...
And yet, as a math person, you'd get this horrible itch if you just leave the problem be now, because these intuitive feelings are not proof. How can we produce hard, irrefutable evidence that this third strategy is the absolute best, over ALL possible pulling strategies that could possibly exist?
Final problem: Prove that the "

Our angle of attack will be to prove this inductively. Let



Indeed, we can. Since we can either do a single pull or an 11-pull, we can essentially "check both options" and choose the better of the two. In math form:





But this only makes any sense whatsoever if there are at least 11 cards left. What about if

- If you wear your thinking cap, get in your thinking chair, and then do the The Thinker pose, and muse philosophically, you can argue that
. Technically it works out.
- For
, clearly the only strategy is to do single pulls, and this spends
love gems in expectation. So
for all
.


...nah, we're smarter than that. Observe first that





Therefore, we have that:



This formula will break as SOON as this minimum does NOT choose the left side. Therefore, the smallest value of



If you do the algebra and/or graph both sides, we'll see that this value of



Our summary of findings up to now:
- For decks of sizes
, the best strategy is to do single pulls.
- For a deck of size
, you first do an 11-pull.
So far, this is consistent with the hypothesis that our latest strategy is the best one! This is because after four 11-pulls, the deck size ends up being

Now we need to extrapolate our findings to show that for all deck sizes of at least

First, we prove this inductively for




![$$\min\left(5 + \frac{n-1}{n}\left[50 + \frac{n-12}{n-1}f(n-12)\right], 50 + \frac{n-11}{n} \cdot \frac{5(n-10)}{2}\right)$$](http://latex.artofproblemsolving.com/1/8/0/1807c0ce798a8a4a72167ac0dfcf0309e935c0d6.png)
![$$\min\left(5 + \frac{n-1}{n}\left[50 + \frac{n-12}{n-1} \cdot \frac{5(n-11)}{2}\right], 50 + \frac{n-11}{n} \cdot \frac{5(n-10)}{2}\right)$$](http://latex.artofproblemsolving.com/c/f/7/cf7e0cff41fd1613054acedb8ee30169ebaf6458.png)


To finish, we need to prove the following claim: For every









Can we do better?
We can try and shorten this proof by proving the following claim:
CLAIM: If for a deck of


The following argument comes from "tanoshii".
LEMMA: Let

Proof.
Because of the efficiency argument, minimizing the number of love gems spent is now clearly a matter of how many 11-pulls you can squeeze in. Snice


To finish the proof of the claim, take a deck of


...and, voila?
It's certainly a very beautiful argument, and one of my curiosities left over is figuring out how one would formalize it.
Anyways, isn't it simply remarkable how much math came out of a dumb gacha game? Look carefully and you truly can find math anywhere.
tl;dr
Do exactly five 11-pulls, then keep doing single pulls. This is the best possible strategy and it spends

This post has been edited 4 times. Last edited by greenturtle3141, Jun 23, 2022, 11:36 PM