Skip to contents

Calculate the payout after each round of the die game

Usage

calc_score_for_die(
  toss_results,
  starting_capital = 100,
  payoffs = c(2, 0.5),
  min_bet = 0,
  max_payout = Inf,
  betting_fraction = 1,
  insurance_payoffs = c(0, 1),
  use_insurance = FALSE,
  insurance_cost = 0.1
)

Arguments

toss_results

A sequence of integers, representing the sides of each die roll

starting_capital

Initial amount of money

payoffs

a list of the payoffs, one for each side of the die

min_bet

Minimum bet

max_payout

Maximum payout

betting_fraction

Fraction of funds to bet

insurance_payoffs

a list of the payoffs for insurance, one for each side of the die

use_insurance

Whether to use insurance

insurance_cost

Cost of insurance

Value

A list of the payout after each round

Examples

calc_score_for_die(1:6, 100, c(2, 0.5, 1, 1, 1, 1), 1, 1000, 0.5)
#> [1] 100.0 150.0 112.5 112.5 112.5 112.5 112.5