CS 242, Section 002 Sonoma State University Spring, 2026
 
Discrete Structures for Computer Science
Instructor: Henry M. Walker

Lecturer, Sonoma State University
Professor Emeritus of Computer Science and Mathematics, Grinnell College

Notes:


Assignment 9 (Counting)

  1. California License Plates for Cars:
    In California, car owners can pay extra, so that their license plates have a particular label. For example, one might want the text "CS 242" as their car license plate. (I don't know if such a label is possible in California, and if even it is legal, the Department of Motor Vehicles would have to check that no other car has that text.) Such a license plate is sometimes called a "vanity plate."

    Ignoring vanity plates, many California license plates have the form D L L L D D D, where D is a digit (0, 1, 2, . . . , 9) and L is an upper-case letter (A, B, . . . , Z). Compute how many license plates of this form are possible.

  2. Computing Permutations and Combinations:
    Given an initial set of n elements, Sections 10.4 and 10.5 of the textbook define r-permutations P(n,r) and r-combinations C(n, r).

    1. Explain in your own words why \( P(n, r) = n*(n-1)*(n-2)*. . . *(n-r+1) \)
      That is, in your own words, explain the idea that leads to this formula.
    2. The textbook claims that \( P(n, r) = n*(n-1)*(n-2)*. . . *(n-r+1) \) also is equal to \( \frac{n!}{(n-r)!} \). Explain in your own words why these two formulae are equal.
    3. Starting with the formula \( P(n, r) = \frac{n!}{(n-r)!} \), the textbook argues that \( C(n, r) = \frac{n!}{r!(n-r)!} \) Explain in your own words, why the term r! is added in the denominator when starting with P(n, r) to determine C(n, r).
  3. The California Lottery Powerball Game: To play the California Lottery Powerball Game, you "pick 5 numbers between 1 and 69 and 1 Power Number between 1 and 26." You win the jackpot if the first five numbers you pick match the first five numbers drawn and your sixth number matches the sixth number drawn.
    Note: In this Powerball Game, the order in which you pick the first five numbers does not matter.

    1. Showing your work, compute the number of different selections (5 numbers plus the powerball) that are possible for the California Powerball Game (ignoring the order of the first five numbers. (The lottery Web site above using the "Game Odds" tab indicates there are 292,201,338 possibilities. Does your computation agree?)
    2. Second prize in the California Powerball Game requires that you match all five of the first five numbers, but you guessed incorrectly for the powerball number. How many selections (5 numbers and not the powerball) are possible to win this second prize. As with part a, you must indicate the elements of your computation—not just the answer.
    3. A much smaller prize is possible if you match 3 of the five initial numbers, but your sixth/powerball number does not match. How many different selections are possible if only 3 of the 5 initial numbers match, and the powerball is incorrect. As with parts a and b, you must show the steps of your computation—not just the answer.

    A Note for Comparison: For residents of the United States, the average chance for a person to be killed by lightening is 1 in 1.2 million for a year, or 1 in 15,300 over a lifetime—although individual odds depend on the area where you live and some characteristics of your life style. (Using this average, you are about 240 times more likely to be hit by lightening this year than to win the Powerball Game—assuming you play the game at all.)


created October 25, 2025
revised October-November, 2025
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.