EECS 1520 Midterm: Test 1 version 2 part d

61 views2 pages
mahika.c06 and 40040 others unlocked
EECS 1520 Full Course Notes
54
EECS 1520 Full Course Notes
Verified Note
54 documents

Document Summary

Recall from test 1 that the graphic below is from a workbook to analyze probability in card games. S_ is one of the integers 1, 2, 3, or 4, and is randomly chosen. Suit is assigned by an if statement according to the corresponding value of s_. R_ is an integer in the range 2 to 14 inclusive, also randomly chosen. Rank is assigned by an if statement according to r_, using the following mapping: Values in the range 2 to 10 are copied from r_ 11, 12, 13, and 14 are replaced by jack , Ace: write a formula for rank that does not use an if function. Use only the data shown to answer the following questions. All ranges have been named using the labels that appear in the worksheets. Here is an alternative technique for dealing cards . Pos is a random integer in the range 1 to 52, inclusive.