This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
switching_wins = 1 | |
staying_wins = 1 | |
switching_count = 1 | |
staying_count = 1 | |
total_runs = 0 | |
stop_at = randint(10000,100000) # Set to how many instances you wanna try. Bigger the sample size the less room for error | |
when_to_swap = round(stop_at/2) # The point where to stop switching from the initally picked door. By default it will equally switch and stay. Can be set to anything less than stop_at | |
switch_randomly = False # If set to true, instead of switching at a set number the program will randomly decide to switch or not every time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function RandomGen(min,max){ // random number | |
return Math.round(Math.random()*max-min)+min; | |
} | |
function PRandomGen(obj){ // pseudo random number | |
// {"thing": 2, "otherthing": 6} // 'otherthing' will be 3x more likely to be returned since 6 is three times 2 | |
var toReturn, sortable = [], total = 0; | |
for(var x in obj){ // loops through all values in the object |