non-transitive dice

non-transitive dice preview image

1 collaborator

Army_coat_pix R. Wade Schuette (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 73 times • Downloaded 8 times • Run 0 times
Download the 'non-transitive dice' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This is a demo of "intransitive dice", where the dice form a "strange loop". Regardless which die you pick of the four, the computer can pick one that beats your choice 2/3 of the time from the remaining three die.

See Wikipedia https://en.wikipedia.org/wiki/Intransitive_dice

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

Click RESET / START to begin pick your die using the slider. click ROLL-ONCE to roll once, and see the results click KEEP-ROLLING to roll forever at speed controlled at the very top slider. To stop it, click "KEEP-ROLLING" again. Then you can change your selection. Either roll more, or RESET, you choice.

THINGS TO NOTICE

The computer will always converge on 66.7% winning.

THINGS TO TRY

Pick 1, reset, keep-rolling and watch who wins. pick 2, reset ditto pick 3, reset ditto pick 4, reset ditto There is no way to beat the computer over long runs. ( in a very short number of rolls you might beat it )

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

See Wikipedia https://en.wikipedia.org/wiki/Intransitive_dice Coded by R. Wade Schuette 10/23/2021 No rights reserved. Use as you like.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [ mydie yourscore myscore whowon lastpick ratio]

to setup
  clear-all
  reset-ticks
  pick
  set lastpick yourdie
  output-print "\nStarting Over!\n "
  output-print "You Rolled   I Rolled    winner  Your Score  My Score "
  output-print "==========  ==========  ========= ========== =========="
  reset-ticks
end 

to go
  if ( yourdie != lastpick )
    [  set lastpick yourdie
      pick ]

  let youget roll yourdie;
  let iget roll mydie ;

  if  (youget > iget) [set yourscore ( yourscore + 1 )  set whowon "you" ]
  if ( youget = iget) [   set whowon "tie" ]
  if  (youget < iget) [set myscore ( myscore + 1 )  set whowon " me" ]
  set ratio ( (myscore * 100) / ( myscore + yourscore))

  output-print (word youget "              " iget "           " whowon "          " yourscore "          "  myscore )
tick
end 

to pick
  if ( yourdie = 1 ) [set mydie 4]
  if ( yourdie = 2 ) [set mydie 1]
  if ( yourdie = 3 ) [set mydie 2]
  if ( yourdie = 4 ) [set mydie 3]
  output-print (word "\n---------------------------------\nOK,  you roll #" yourdie " and I will roll #" mydie "\n")
end 

to-report roll[ which ]
 if ( which = 1 ) [ report  item ( random 5) [ 4 4 4 4 0 0 ] ]
 if ( which = 2 ) [ report  item ( random 5) [ 3 3 3 3 3 3 ] ]
 if ( which = 3 ) [ report  item ( random 5) [ 6 6 2 2 2 2 ] ]
 if ( which = 4 ) [ report  item ( random 5) [ 5 5 5 1 1 1 ] ]
end 

There is only one version of this model, created over 2 years ago by R. Wade Schuette.

Attached files

File Type Description Last updated
non-transitive dice.png preview Preview for 'non-transitive dice' over 2 years ago, by R. Wade Schuette Download

This model does not have any ancestors.

This model does not have any descendants.