TL;DR If you want to design the perfect lottery where participants believe they have a chance to win but can never actually do so, youβll need the expertise of a skilled mathematician. However, with enough data, a capable statistical programmer can unravel the mechanism and expose the illusion.
Updated 2025-01-05
Introduction
Kasa Romana is a well-known lottery in Poland, organized by the Amino food company. Originating in the 1990s, this lottery gives participants the chance to win cash prizes by collecting coupons that sum up to round hundreds, up to 1000 PLN. In this blog post, we delve into the data from the last Kasa Romana event, held in 2016, and analyze it using the Knapsack Algorithm implemented in R.
The data for this analysis was meticulously gathered by BezKanalu, a popular Polish YouTube channel known for testing promotional products. They collected an impressive 1002 coupons from the final event, providing a robust dataset to explore. The goal? To uncover patterns in the data and assess whether these coupons could realistically lead to a monetary win.
To tackle this challenge, I utilized the Knapsack Algorithm, a well-established optimization technique. The algorithm identifies the optimal way to select items (in this case, coupons) that meet specific constraints (summing to full hundreds) while maximizing value. Using R, I implemented this algorithm to determine if any subset of the collected coupons could satisfy the winning conditions of the lottery.
Surprisingly, the analysis revealed that no combination of coupons from the dataset allowed participants to win real money. This finding was further reinforced through a theoretical proof using modular arithmetic.
In conclusion, this blog post highlights the power of the Knapsack Algorithm as a tool for solving complex optimization problems like the Kasa Romana lottery. The analysis not only sheds light on the patterns and limitations of the lottery but also demonstrates how programming and mathematical approaches can provide valuable insights into real-world scenarios.
Apply Knapsack Algorithm on Lottery Coupons
First we will define the lottery coupons and analyze them.
It is worth to try to understand the data patterns before running the Knapsack Algorithm.
Sorted unique values:
Sorted table of frequencies:
Histrogram might be helpful to find certain patterns:
Numbers seems to be generated from 2 specific patterns:
- multiplication of 13 starting from 26
- multiplication of 13 plus 165
We can easily confirm that all of the coupons comes from this 2 sequences.
Single Knapsack Problem
Knapsack is an optimization method, linear programming for integers. Each of 1000 coupons is replicated 10 times before the procedure. This replication step is not needed to get this certain results although it will be even more convincing. Remainder, I was looking for set of coupons which sum to full hundreds (100, 200, β¦) up to 1000.
Taking into account only coupons provided there is NO chance to win anything.
This seems to no be surprising when we know from what sequences the coupons come from.
Theoretical Proof: Modular Arithmetic Analysis
Proof of Impossibility * The formula for any sum S is: S = 13K + 165C Where K (sum of coupon indices) and C (count from Set 2) are integers. * We are testing if S can be a multiple of 100. Let S = 100n, where n is a positive integer (n {1, 2, , 10}). * The equation becomes: 13K + 165C = 100n * Letβs analyze this equation modulo 13: (13K + 165C) 100n * * 165 = (13 ) + 9, so 165C 9C * 100 = (13 ) + 9, so 100n 9n * This simplifies our equation to: 9C 9n * Since 9 and 13 share no common factors, we can divide both sides by 9: C n This means C must be of the form C = n + 13m for some integer m . * Now, substitute this expression for C back into the original equation (Step 3): 13K + 165(n + 13m) = 100n * Expand and solve for K: 13K + 165n + (165 13m) = 100n 13K = 100n - 165n - (165 13m) 13K = -65n - (165 13m) * Divide the entire equation by 13: K = -5n - 165m K = -(5n + 165m) * This is a contradiction. * By definition, K must be positive or zero (K ). * But since n (as S is a positive sum) and m , the term (5n + 165m) must be . * Therefore, K must be strictly negative (K ). Because K cannot be both non-negative (by definition) and negative (by derivation), no integer solution exists.
Conclusion
The Knapsack Algorithm computationally confirms that no combination of Kasa Romana lottery coupons can sum up to full hundreds, making it impossible to meet the winning criteria. This conclusion is further validated by a theoretical proof using modular arithmetic, adding credibility and mathematical rigor to the findings.