-
Notifications
You must be signed in to change notification settings - Fork 2
Simulation Outcomes
The chief goal of this simulation is to evaluate the relationship between the amount of defectors and the probability of group collapse. So what is group collapse? The tandapay protocol can be thought of through the lens of a decentralized insurance protocol. Imagine an insurance protocol with N users, who all pay in k dollars each month. If no claim happens, they get their refunds back. However, if a claim does happen, they can decide whether to pay their premium like normal, or not pay (a.k.a, "Defect").
If N=100 and k=100, then we have a pool of $10,000 each month. When a claim happens, we pay out $10,000 even if people defect. However, as the number of people remaining decreases, the more they have to pay to cover the $10,000 premium. There is only so much they will tolerate before they also defect. Someone may be fine paying a premium of $100, but if 50 people defect and there are only 50 remaining, and now they have to pay $200 to cover their portion of the claim, they may not be willing to do that.
In essence, this creates an effect known as, "death spiraling," which amplifies the voices of the minority group of defectors, by creating cascading waves of defectors. As the size of this minority group (defectors) increases, so does the cost of covering the premium for the remaining members, which makes them more likely to defect themselves.
When viewing the simulation's settings menu, users will see an option titled, "percent honest defectors." This option is NOT the percentage of users who will actually defect. The amount of users who actually defect relies on several other variables such as "percent independent".
For more information, see: Defectors in Detail
With the previous explanation of the distinction between "percent honest defectors" and actual "defectors", let's perform a search through the domain of "percent honest defectors".
If you want to follow along, follow the installation instructions for TandaPay Simulation, and run python3 main.py. The GUI should appear. Click "Run Searching". Then, in the "Searching Menu", change "Attribute to search" to "perc_honest_defector". Then, click "Search". You should get a similar result to what is seen below.
The outcome of this search is as follows:
| Value | Wins Percent | Draws Percent | Losses Percent |
| 0.1 | 0.0 | 2.0 | 98.0 |
| 0.1175 | 1.0 | 0.0 | 99.0 |
| 0.135 | 1.0 | 4.0 | 95.0 |
| 0.1525 | 2.0 | 2.0 | 96.0 |
| 0.17 | 7.0 | 19.0 | 74.0 |
| 0.1875 | 10.0 | 26.0 | 64.0 |
| 0.205 | 25.0 | 28.0 | 47.0 |
| 0.2225 | 28.0 | 44.0 | 28.0 |
| 0.24 | 60.0 | 24.0 | 16.0 |
| 0.2575 | 74.0 | 20.0 | 6.0 |
| 0.275 | 80.0 | 16.0 | 4.0 |
| 0.2925 | 79.0 | 19.0 | 2.0 |
| 0.31 | 84.0 | 15.0 | 1.0 |
| 0.3275 | 92.0 | 7.0 | 1.0 |
| 0.345 | 95.0 | 5.0 | 0.0 |
| 0.3625 | 95.0 | 5.0 | 0.0 |
| 0.38 | 99.0 | 1.0 | 0.0 |
| 0.3975 | 100.0 | 0.0 | 0.0 |
| 0.415 | 100.0 | 0.0 | 0.0 |
| 0.4325 | 100.0 | 0.0 | 0.0 |
| 0.45 | 99.0 | 1.0 | 0.0 |
All Roots:
0.5020643879416782
0.24282861995857888
-0.01581793911995869
Real Roots:
0.5020643879416782
0.24282861995857888
-0.01581793911995869
Possible Solutions:
0.24282861995857888
Linreg Model:
y = -8230.088274920787x^3
+ 6000.352175105803x^2
+ -906.4037375577141x^1
+ 34.12865682396028x^0
Modeling the data with a regression model, we can see that there is a sharp S curve in the data, and the point where the probability of group collapse is closest to 50% is about 0.242828. This is right in the middle of our S-curve. So, how many actual defectors are there to create a 50% probability of group collapse?
So, if we want a quick and dirty approach to figuring out how many actual defectors this is, we need to perform a quick simulation run with the solution we found from searching before. The solution was 0.24282862, a.k.a 24.282862% percent honest defectors. We run the simulation for 1000 trials with this value for percent honest defectors, and we can see that "Avg Defectors = 17.9450` overall. Therefore, if approximately 17.95% of users defect, there is a 50% chance of group collapse.
If you are following along, navigate to the Settings menu and enter the solution you got from searching as a percentage in "EV4: Percent Honest Defectors". In my case, I entered in 24.282862. You can reuse this value, or put the one that your searching run yielded. The reason they may be slightly different is due to the nature of probability and variance, which this simulation relies on. It should be a similar value though. In the "Sample Size" field, enter 1000. Now, click "OK" and navigate back to the main menu, and click "Run Simulation"
In the results pane, you should see something similar to this:
Results Summary:
wins = 585, 58.5000%
draws = 306, 30.6000%
losses = 109, 10.9000%
Wins Breakdown:
Case A: 585
Description: WIN: valid_remaining below 50% of total_member_cnt
Case B: 0
Description: WIN: final period completed with valid_remaining below 55% of total_member_cnt
Win Defectors Avg = 18.4256
Win Skipped Avg = 28.8991
Win Invalid Avg = 39.6222
Win Quit Avg = 3.5573
Draws Breakdown:
Case A: 306
Description: DRAW: 3 periods in a row where nobody quits or leaves, and valid_remaining below 60% of total_member_cnt
Case B: 0
Description: DRAW: final period completed with valid_remaining below 65% of total_member_cnt
Draw Defectors Avg = 17.5654
Draw Skipped Avg = 25.3725
Draw Invalid Avg = 32.2484
Draw Quit Avg = 2.6895
Losses Breakdown:
Case A: 109
Description: LOSS: 3 periods in a row where nobody quits or leaves, and valid_remaining above 60% of total_member_cnt
Case B: 0
Description: LOSS: final period reached with valid_remaining above 65% of total_member_cnt
Loss Defectors Avg = 16.4312
Loss Skipped Avg = 20.1101
Loss Invalid Avg = 23.1743
Loss Quit Avg = 1.5505
Overall Averages:
Avg Defectors = 17.9450
Avg Skipped = 26.8620
Avg Invalid = 35.5730
Avg Quit = 3.0730
Minimums:
Min Defectors = 12
Info: LOSS: 3 periods in a row where nobody quits or leaves, and valid_remaining above 60% of total_member_cnt
Min Skipped = 14
Info: LOSS: 3 periods in a row where nobody quits or leaves, and valid_remaining above 60% of total_member_cnt
Min Invalid = 11
Info: LOSS: 3 periods in a row where nobody quits or leaves, and valid_remaining above 60% of total_member_cnt
Min Quit = 0
Info: LOSS: 3 periods in a row where nobody quits or leaves, and valid_remaining above 60% of total_member_cnt
Maximums:
Max Defectors = 24
Info: WIN: valid_remaining below 50% of total_member_cnt
Max Skipped = 40
Info: WIN: valid_remaining below 50% of total_member_cnt
Max Invalid = 59
Info: WIN: valid_remaining below 50% of total_member_cnt
Max Quit = 9
Info: WIN: valid_remaining below 50% of total_member_cnt
We're interested in the overall average number of defectors across this 1000 simulation runs. So, we navigate down to the "Overall Averages" section, and there you will see your result.
You can experiment with the different variables of the simulation and try to find out how the different variables impact the outcomes, or find the number of defectors necessary for different probabilities of group collapse. If you have followed along so far, you should have recreated the results shown above. Check out the other sections of this wiki to familiarize yourself with the simulation, and see our links section for further reading.
Read Next: