If you have ever spent hours grinding for a specific weapon in an RPG or opened dozens of crates in a battle royale hoping for a rare skin, you have interacted with RNG (Random Number Generation). Mobile gaming thrives on RNG. It dictates the physics of the world, the damage of your critical hits, and most importantly, the loot drops.
But how do developers decide exactly how rare an item should be? And as a player, how can you mathematically predict the cost of obtaining that item? The answer lies in a foundational concept of probability: Expected Value.
In this article, we will bridge the gap between abstract statistics and video game mechanics, exploring how expected value governs the virtual economies we interact with every day.
What is Expected Value?
In probability theory, the Expected Value (often denoted as E[X]) is the anticipated average outcome of a random event if you were to repeat it an infinite number of times. It does not tell you what will happen on your next attempt, but it tells you the mathematical center of gravity for the system.
The formula for the expected value of a discrete random variable is straightforward. You multiply each possible outcome (x) by its probability (P(x)), and sum them all together:
E[X] = Σ (x × P(x))
Applying E[X] to Loot Crates and Gacha
Let’s map this to a real-world gaming scenario. Imagine a battle royale game offers a premium loot crate for 100 in-game currency. The crate has the following drop rates:
- Common Item (Worth 10 currency): 70% chance (0.70)
- Rare Item (Worth 50 currency): 25% chance (0.25)
- Legendary Skin (Worth 1,000 currency): 5% chance (0.05)
Is buying this crate a mathematically good deal? Let’s calculate the Expected Value of the crate's contents.
E[X] = (10 × 0.70) + (50 × 0.25) + (1000 × 0.05)
E[X] = 7 + 12.5 + 50
E[X] = 69.5
The expected value of the crate is 69.5 currency. Because the crate costs 100 currency to open, the mathematical reality is that you are losing an average of 30.5 currency per pull. Over a massive sample size of players, the "house" (the game developer) always wins.
The "Gambler’s Fallacy" and Independent Events
A common trap players fall into is the Gambler's Fallacy—the belief that if an independent event hasn't happened recently, it is "due" to happen soon.
If the drop rate for a 5-star character or a Mythic weapon is 1%, many assume that doing 100 pulls guarantees the drop. Mathematically, this is false. These pulls are generally independent events; the game does not remember your past failures.
To find the probability of getting at least one 1% drop in 100 pulls, we must calculate the probability of the opposite (getting zero drops) and subtract it from 1.
The chance of not getting the item on a single pull is 99% (0.99).
For 100 pulls, the probability of failing every single time is:
P(No Drop) = (0.99)^100 ≈ 0.366
So, the probability of getting at least one legendary drop is:
P(At least one) = 1 - 0.366 = 0.634
Even after 100 attempts at a 1% drop rate, you only have a 63.4% chance of success.
The Solution: Pity Systems and State-Based Probability
To prevent extreme bad luck from ruining the player experience, modern RPGs and gacha titles implement "Pity Systems." A pity system alters the probability dynamically. For example, the drop rate might remain low for the first 89 pulls, but if you haven't received the high-tier item by pull 90, the probability suddenly jumps to 100%.
From a software engineering perspective, this transitions the system from independent events (simple multiplication) to a Markov Chain or State Machine, where the probability of your current action is strictly dependent on the accumulated state of your previous actions.
Conclusion
Understanding probability doesn't just help you pass engineering entrance exams; it makes you a smarter consumer of digital media. By calculating expected value and understanding the math
Top comments (0)