You are on page 1of 4

ECEN 303: Assignment 1

Reading Assignment: 1. Chapter 1: Mathematical Review; 2. Chapter 2: Basic Concepts of Probability, pages 810. Problems: 1. Following the argument presented in the notes, prove that
c

S
A c

=
A

c S .

Suppose that x belongs to I S . That is, there exists an I such that x is not an c , and therefore x c element of S . This implies that x belongs to S I S . Thus, we c c I S . The converse is obtained by reversing the argument. have shown that I S c c Suppose that x belongs to I S . Then, there exists an I such that x S . This c implies that x S and, as such, x / / I S . I S . Alternatively, we have x Putting these two inclusions together, we get the desired result.

2. Two dice are rolled at the same time. (a) What is the probability that the sum of the dice is equal to 7? There are six distinct ways in which two dice can have a sum of 7, namely (1, 6), (2, 5), (3, 4), (4, 3), (5, 2) and (6, 1). The probability of getting a sum of 7 is then given by 1 6 = . 36 6 (b) What is the probability that the sum of the dice is equal to a prime number? The prime numbers between two and twelve are {2, 3, 5, 7, 11}. Using a strategy similar to what was employed above, we get Pr(2) = 1/36, Pr(3) = 2/36, Pr(5) = 4/36, Pr(7) = 6/36, and Pr(11) = 2/36. Thus, the overall probability of getting a prime number is 15/36. 3. (a) How many dierent 7-place license plates are possible if the rst 2 places are for letters and the other 5 for numbers? Thre are 26 possibilities for the rst letter, 26 for the second. Similarly, there are 10 possibilities for each of the numbers. The number of dierent 7-place license plates is therefore 262 105 = 67, 600, 000. (b) Repeat part (a) under the assumption that no letter or number can be repeated in a single license plate.

In this case, there are 26 possiblities for the rst letter, and 25 for the second one. Also, there are 10 possibilities for the rst number, 9 for the second, 8 for the third, 7 for the fourth, and 6 for the fth one. The number of such 7-place license plates is equal to 26 25 10 9 8 7 6 = 19, 656, 000. 4. Five separate awards (best scholarship, best leadership qualities, and so on) are to be presented to selected students from a class of 30. How many dierent outcomes are possible if (a) a student can receive any number of awards; In this case, there are 30 possibilities for the rst award, 30 for the second, 30 for the third, 30 for the fourth, and 30 for the fth award. Thus, the total number of outcomes is 305 = 24, 300, 000. (b) each student can receive at most 1 award? In this alternate scenario, there are 30 possibilities for the rst award, 29 for the second, 28 for the third, 27 for the fourth, and 26 for the fth award. The total number of awards then becomes 30 29 28 27 26 = 17, 100, 720. 5. A total of 7 dierent gifts are to be distributed among 10 children. How many distinct results are possible if no child is to receive more than one gift? There are 10 possibilities for the rst gift, there are 9 possibilities for the second gift, and so on. The number of distinct results is 10!/3!. 6. Fix two sets A and C. If C A, show that for every set B, (A B) C = A (B C). (1)

Also show that if (1) holds for some set B, then C A (and thus (1) holds for all sets B). To prove the rst part, we use set operations (A B) C = (A C) (B C) = A (B C). The last step follows from the fact that A C = A since C A. For the second part, suppose that C is not a subset of A. Then there exists an element e C A. By denition e (A B) C, since e C. However, e A and therefore e A (B C). In other words, / / if C is not a subset of A then (1) does not hold (for any set B). Programming Challenges: 1. Write a short C program that, upon request, generates a random number between one and ten. Below, you will nd a subroutine that selects two problems from a homework assignments. You can easily modify this program to generate a random number between one and ten. 2

#include <stdio.h> #include <stdlib.h> #include <ctype.h> /* Ran is from "Numerical Recipes: The Art of Scientific Computing" by William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery, 2007. */ struct Ran { unsigned long long int u,v,w; Ran(unsigned long long int j) : v(4101842887655102017LL), w(1) { u = j ^ v; int64(); v = u; int64(); w = v; int64(); } inline unsigned long long int int64() { u = u * 2862933555777941757LL + 7046029254386353087LL; v ^= v >> 17; v ^= v << 31; v ^= v >> 8; w = 4294957665U*(w & 0xffffffff) + (w >> 32); unsigned long long int x = u ^ (u << 21); x ^= x >> 35; x ^= x << 4; return (x + v) ^ w; } inline double doub() { return 5.42101086242752217E-20 * int64(); } inline unsigned int int32() { return (unsigned int)int64(); } }; main() { int index; unsigned long int numero; Ran myran(18); for (index = 1; index <= 10; index++) { numero = (myran.int32() % 6) + 1; printf("Random number: %10lu\n", numero); }; };

Optional Problems: 1. Consider rolling a six-sided die. Let A be the set of outcomes where the roll is an even number. Let B be the set of outcomes where the roll is greater than 3. Calculate and compare the sets on both sides of De Morgans laws (A B)c = Ac B c , (A B)c = Ac B c .

Here, we have the following sets A = {2, 4, 6} and B = {4, 5, 6}. For the rst equation, we have (A B)c = ({2, 4, 6} {4, 5, 6})c = {2, 4, 5, 6}c = {1, 3} and Ac B c = {2, 4, 6}c {4, 5, 6}c = {1, 3, 5} {1, 2, 3} = {1, 3}. Clearly, the equality holds. Similarly, for the second equation, we have (A B)c = ({2, 4, 6} {4, 5, 6})c = {4, 6}c = {1, 2, 3, 5} and Ac B c = {2, 4, 6}c {4, 5, 6}c = {1, 3, 5} {1, 2, 3} = {1, 2, 3, 5}. Again, this De Morgans law holds, as expected. 2. How many outcome sequences are possible when a die is rolled four times, where we say, for instance, that the outcome is 3, 4, 3, 1 if the rst roll landed on 3, the second on 4, the third on 3, and the fourth on 1? There are 6 possibilities for the rst roll, 6 for the second, 6 for the third, and 6 for the fourth; therefore there are exactly 1296 possible outcomes. We note that order matters in this case. 3. In how many ways can 3 novels, 2 mathematics books, and 1 chemistry book be arranged on a bookshelf if (a) the books can be arranged in any order; If the books can be arranged in any order, then there are 6! book arrangements. (b) the mathematics books must be together and the novels must be together; Under these constraints, there are 3! 3! 2! dierent book arrangements. First, there are 3! ways to order novels, mathematics books, and the chemistry book. Within the novels, there are 3! possible arrangements. Similarly, within the mathematics books, there are 2! possible arrangements. (c) the novels must be together but the other books can be arranged in any order? If only the novels must be together, then there are a total of 4 3! 3! arrangements.

You might also like