Package dice. February 15, 2013

Similar documents
Package SvyNom. February 24, 2015

LISTING THE WAYS. getting a total of 7 spots? possible ways for 2 dice to fall: then you win. But if you roll. 1 q 1 w 1 e 1 r 1 t 1 y

Package crimcv. January 25, Index 6. Fits finite mixtures of Zero-inflated Poisson models

Package EILA. February 19, Index 6. The CEU-CHD-YRI admixed simulation data

HOW TO USE. Print a copy of the Scoring and Charting pages for each team playing the game.

8.2 Union, Intersection, and Complement of Events; Odds

Package reddprec. October 17, 2017

Probability. Ms. Weinstein Probability & Statistics

There are three types of mathematicians. Those who can count and those who can t.

Package timeseq. July 17, 2017

Package countrycode. February 6, 2017

Package deseasonalize

Package PersomicsArray

What are the chances?

Package evenn. March 10, 2015

Junior Circle Meeting 5 Probability. May 2, ii. In an actual experiment, can one get a different number of heads when flipping a coin 100 times?

37 Game Theory. Bebe b1 b2 b3. a Abe a a A Two-Person Zero-Sum Game

Experiments in Probability ----a game of dice ---

STAT 311 (Spring 2016) Worksheet: W3W: Independence due: Mon. 2/1

Probability (Devore Chapter Two)

Counters in a Cup In and Out. The student sets up the cup, drops the counters on it, and records how many landed in and out of the cup.

Package ScrabbleScore

Package gamesnws. February 15, 2013

Package countrycode. October 27, 2018

1. For which of the following sets does the mean equal the median?

ITEC 2600 Introduction to Analytical Programming. Instructor: Prof. Z. Yang Office: DB3049

Mathematical Magic Tricks

Package randomnames. June 6, 2017

CSE 21: Midterm 1 Solution

Package tictactoe. May 26, 2017

Selected Game Examples

Package pedigreemm. R topics documented: February 20, 2015

Package rtide. May 10, 2017

What is the expected number of rolls to get a Yahtzee?

Probability Simulation User s Manual

Package ImaginR. May 31, 2017

Package RVtests. R topics documented: February 19, 2015

Counting Learning Outcomes

Package GiniWegNeg. May 24, 2016

Section 6.1 #16. Question: What is the probability that a five-card poker hand contains a flush, that is, five cards of the same suit?

Package iterpc. April 24, 2018

BOOM! subtract 15. add 3. multiply by 10% round to. nearest integer. START: multiply by 2. multiply by 4. subtract 35. divide by 2

DICE GAMES WASHINGTON UNIVERSITY MATH CIRCLE --- FEBRUARY 12, 2017

Package Rd2md. May 22, 2017

Mutually Exclusive Events

Winter Math Games Building Fluency


Standard Sudoku point. 1 point. P a g e 1

Digital Patterns. If you would like to donate click here. No Paypal account needed. Designed by Steve Good

Reading and Understanding Whole Numbers

Your challenge is to make the turtles draw a flower pattern on Spaceland and to experiment with different kinds of turtle movement.

Package rreg. January 18, 2018

Honors Precalculus Chapter 9 Summary Basic Combinatorics

CONTIG is a fun, low-prep math game played with dice and a simple game board.

Poker: Probabilities of the Various Hands

1. Activities (from Guidelines in Number)

Roll & Make. Represent It a Different Way. Show Your Number as a Number Bond. Show Your Number on a Number Line. Show Your Number as a Strip Diagram

Package gamesga. June 13, 2017

Package GiniWegNeg. January 13, 2016

Compound Events. Identify events as simple or compound.

MAT104: Fundamentals of Mathematics II Summary of Counting Techniques and Probability. Preliminary Concepts, Formulas, and Terminology

1. How many subsets are there for the set of cards in a standard playing card deck? How many subsets are there of size 8?

The Expected Number Of Dice Rolls To Get YAHTZEE

Write algorithms with variables. Phil Bagge code-it

Classwork Example 1: Exploring Subtraction with the Integer Game

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

MAT 17: Introduction to Mathematics Final Exam Review Packet. B. Use the following definitions to write the indicated set for each exercise below:

Materials: Game board, dice (preferable one 10 sided die), 2 sets of colored game board markers.

Updated December Year. Small Steps Guidance and Examples. Block 4: Multiplication & Division

Such a description is the basis for a probability model. Here is the basic vocabulary we use.

Waiting Times. Lesson1. Unit UNIT 7 PATTERNS IN CHANCE

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mathematics Enhancement Programme TEACHING SUPPORT: Year 3

CSCI 2200 Foundations of Computer Science (FoCS) Solutions for Homework 7

Chapter 1: Sets and Probability

Poker: Probabilities of the Various Hands

Probability Models. Section 6.2

Building Successful Problem Solvers

Domino Games. Variation - This came can also be played by multiplying each side of a domino.

Moose Mathematics Games Journal Table of Contents

Lecture 2: Sum rule, partition method, difference method, bijection method, product rules

Package linlir. February 20, 2015

Subtraction Step Down

Class\lane pm pm 0 9 (the second distribution is lost)

Applications of Independent Events

Score. Please print legibly. School / Team Names. Directions: Answers must be left in one of the following forms: 1. Integer (example: 7)

Exam III Review Problems

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Algebra 2 P49 Pre 10 1 Measures of Central Tendency Box and Whisker Plots Variation and Outliers

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

Package IQCC. R topics documented: November 15, Title Improved Quality Control Charts Version 0.7

Begin this assignment by first creating a new Java Project called Assignment 5.There is only one part to this assignment.

Multiples and Divisibility

Name: Final Exam May 7, 2014

Define and Diagram Outcomes (Subsets) of the Sample Space (Universal Set)

Foundations of Probability Worksheet Pascal

Year 1. Place Value. Term by Term Objectives. All students Fluency Reasoning Problem Solving. National Curriculum Statement

CSC/MATA67 Tutorial, Week 12

Fraction Race. Skills: Fractions to sixths (proper fractions) [Can be adapted for improper fractions]

Sample Spaces, Events, Probability

Transcription:

Package dice February 15, 2013 Type Package Title Calculate probabilities of various dice-rolling events Version 1.1 Date 2008-09-04 Author Dylan Arena Maintainer Dylan Arena <dylanarena1@gmail.com> Description This package provides utilities to calculate the probabilities of various dice-rolling events, such as the probability of rolling a four-sided die six times and getting a 4, a 3, and either a 1 or 2 among the six rolls (in any order); the probability of rolling two six-sided dice three times and getting a 10 on the first roll, followed by a 4 on the second roll, followed by anything but a 7 on the third roll; or the probabilities of each possible total of rolling five six-sided dice, dropping the lowest two rolls, and summing the remaining dice. License GPL (>= 2) Depends R (>= 2.0.0), gtools NeedsCompilation no Repository CRAN Date/Publication 2008-09-06 11:35:25 R topics documented: dice-package........................................ 2 geteventprob........................................ 3 gettotalprobs........................................ 4 Index 7 1

2 dice-package dice-package Calculate probabilities of various dice-rolling events Description Details This package provides utilities to calculate the probabilities of various dice-rolling events, such as the probability of rolling a four-sided die six times and getting a 4, a 3, and either a 1 or 2 among the six rolls (in any order); the probability of rolling two six-sided dice three times and getting a 10 on the first roll, followed by a 4 on the second roll, followed by anything but a 7 on the third roll; or the probabilities of each possible total of rolling five six-sided dice, dropping the lowest two rolls, and summing the remaining dice. Package: dice Type: Package Version: 1.1 Date: 2008-09-04 License: GPL (>= 2) Although initially conceived as a utility for role-playing game calculations, functions in the dice package can be used to answer questions in any dice-rolling context (e.g., calculating probabilities for the game of craps, solving problems for an introductory probability course, etc.) The dice package requires the gtools package. For a complete list of functions, use library(help="dice"). Author(s) Dylan Arena <dylanarena1@gmail.com> References The implementation for the gettotalprobs function originated with the ideas presented in the following forum thread: http://www.enworld.org/showthread.php?t=56352&page=1&pp=40 Examples geteventprob(nrolls = 6, nsidesperdie = 4, eventlist = list(4, 3, c(1,2)), ordermatters = FALSE) geteventprob(nrolls = 3,

geteventprob 3 ndiceperroll = 2, eventlist = list(10, 4, c(2:6, 8:12)), ordermatters = TRUE) gettotalprobs(ndiceperroll = 5, nkept = 3) geteventprob Calculate the probability of a specified set of dice-rolling events Description Usage For a specified dice-rolling process, geteventprob calculates the probability of an event (i.e., a non-empty set of outcomes) that is specified by passing a list object in to eventlist. geteventprob(nrolls, ndiceperroll, nsidesperdie, eventlist, ordermatters = FALSE) Arguments nrolls ndiceperroll nsidesperdie eventlist ordermatters A single positive integer representing the number of dice rolls to make A single positive integer representing the number of dice to use in each dice roll A single positive integer representing the number of sides on each die (geteventprob s dice-rolling process involves only one type of die per call) A list object, each element of which is a vector that constrains a single dice roll in the dice-rolling process (see Details below) A logical flag indicating whether the order of the elements of eventlist should constrain the event space; if TRUE, eventlist must specify constraints for every dice roll i.e., it must contain exactly nrolls elements (some of which may be "empty" constraints listing all possible outcomes of a dice roll, i.e., a vector from ndiceperroll to (ndiceperroll * nsidesperdie)) Details Value The crux of this function is eventlist, which sets the conditions that acceptable dice-rolls must meet. E.g., to get the probability of rolling at least one 6 when rolling four six-sided dice, eventlist would be list(6) and ordermatters would be FALSE; to get the probability of rolling a 6, followed by a 5, followed by either a 1, 2, or 3 when rolling three six-sided dice, eventlist would be list(6,5,1:3) and ordermatters would be TRUE. A single number representing the probability of an event that meets the constraints of the specified dice-rolling process

4 gettotalprobs Author(s) Dylan Arena Examples ## Probability of rolling at least one 6 when rolling four six-sided dice geteventprob(nrolls = 4, eventlist = list(6)) ## Probability of rolling a 6, followed by a 5, followed by either a 1, 2, ## or 3 when rolling three six-sided dice geteventprob(nrolls = 3, eventlist = list(6, 5, 1:3), ordermatters = TRUE) ## Probability of rolling no 10 s when rolling two ten-sided dice geteventprob(nrolls = 2, nsidesperdie = 10, eventlist = list(1:9,1:9)) gettotalprobs Calculate the probabilities of all possible outcome totals of a dice roll Description Usage For a specified number of dice with a specified number of sides per die (and dropping a specified number of dice those with the lowest values), gettotalprobs calculates the probabilities of all possible outcome totals (i.e., all possible sums of those dice whose results are not dropped); the function also accommodates modifiers (either to each die roll or to the sum), such as rolling five four-sided dice and adding 1 to the outcome of each roll, or rolling one twenty-sided die and adding 12 to the outcome. (Such modified rolls frequently occur in the context of role-playing games, e.g., Dungeons & Dragons, Mutants & Masterminds, or BESM.) gettotalprobs(ndiceperroll, nsidesperdie, nkept = ndiceperroll, totalmodifier = 0, perdiemodifier =

gettotalprobs 5 Arguments Value ndiceperroll nsidesperdie nkept totalmodifier A single positive integer representing the number of dice to roll A single positive integer representing the number of sides on each die (gettotalprobs s dice-rolling process involves only one type of die per call) A single positive integer representing the number of dice whose values to include when calculating the total (the dice to be kept will always be those with the highest values) A single integer representing an amount to add to or subtract from the outcome total perdiemodifier A single integer representing an amount to add to or subtract from each die roll perdieminofone A logical flag indicating whether each die roll should be considered to have a minimum value of 1 (as is often true in role-playing game contexts) probabilities average A matrix with a row for each possible outcome total and three columns: one that lists each total, one for the probability of that total, and one for the number of ways to roll that total A single number representing the expected value of the specified dice-rolling process Author(s) Dylan Arena References This function s implementation originated with the ideas presented in the following forum thread: http://www.enworld.org/showthread.php?t=56352&page=1&pp=40 Examples #\dontshow{ # Not sure why this is causing check utility to fail; running the code in R produces correct result # stopifnot(all.equal(gettotalprobs(5, 6, 2)$probabilities[11,2], 0.1356739, tolerance=.0001)) #} ## Rolling four six-sided dice and keeping the three highest die rolls gettotalprobs(ndiceperroll = 4, nkept = 3) ## Rolling five four-sided dice and adding 1 to each die roll gettotalprobs(ndiceperroll = 5, nsidesperdie = 4,

6 gettotalprobs perdiemodifier = 1) ## Rolling one twenty-sided die and adding 12 to the result gettotalprobs( nsidesperdie = 20, totalmodifier = 12)

Index Topic distribution geteventprob, 3 gettotalprobs, 4 Topic package dice-package, 2 dice (dice-package), 2 dice-package, 2 geteventprob, 3 gettotalprobs, 2, 4 7