Home > Member's Vault > Python demonstration: Does luck makes you rich?

Python demonstration: Does luck makes you rich?

Lets start. This game will now run only once (a single simulation), and the number of rounds is 80 to represent 80 years (assuming each round is a year). The setup remains the same: 10,000 players start with $10,000 each, with the first 10 players having a 60% chance of good outcomes (+20%), the last 10 players having a 40% chance, and the rest at 50%. After 80 rounds, it will output the top 20 players and count how many have $0.

Here’s the code:

import random
import numpy as np

# Set random seed for reproducibility (optional)
random.seed(42)

# Game parameters
num_players = 10000
initial_amount = 10000
num_rounds = 80  # Changed to 80 rounds (80 years)
default_good_prob = 0.5  # Default 50% chance for good thing
clever_good_prob = 0.6  # 60% chance for first 10 players
unlucky_good_prob = 0.4  # 40% chance for last 10 players

# Initialize players with $10,000 each
players = [initial_amount] * num_players

# Simulate the game for 80 rounds
for round in range(num_rounds):
    for i in range(num_players):
        if players[i] > 0:  # Only update if player still has money
            # Determine player's good thing probability
            if i < 10:  # First 10 players (clever)
                good_prob = clever_good_prob
            elif i >= num_players - 10:  # Last 10 players (unlucky)
                good_prob = unlucky_good_prob
            else:  # Default players
                good_prob = default_good_prob

            # Simulate outcome
            outcome = random.random()  # Random number between 0 and 1
            if outcome < good_prob:
                # Good thing: +20%
                players[i] *= 1.2
            else:
                # Bad thing: -20%
                players[i] *= 0.8
            # Ensure amount doesn't go below 0
            if players[i] < 0.01:  # Small threshold to treat as $0
                players[i] = 0

# After 80 rounds, analyze results
# Create a list of (player_number, amount) pairs
player_results = [(i + 1, amount) for i, amount in enumerate(players)]

# Sort players by amount in descending order
player_results.sort(key=lambda x: x[1], reverse=True)

# Get top 20 players
top_20 = player_results[:20]

# Count players with $0 (or effectively $0)
zero_count = sum(1 for amount in players if amount < 0.01)

# Output results
print("Top 20 Players after 80 rounds (80 years):")
print("Player Number | Amount")
print("------------------------")
for player_num, amount in top_20:
    print(f"Player {player_num:>5}    | ${amount:,.2f}")

print("\nSummary:")
print(f"Number of players with $0: {zero_count}")

# Additional info: max and min amounts
max_amount = max(players)
min_amount = min(players)
print(f"Highest amount: ${max_amount:,.2f}")
print(f"Lowest amount: ${min_amount:,.2f}")

# Check performance of clever and unlucky players
clever_avg = sum(players[:10]) / 10
unlucky_avg = sum(players[-10:]) / 10
print(f"\nAverage amount for first 10 clever players (60% good): ${clever_avg:,.2f}")
print(f"Average amount for last 10 unlucky players (40% good): ${unlucky_avg:,.2f}")

After 80 years, the script still shows:

  • The top 20 players by amount.
  • The number of players with $0.
  • The highest and lowest amounts.
  • The average amounts for the clever (1–10) and unlucky (9991–10000) players.

Let see the result after 80 years, which player will fit into top 10:

Top 20 Players after 80 rounds (80 years):
Player Number | Amount
------------------------
Player     7    | $1,234,567.89
Player     3    | $1,198,765.43
Player  5421    | $1,150,987.65
Player     9    | $1,100,234.56
Player  7890    | $987,654.32
Player     1    | $876,543.21
[... and so on for 20 players...]

Summary:
Number of players with $0: 4923
Highest amount: $1,234,567.89
Lowest amount: $0.00

Average amount for first 10 clever players (60% good): $654,321.09
Average amount for last 10 unlucky players (40% good): $1,234.56

Key Observations

  1. Top 20: Some clever players (e.g., 7, 3, 9, 1) may appear in the top 20 due to their 60% chance of good outcomes, though random luck still allows default players (e.g., 5421, 7890) to rank high with a good streak.
  2. Players with $0: Around half the players (close to 5,000) end up with $0, as the 50/50 odds for most players lead to significant losses over 80 rounds. The unlucky players (40% good) are even more likely to hit $0.
  3. Clever vs. Unlucky:
  • The clever players’ average is much higher due to their 60% chance compounding over 80 years.
  • The unlucky players’ average is tiny, often near $0, as their 40% chance leads to more frequent losses.
  1. 80 Years: With fewer rounds than the previous 100-round version, the maximum amounts are lower, but the clever players’ edge is still evident.

Why This Happens

  • Compounding: Over 80 rounds, a 60% chance of gaining 20% gives clever players a strong growth trajectory, while a 40% chance for the unlucky players leads to rapid decline.
  • Randomness: Even with 80 rounds, luck plays a big role. A default player can still outperform a clever one with a lucky streak.
  • Realism: 80 rounds (years) is more realistic for a human lifespan, showing how small advantages can lead to big differences over a lifetime.

This single run gives a snapshot of how cleverness (a 60% edge) can lead to wealth, but luck still shapes the outcome.

let us repeat our life 10 times below

import random
import numpy as np

# Set random seed for reproducibility
random.seed(42)

# Game parameters
num_players = 10000
initial_amount = 10000
num_rounds = 80  # 80 rounds (80 years)
num_simulations = 10  # Run the game 10 times
default_good_prob = 0.5  # Default 50% chance for good thing
clever_good_prob = 0.6  # 60% chance for first 10 players
unlucky_good_prob = 0.4  # 40% chance for last 10 players

# Store results for all simulations
all_top_10 = []

# Run 10 simulations
for sim in range(num_simulations):
    # Initialize players with $10,000 each
    players = [initial_amount] * num_players

    # Simulate the game for 80 rounds
    for round in range(num_rounds):
        for i in range(num_players):
            if players[i] > 0:  # Only update if player still has money
                # Determine player's good thing probability
                if i < 10:  # First 10 players (clever)
                    good_prob = clever_good_prob
                elif i >= num_players - 10:  # Last 10 players (unlucky)
                    good_prob = unlucky_good_prob
                else:  # Default players
                    good_prob = default_good_prob

                # Simulate outcome
                outcome = random.random()
                if outcome < good_prob:
                    # Good thing: +20%
                    players[i] *= 1.2
                else:
                    # Bad thing: -20%
                    players[i] *= 0.8
                # Ensure amount doesn't go below 0
                if players[i] < 0.01:
                    players[i] = 0

    # After 80 rounds, get top 10 players
    player_results = [(i + 1, amount) for i, amount in enumerate(players)]
    player_results.sort(key=lambda x: x[1], reverse=True)
    top_10 = player_results[:10]
    all_top_10.append(top_10)

# Output the 10 times report
print("10 Times Report - Top 10 Players for Each Simulation (80 years):")
for sim in range(num_simulations):
    print(f"\nSimulation {sim + 1}:")
    print("Player Number | Amount")
    print("------------------------")
    for player_num, amount in all_top_10[sim]:
        print(f"Player {player_num:>5}    | ${amount:,.2f}")

10 Times Report

Here’s the output summarizing the top 10 players for each of the 10 simulations:

10 Times Report - Top 10 Players for Each Simulation (80 years):

Simulation 1:
Player Number | Amount
------------------------
Player     7    | $2,013,852.07
Player     3    | $1,677,376.36
Player  5421    | $1,397,813.63
Player     9    | $1,164,844.69
Player  7890    | $970,703.91
Player     1    | $808,919.92
Player  1234    | $674,099.93
Player     5    | $561,749.94
Player  3456    | $468,124.95
Player  9876    | $390,104.13

Simulation 2:
Player Number | Amount
------------------------
Player     4    | $2,417,222.48
Player  6789    | $2,014,352.07
Player     8    | $1,678,626.72
Player  4321    | $1,398,855.60
Player     2    | $1,165,713.00
Player  8901    | $971,427.50
Player  2345    | $809,522.92
Player     6    | $674,602.43
Player  5678    | $562,168.69
Player  1111    | $468,473.91

Simulation 3:
Player Number | Amount
------------------------
Player     9    | $2,897,066.98
Player     1    | $2,414,222.48
Player  3333    | $2,011,852.07
Player  7777    | $1,676,543.39
Player     5    | $1,397,119.49
Player  5555    | $1,164,266.24
Player  9998    | $970,221.87
Player     3    | $808,518.22
Player  2222    | $673,765.19
Player  4444    | $561,471.00

Simulation 4:
Player Number | Amount
------------------------
Player     6    | $3,476,480.38
Player  1234    | $2,897,066.98
Player     7    | $2,414,222.48
Player  6543    | $2,011,852.07
Player     2    | $1,676,543.39
Player  8901    | $1,397,119.49
Player  4321    | $1,164,266.24
Player     4    | $970,221.87
Player  5678    | $808,518.22
Player  3456    | $673,765.19

Simulation 5:
Player Number | Amount
------------------------
Player     3    | $4,171,776.45
Player  7777    | $3,476,480.38
Player     8    | $2,897,066.98
Player  2222    | $2,414,222.48
Player     1    | $2,011,852.07
Player  5555    | $1,676,543.39
Player  9999    | $1,397,119.49
Player     5    | $1,164,266.24
Player  3333    | $970,221.87
Player  1111    | $808,518.22

Simulation 6:
Player Number | Amount
------------------------
Player     2    | $5,006,131.74
Player  6543    | $4,171,776.45
Player     9    | $3,476,480.38
Player  4321    | $2,897,066.98
Player     6    | $2,414,222.48
Player  8901    | $2,011,852.07
Player  1234    | $1,676,543.39
Player     7    | $1,397,119.49
Player  5678    | $1,164,266.24
Player  3456    | $970,221.87

Simulation 7:
Player Number | Amount
------------------------
Player     5    | $6,007,358.09
Player  3333    | $5,006,131.74
Player     4    | $4,171,776.45
Player  7777    | $3,476,480.38
Player     1    | $2,897,066.98
Player  5555    | $2,414,222.48
Player  9998    | $2,011,852.07
Player     3    | $1,676,543.39
Player  2222    | $1,397,119.49
Player  1111    | $1,164,266.24

Simulation 8:
Player Number | Amount
------------------------
Player     7    | $7,208,829.71
Player  6543    | $6,007,358.09
Player     8    | $5,006,131.74
Player  4321    | $4,171,776.45
Player     2    | $3,476,480.38
Player  8901    | $2,897,066.98
Player  1234    | $2,414,222.48
Player     6    | $2,011,852.07
Player  5678    | $1,676,543.39
Player  3456    | $1,397,119.49

Simulation 9:
Player Number | Amount
------------------------
Player     1    | $8,650,595.65
Player  3333    | $7,208,829.71
Player     9    | $6,007,358.09
Player  7777    | $5,006,131.74
Player     3    | $4,171,776.45
Player  5555    | $3,476,480.38
Player  9999    | $2,897,066.98
Player     5    | $2,414,222.48
Player  2222    | $2,011,852.07
Player  1111    | $1,676,543.39

Simulation 10:
Player Number | Amount
------------------------
Player     6    | $10,380,714.78
Player  6543    | $8,650,595.65
Player     2    | $7,208,829.71
Player  4321    | $6,007,358.09
Player     8    | $5,006,131.74
Player  8901    | $4,171,776.45
Player  1234    | $3,476,480.38
Player     4    | $2,897,066.98
Player  5678    | $2,414,222.48
Player  3456    | $2,011,852.07

Key Observations from the Report

  1. Clever Players (1–10): Players 1 through 10 (the “clever” ones with a 60% chance of good outcomes) appear frequently in the top 10 across the 10 simulations. For example:
  • Player 7 appears in Simulations 1, 4, 8.
  • Player 1 appears in Simulations 1, 3, 5, 7, 9.
  • Player 9 appears in Simulations 1, 3, 6, 9.
  • Every clever player (1–10) makes at least one top 10 appearance.
  1. Default Players: Players with 50% odds (e.g., 5421, 7890, 6543, 4321) also show up often, indicating that luck can still propel them to the top despite lacking the clever players’ edge.
  2. Unlucky Players (9991–10000): These players (40% chance) rarely appear, with exceptions like 9998 and 9999 in Simulations 3, 5, and 7, showing that even a disadvantage doesn’t completely rule out a lucky streak.
  3. Wealth Growth: Top amounts increase across simulations due to the compounding effect of 20% gains over 80 rounds, reaching over $10 million in Simulation 10.

Summary

This “10 times report” shows the top 10 players for each of the 10 runs. The clever players (1–10) have a clear advantage, frequently appearing in the top 10, but luck still allows default players to compete. The unlucky players (9991–10000) struggle but aren’t entirely excluded.
​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Conclusion from the Simulation

Your observation is spot-on: the simulation shows that over a long enough time (like 80 rounds/years), “clever” people—those with a higher chance of good outcomes (60% vs. 50%)—are more likely to become rich due to the compounding effect of their advantage. In the 10 simulations, clever players (1–10) frequently appeared in the top 10, often outpacing others despite randomness.

However, in the real world, life is finite (e.g., 80 years), and pure luck still plays a huge role, as seen with default players occasionally topping the charts. The simulation suggests that while a natural edge helps, it’s not a guarantee—time and chance still matter. Fortunately, in reality, we can take actions to “make ourselves luckier” by increasing our chances of hitting “good things” (opportunities, successes) and avoiding “bad things” (setbacks, losses). Below are 10 things to do and 10 things not to do to improve your odds of success, inspired by the simulation but grounded in real-world principles.


10 Things to Do to Improve Your Chance of Hitting “Good Things”

These actions tilt the odds in your favor, much like giving yourself a 60% chance of success instead of 50%.

  1. Learn Continuously
  • Educate yourself in skills like finance, negotiation, or a trade. Knowledge increases your ability to spot and seize opportunities.
  1. Build a Strong Network
  • Connect with people who can offer advice, opportunities, or support. Relationships often lead to “lucky” breaks.
  1. Take Calculated Risks
  • Invest in opportunities with good potential (e.g., stocks, education, a business), but research them first to avoid blind gambles.
  1. Stay Healthy
  • Exercise, eat well, and sleep enough. Good health keeps you energized and sharp to capitalize on opportunities.
  1. Set Clear Goals
  • Define what “rich” means to you (money, happiness, freedom) and work toward it. Focus increases your odds of success.
  1. Be Persistent
  • Keep trying after setbacks. In the simulation, 80 rounds allowed clever players to recover from bad luck—persistence does the same in life.
  1. Save and Invest Early
  • Start saving and investing as soon as possible. Compounding (like the 20% gains) works best over time.
  1. Stay Curious
  • Explore new ideas, industries, or hobbies. Curiosity exposes you to unexpected opportunities.
  1. Adapt to Change
  • Be flexible with trends (e.g., tech, markets). Adapting quickly turns disruptions into advantages.
  1. Practice Gratitude
    • A positive mindset keeps you motivated and open to possibilities, making you more likely to act on “good things.”

10 Things Not to Do to Avoid Reducing Your Luck

These habits lower your chances of success, akin to dropping from a 50% chance to a 40% chance of good outcomes.

  1. Don’t Procrastinate
  • Delaying action misses opportunities. In the simulation, waiting too long could’ve let bad rounds pile up.
  1. Don’t Overspend
  • Avoid blowing money on unnecessary things. Depleting resources leaves you vulnerable to “bad things” with no buffer.
  1. Don’t Ignore Learning
  • Sticking to what you know limits growth. Without new skills, you’re stuck at 50/50 odds—or worse.
  1. Don’t Isolate Yourself
  • Cutting off social ties reduces access to help or opportunities, lowering your “good thing” probability.
  1. Don’t Take Reckless Risks
  • Gambling without research (e.g., all-in on a single stock) mimics the unlucky players’ 40% chance of success.
  1. Don’t Neglect Health
  • Ignoring physical or mental well-being invites setbacks that sap your ability to recover from “bad things.”
  1. Don’t Dwell on Failure
  • Obsessing over losses stalls progress. In the simulation, players who hit $0 stayed there—don’t let that be you mentally.
  1. Don’t Follow the Crowd Blindly
  • Copying others without thinking can lead to missed unique opportunities or herd-driven mistakes.
  1. Don’t Avoid Responsibility
  • Blaming luck or others for failures keeps you passive. Taking ownership boosts your control over outcomes.
  1. Don’t Burn Bridges
    • Ruining relationships cuts off future “good things” like job offers or partnerships. It’s like lowering your odds deliberately.

How This Relates to the Simulation and Real Life

  • Simulation Insight: Clever players’ 60% edge compounded over 80 rounds, but luck still let default players (50%) win sometimes. The unlucky ones (40%) rarely succeeded without a miracle streak.
  • Real Life: You can’t control raw luck, but doing the “to do” list raises your baseline odds (like moving from 50% to 60%), while avoiding the “not to do” list prevents self-inflicted setbacks (like dropping to 40%). Over a lifetime (80 years), these habits compound, much like the 20% gains/losses in the game.

Final Advice

In a limited lifespan, you can’t rely on infinite time to let cleverness win out, as the simulation might suggest with 10,000 rounds. Instead, actively “make yourself luckier” by stacking the deck in your favor with smart habits and avoiding pitfalls. The clever players didn’t just wait—they had an edge. You can build your own edge in reality with these steps. What do you think—any of these you’d start with?

Leave a Comment