craps_simulation


craps_simulation, a MATLAB code which simulates the gambling game of craps, in which a player rolls two dice. On the first roll, the player wins immediately if a 7 or 11 is rolled, and loses immediately if a 2, 3 or 12 is rolled. Otherwise, the sum of the dice on this first roll is called the point. The player now continues to roll the dice, winning if the point is rolled again, and losing if a 7 is rolled.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

craps_simulation is available in a MATLAB version and an Octave version and a Python version.

Related Data and codes:

craps_simulation_test

matlab_simulation, a MATLAB code which uses simulation to study card games, contests, and other processes which have a random element. Usually, the purpose is to try to predict the average behavior of the system over many trials.

Reference:

  1. Ian Stewart,
    The Lore and Lure of Dice,
    Scientific American,
    Volume 277, Number 5, November 1997, pages 110-113.

Source Code:


Last revised on 18 July 2022.