RollDice

scalation.simulation.monte_carlo.RollDice
See theRollDice companion class
object RollDice

The RollDice object provides formulas for the coefficients (number of ways) to roll a certain number.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
RollDice.type

Members list

Value members

Concrete methods

def coeff_1(k: Int): Int

Calculate the coefficient (number of ways) to roll k using 1 dice.

Calculate the coefficient (number of ways) to roll k using 1 dice.

Value parameters

k

the value (sum) from the roll

Attributes

def coeff_2(k: Int): Int

Calculate the coefficient (number of ways) to roll k using 2 dice.

Calculate the coefficient (number of ways) to roll k using 2 dice.

Value parameters

k

the value (sum) from the roll

Attributes

def coeff_3(k: Int): Int

Calculate the coefficient (number of ways) to roll k using 3 dice.

Calculate the coefficient (number of ways) to roll k using 3 dice.

Value parameters

k

the value (sum) from the roll

Attributes

def n_ways(n_d: Int, k: Int): Int

Calculate the number of ways to get a sum of k using n_d dice using a recursive function.

Calculate the number of ways to get a sum of k using n_d dice using a recursive function.

Value parameters

k

the value of the roll (sum of the dice)

n_d

the number of dice to roll

Attributes