SHARE
TWEET

Vice President

a guest Mar 25th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lowWins = 0;
  2. highWins = 0;
  3. for i=(1:1:500000)
  4.     lowSum = 0;
  5.     for low_rolls = (1:1:9)
  6.       lowSum = lowSum + randi(4);
  7.     end
  8.     highSum = 0;
  9.     for high_rolls = (1:1:6)
  10.     highSum = highSum + randi(6);
  11.     end
  12.     if lowSum > highSum
  13.         lowWins = lowWins + 1;
  14.     end
  15.     if lowSum < highSum
  16.         highWins = highWins + 1;
  17.     end
  18.    
  19. end
  20.  
  21. sprintf("Mandy: %f %", lowWins/5000)
  22. sprintf("Randy: %f %", highWins/5000)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top