finish_game_chance: Calculates the probability of winning the game after a...

Description Usage Arguments Value Examples

Description

This function takes the probabilities of winning the game after each turn, the vector returned by markov_chain() and calculates the probability that the game will be won BY each turn. This is essentially the derivative of the graph of number of turns versus the probability of winning the game after each turn. The function calculates the difference between each two consecutive entries in the input vector, multiplied by 100, and returns a vector of the probabilities of winning by each turn. The vector returned by this function can be graphed versus the number of turns, and the index of the maximum value is the turn that a player has the greatest chance of winning on. In the case of the default board, for example, players have the highest chance of winning on turn 19.

Usage

1
finish_game_chance(probabilities, tau = turns)

Arguments

probabilities

The probabilities of winning the game after each turn. This is the vector returned by the function markov_chain()

tau

The number of iterations, or turns. Must be the same as the value used in markov_chain()

Value

A vector of the probability of that the game will be won at each turn.

Examples

1
finish_game_chance(probabilities = markov_chain(), tau = 100)

iawindham/snakesandladders documentation built on May 20, 2019, 2:08 p.m.