This page explains the mathematical concepts and calculations used to determine expected values, required bankrolls, and probabilities in our case opening simulator.
The expected value of opening a case is calculated using probability theory and represents the average amount you would receive if you opened the case an infinite number of times.
For each case, we calculate:
EV = Σ(probability_i × value_i)
Where:
probability_i
= chance of getting item ivalue_i
= market value of item iThe probability for each item is calculated as:
probability_i = (rarity_chance / items_in_rarity)
For Case Hardened items that can be Blue Gems, we adjust the expected value calculation to account for pattern probabilities:
EV_case_hardened = (non_blue_patterns/1000 × base_value) + Σ(tier_patterns_i/1000 × tier_value_i)
Where:
non_blue_patterns
= number of non-blue gem patterns (out of 1000)tier_patterns_i
= number of patterns in tier itier_value_i
= value of blue gems in tier iTo understand the risk and calculate required bankrolls, we need to know how much the returns can vary from the expected value.
The variance is calculated as:
Variance = Σ(probability_i × (value_i - EV)²)
The standard deviation (σ) is then:
σ = √Variance
The required bankroll is calculated to ensure you have enough money to avoid bankruptcy with a specified confidence level.
We model the total profit after n cases as a normal distribution:
Total Profit ~ N(n×μ, n×σ²)
Where:
μ
= net expected value per caseσ
= standard deviation per casen
= number of casesTo avoid bankruptcy with confidence level C, we need:
P(Total Profit > -Bankroll) = C
This leads to:
n = (z×σ/μ)²
Where:
z
= z-score for confidence level CGiven a user's bankroll, we calculate the probability they won't go bankrupt.
For a given bankroll B that allows n cases:
n = B/case_price
The z-score for bankruptcy avoidance is:
z = (n×μ)/(√n×σ)
The confidence level is then:
Confidence = Φ(z) × 100%
Where Φ is the standard normal cumulative distribution function.
Each item has a float value (wear) that affects its price. We calculate average prices by considering the distribution of possible float values and their corresponding price impacts.
Items are divided into wear categories based on float value:
Price multipliers by wear:
For float value f, price is calculated as:
To calculate the average price of an item:
share = (category_max - category_min) / (max_float - min_float)
The formula can be expressed as:
avg_price = Σ(share_i × price(midpoint_i))
Where:
share_i
= probability of wear category imidpoint_i
= middle float value in category iprice()
= price function based on item type