*RPGs*, like all games, combine elements of skill, strategy, and chance together. Chance provides some variability, uncertainty, disorder, excitement, and suspense to the game. However, it is very important that the amount of chance is balanced with other aspects of the game. This RPS achieves this balance by using stochastic values.

## Background

*Stochastic values* are values that vary with every use. They combine some constant values with some random values such that the resulting variation is deterministically constrained. Statistical measures such as the minimum, maximum, and average values are known quantities.

*Random values* are a set of possible values that are assigned given the result of a random event. *Random events* are when a certain subset of events occur by a random device. *Random devices* are devices that have more than one possible result, where the probability ‘p’ of getting each result is fixed. Common game random devices are: flipping coins, drawing cards from a shuffled deck, rolling dice, picking tiles from a bag, or spinning a spinner.

Any random device(s) can be used, as long as the random event occurs with the desired probability ‘p’. When a chosen random event occurs, it is called a *success*, and when it does not occur, it is called a *failure*. Typically, the resulting random value is assigned ‘1’ upon success, and ‘0’ upon failure.

The following table shows which random devices produce random events for common probabilities.

Probability | ^{1}/_{6} |
^{1}/_{4} |
^{1}/_{3} |
^{1}/_{2} |
^{2}/_{3} |
^{3}/_{4} |
^{5}/_{6} |
---|---|---|---|---|---|---|---|

Flip Coin | – | – | – | H | – | – | – |

Draw Card ( French, No Aces ) | Q-K | J-K | 10-K | 8-K | 6-K | 5-K | 4-K |

Draw Card ( French ) | – | ♠ | – | ♠,♣ | – | ♠,♣,♥ | – |

Rolling Die ( D6 ) | 6 | – | 5-6 | 4-6 | 3-6 | – | 2-6 |

Pick Domino ( Double-Six, No Blanks ) | 6 | – | 5-6 | 4-6 | 3-6 | – | 2-6 |

## Details

This RPS uses two types of tests: basic tests and continued tests.

*Tests* are random events, produced by any random device, that have probability ‘p’ of success, and probability ‘1-p’ of failure. For example, a test that has probability of success ‘p’ equal to the most common value of ‘^{1}/_{2}‘ can be produced by the following random devices and random events: flipping a coin and getting ‘heads’ (‘H’); drawing a card and getting a ‘spade’ (‘♠’), or ‘club’ (‘♣’); or rolling a six-sided die and getting a ‘4’, ‘5’, or ‘6’.

*Basic tests* are random events with probability ‘p’ of success that happen exactly once, counting as either zero or one success. A basic test is denoted as *‘B(p)’*. If ‘p’ equals ‘^{1}/_{2}‘, ( the most common value, ) it may be omitted, and simply denoted as *‘B’*.

*Continued tests* are random events with probability ‘p’ of success that are repeated while successes occur, and ends when failure occurs, producing zero or more successes. A continued test is denoted as *‘NB(p)’*. If ‘p’ equals ‘^{1}/_{2}‘, ( the most common value, ) it may be omitted, and simply denoted as ‘*NB*‘.

Several identical tests, ‘N’, are usually run at the same time, with the number of successes added together. Basic tests are denoted as *‘B(N,p)’*, and continued tests are denoted as *‘NB(N,p)’*. When ‘p’ equals ‘^{1}/_{2}‘ it may be omitted, denoted simply as *‘B(N)’*, or *‘NB(N)’*.

The final stochastic value is given by taking the success count of all the tests, optionally multiplying by a scale-factor, then adding to a constant value. This is denoted algebraically as: *‘C+S×B(N,p)’* and *‘C+S×NB(N,p)’*.

*‘C’*is a constant value.*‘S’*is an optional scalar value.*‘B’*is a basic test.*‘NB’*is a continued test.*‘N’*is the number of tests run.*‘p’*is the optional probability of success for each test.

## Evaluation

To evaluate stochastic values ‘C+S×B(N,p)’ or ‘C+S×NB(N,p):

- find the specified probability ‘p’, or if omitted use the default of ‘
^{1}/_{2}‘. - choose a random device with a random event that occurs with ‘p’ success.
- run ‘N’ tests with ‘p’ success, and count the number of successes.
- if ‘B’: run each test exactly once.
- if ‘NB’: run each test once, and repeat while successes occur.

- if present, multiply the count by ‘S’.
- add ‘C’ to the value.

Examples:

- 8+B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Coins are chosen as the random device, where**H**is a success. 4 basic tests are run, resulting in {**H**; T;**H**;**H**}, which is 3 successes. This is added to 8. 8+3 gives a final stochastic value of 11. - 8+B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Cards are chosen as the random device, where**8-K**is a success. 4 basic tests are run, resulting in {**Q**; 3; 4; 7}, which is 1 success. This is added to 8. 8+1 gives a final stochastic value of 9. - 8+B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Cards are chosen as the random device, where**♠,♣**is a success. 4 basic tests are run, resulting in {♥; ♥; ♦; ♥}, which is 0 successes. This is added to 8. 8+0 gives a final stochastic value of 8. - 8+B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Dice are chosen as the random device, where**4-6**is a success. 4 basic tests are run, resulting in {**6**;**5**;**4**;**4**}, which is 4 successes. This is added to 8. 8+4 gives a final stochastic value of 12. - 8+B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Dominoes are chosen as the random device, where**4-6**is a success. 4 basic tests are run, resulting in {**5**|*2*;**4**|**6**}, which is 3 successes. This is added to 8. 8+3 gives a final stochastic value of 11. - 9+B(4,
^{1}/_{4}): These tests use the specified probability of ‘^{1}/_{4}‘. Cards are chosen as the random device, where**J-K**is a success. 4 basic tests are run, resulting in {2; 9; 3;**J**}, which is 1 success. This is added to 9. 9+1 give a final stochastic value of 10. _{8+B(3,2/3}): These tests use the specified probability of ‘^{2}/_{3}‘. Dice are chosen as the random device, where**3-6**is a success. 3 basic tests are run, resulting in {**6**; 1;**5**}, which is 2 successes. This is added to 8. 8+2 give a final stochastic value of 10.- 16+2×B(4): These tests use the default probability of ‘
^{1}/_{2}‘. Dice are chosen as the random device, where**4-6**is a success. 4 basic tests are run, resulting in {1; 3;**5**;**6**}, which is 2 successes. This is multiplied by 2, then added to 16. 16+2×2 gives a final stochastic value of 20. - 8+NB(2): These tests use the default probability of ‘
^{1}/_{2}‘. Coins are chosen as the random device, where**H**is a success. 2 continued tests are run, resulting in {**H, H, H, H**, T;**H**, T}, which is 5 successes. This is added to 8. 8+5 gives a final stochastic value of 13.