CS103X: Discrete Structures Homework 4 Solutions



Similar documents
In nite Sequences. Dr. Philippe B. Laval Kennesaw State University. October 9, 2008

5.3. Generalized Permutations and Combinations

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

1. MATHEMATICAL INDUCTION

3. Greatest Common Divisor - Least Common Multiple

5.4 Amortization. Question 1: How do you find the present value of an annuity? Question 2: How is a loan amortized?

Soving Recurrence Relations

Notes on exponential generating functions and structures.

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 13

Elementary Theory of Russian Roulette

Infinite Sequences and Series

Trigonometric Form of a Complex Number. The Complex Plane. axis. ( 2, 1) or 2 i FIGURE The absolute value of the complex number z a bi is

Example 2 Find the square root of 0. The only square root of 0 is 0 (since 0 is not positive or negative, so those choices don t exist here).

1 Correlation and Regression Analysis

Chapter 5: Inner Product Spaces

PERMUTATIONS AND COMBINATIONS

Solutions to Exercises Chapter 4: Recurrence relations and generating functions

How To Solve The Homewor Problem Beautifully

Section 11.3: The Integral Test

SAMPLE QUESTIONS FOR FINAL EXAM. (1) (2) (3) (4) Find the following using the definition of the Riemann integral: (2x + 1)dx


Department of Computer Science, University of Otago

THE ARITHMETIC OF INTEGERS. - multiplication, exponentiation, division, addition, and subtraction

.04. This means $1000 is multiplied by 1.02 five times, once for each of the remaining sixmonth

2-3 The Remainder and Factor Theorems

CS103A Handout 23 Winter 2002 February 22, 2002 Solving Recurrence Relations

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Week 3 Conditional probabilities, Bayes formula, WEEK 3 page 1 Expected value of a random variable

Taking DCOP to the Real World: Efficient Complete Solutions for Distributed Multi-Event Scheduling

Lesson 17 Pearson s Correlation Coefficient

Basic Elements of Arithmetic Sequences and Series

Lecture 4: Cauchy sequences, Bolzano-Weierstrass, and the Squeeze theorem

Hypergeometric Distributions

Properties of MLE: consistency, asymptotic normality. Fisher information.

Repeating Decimals are decimal numbers that have number(s) after the decimal point that repeat in a pattern.

S. Tanny MAT 344 Spring be the minimum number of moves required.


Lecture 5: Span, linear independence, bases, and dimension

WHEN IS THE (CO)SINE OF A RATIONAL ANGLE EQUAL TO A RATIONAL NUMBER?

I. Chi-squared Distributions

Your organization has a Class B IP address of Before you implement subnetting, the Network ID and Host ID are divided as follows:

Section 8.3 : De Moivre s Theorem and Applications

CHAPTER 3 THE TIME VALUE OF MONEY

1 Computing the Standard Deviation of Sample Means

Lesson 15 ANOVA (analysis of variance)

Sequences and Series

BINOMIAL EXPANSIONS In this section. Some Examples. Obtaining the Coefficients

SEQUENCES AND SERIES

Chapter 6: Variance, the law of large numbers and the Monte-Carlo method

Solving Logarithms and Exponential Equations

The Stable Marriage Problem

Approximating Area under a curve with rectangles. To find the area under a curve we approximate the area using rectangles and then use limits to find

Listing terms of a finite sequence List all of the terms of each finite sequence. a) a n n 2 for 1 n 5 1 b) a n for 1 n 4 n 2

Overview of some probability distributions.

GCSE STATISTICS. 4) How to calculate the range: The difference between the biggest number and the smallest number.

FIBONACCI NUMBERS: AN APPLICATION OF LINEAR ALGEBRA. 1. Powers of a matrix

Asymptotic Growth of Functions

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 8

Part - I. Mathematics

Lecture 4: Cheeger s Inequality

Present Value Factor To bring one dollar in the future back to present, one uses the Present Value Factor (PVF): Concept 9: Present Value

5 Boolean Decision Trees (February 11)

Math C067 Sampling Distributions

Time Value of Money. First some technical stuff. HP10B II users

Determining the sample size

Chapter 7 Methods of Finding Estimators

Factoring x n 1: cyclotomic and Aurifeuillian polynomials Paul Garrett <garrett@math.umn.edu>

Definition. A variable X that takes on values X 1, X 2, X 3,...X k with respective frequencies f 1, f 2, f 3,...f k has mean

Domain 1: Designing a SQL Server Instance and a Database Solution

5: Introduction to Estimation

AP Calculus AB 2006 Scoring Guidelines Form B

THE REGRESSION MODEL IN MATRIX FORM. For simple linear regression, meaning one predictor, the model is. for i = 1, 2, 3,, n

A probabilistic proof of a binomial identity

Hypothesis testing. Null and alternative hypotheses

where: T = number of years of cash flow in investment's life n = the year in which the cash flow X n i = IRR = the internal rate of return

Cooley-Tukey. Tukey FFT Algorithms. FFT Algorithms. Cooley

Notes on Combinatorics. Peter J. Cameron

Building Blocks Problem Related to Harmonic Series

A Note on Sums of Greatest (Least) Prime Factors

AP Calculus BC 2003 Scoring Guidelines Form B

Project Deliverables. CS 361, Lecture 28. Outline. Project Deliverables. Administrative. Project Comments

Math 113 HW #11 Solutions

UC Berkeley Department of Electrical Engineering and Computer Science. EE 126: Probablity and Random Processes. Solutions 9 Spring 2006

The new assembly line of the Car Corp.

Confidence Intervals. CI for a population mean (σ is known and n > 30 or the variable is normally distributed in the.

Now here is the important step

Descriptive Statistics

Case Study. Normal and t Distributions. Density Plot. Normal Distributions

Convexity, Inequalities, and Norms

Modified Line Search Method for Global Optimization

NATIONAL SENIOR CERTIFICATE GRADE 12

1. C. The formula for the confidence interval for a population mean is: x t, which was

Measures of Spread and Boxplots Discrete Math, Section 9.4

Incremental calculation of weighted mean and variance

HOW MANY TIMES SHOULD YOU SHUFFLE A DECK OF CARDS? 1

Ekkehart Schlicht: Economic Surplus and Derived Demand

Confidence Intervals for One Mean

Transcription:

CS103X: Discrete Structures Homewor 4 Solutios Due February 22, 2008 Exercise 1 10 poits. Silico Valley questios: a How may possible six-figure salaries i whole dollar amouts are there that cotai at least three distict digits? b Secod Silico Valley questio: What is the umber of six-figure salaries that are ot multiples of either 3, 5, or 7. Solutio a First ote that there are 999, 999 100, 000 1 900, 000 total possible salaries. Let us ow cout the complemet case - umber of six-figure salaries that cotai at most two distict digits. There are 9 salaries with 1 distict digit 111111, 222222,..., 999,999. Now let us cout the salaries that have exactly two distict digits. Sice the first digit caot be 0, we eed to cosider the case whe oe of the two distict digits is 0 differetly. So suppose oe of the two distict digits is 0, the we have 9 choices for the other digit. The first positio eeds to cotai this o-zero digit ad we get to place either of the two i the last 5 positios however we wat. There are 2 5 1 differet ways to do this, sice we ca cosider a bijectio betwee 5 digit biary umbers where 0 meas that 0 is i the positio, 1 meas that the other digit is i the positio. So there are i total 9 2 5 1 differet salaries with two distict digits, oe of which is 0 sice a biary value of 11111 gives all 1 digit, we tae it out. For the case of two distict digits whe either digit is 0, we get 9 2 2 6 2. First we choose two digits, ad the similar to the 0 case, we have 2 6 2 differet ways of arragig the two umbers for two distict digits. Notice that we have have to disclude the values 000000 ad 111111, which would oly iclude 1 distict digit. Therefore, i total, we have 900, 000 9 9 2 5 1 9 2 2 6 2 897, 480 b From a there are 900,000 possible six-figure salaries. Now let us cout the umber of possible six-figure salaries that are multiples of either 3, 5, or 7. We ca subtract this umber from the total to obtai the umber of six-figure salaries that are ot multiples of either 3, 5, or 7. Let D 3, D 5, D 7 be the set of six-figure salaries that are multiples of 3,5,7 respectively. We therefore eed to fid D 3 D 5 D 7. We will use the iclusio-exclusio priciple to compute this. D 3 999,999 100,002 3 1 300, 000 D 5 999,995 100,000 5 1 180, 000 D 7 999,999 100,002 7 1 128, 572 D 3 D 5 999,990 100,005 3 5 1 60, 000 D 3 D 7 999,999 100,002 3 7 1 42, 858 D 5 D 7 999,990 100,030 5 7 1 25, 714 D 3 D 5 D 7 999,915 100,065 3 5 7 1 8, 571 1

From the iclusio-exclusio priciple: D 3 D 5 D 7 D 3 D 5 D 7 D 3 D 5 D 3 D 7 D 5 D 7 D 3 D 5 D 7 488, 571 Therefore, the umber of six-figure salaries that are ot multiples of either 3, 5, or 7 are give by: 900, 000 488, 571 411, 429 Exercise 2 15 poits. A roo o a chessboard is said to put aother chess piece uder attac if they are i the same row or colum. a How may ways are there to arrage 8 roos o a chessboard the usual 8 8 oe so that oe are uder attac? b How may ways are there to arrage roos o a chessboard so that oe are uder attac? c Imagie a three-dimesioal chess variat played o a 8 8 8 board. 512 cells overall. Call it Weir-D Chess. A battleship is a Weir-D Chess piece that ca attac ay piece that is i the same two-dimesioal layer, alog some coordiate. For example, a battleship i positio 5, 2, 6 puts cell 8, 2, 1 uder attac, but ot cell 8, 3, 1. How may ways are there to arrage 8 battleships o a Weir-D Chess board so that oe are uder attac? Give solutios with o summatio. Solutio a 8!. Cosider 8 8 board as 8 colums. I the first colum, you ca choose 8 differet positios for a roo. For the secod colum, there are oly 7 remaiig positios available, etc. The last colum will force the last roo ito positio. b. Cosider board as colums. I the first colum, you ca choose differet positios for a roo. For the secod colum, there are 1 remaiig positios available, etc dow to 1 remaiig positios for the last roo. We are placig roos, so we eed to choose which colums they are i. Thus, it is c 8! 2. Cosider a 8 8 8 cube ad cosider placig a roo o each of the 8 plaes horizotally or vertically. The first roo placed has 8 8 positios i its plae. This roo elimiates a cross sectio of all the others such that there are effectively 7 7 valid positios i each remaiig plae. Similarly, the ext roo has 7 7 positios ad leaves 6 6 valid positios i each remaiig plae. If we cotiue i this fashio, we will have 8 2 7 2... 2 2 1 2 8! 2 ways of placig the roos. Exercise 3 15 poits. A fuctio f : {1, 2,..., } {1, 2,..., m} is called mootoe odecreasig if 1 i < j fi fj. a How may such fuctios are there? b How may such fuctios are there that are surjective? c How may such fuctios are there that are ijective? 2

Solutio a There are m 1 such fuctios. Cosider the codomai {1, 2,..., m} as bis ad the domai {1, 2,..., } as balls. If a bi codomai elemet cotais a ball, it meas that oe of the elemets i the domai maps to it. Thus, if we repeset this as bis ad balls, ay orderig of the bis ad balls will give us a uique mappig from domai to codomai sice it has to be mootoe odecreasig The bijectio as follows: the smallest valued bi that has a ball must must map to the miimal domai elemet. Remove that ball ad the ew smallest valued bi that could be the same value as the bi i the previous step has a ball must map to the secod miimal domai elemet, ad so o. Now we ca apply the caoical uordered with repetitio formula. b There are mm 1 m 1 m such fuctios. Agai, if we use the balls ad bis aalogy, we have to first allocate 1 ball for each bi, ad the choose positios for the rest of the balls. Thus, m balls are left for us to put ito bis, as i the caoical uordered with repetitio problem. c There are m. Oce we choose the a set of elemets from m, we will ow the exact mappig because the fuctio must be mootoe odecreasig. Thus, we eed to determie i how may ways ca we choose elemets from m. Exercise 4 10 poits. How may ways are there to express a positive iteger as: a A sum of atural umbers? For example, if 2 ad 3 the aswer is 6, sice 2 2 0 0 0 2 0 0 0 2 1 1 0 1 0 1 0 1 1. b A sum of positive itegers? The order of the summads is importat. Imagie the summatio writte dow. Solutio a 1. Cosider each xi as a box ad there are balls. The we have the caoical uordered with repetitio. b Cosider the formula i part a. We ow have ragig from 1 to, with atleast 1 ball i each box. We allocate 1 ball i each box first, so we have balls left to place. Thus, we have 1 1 1 1 2 1 Exercise 5 10 poits. Prove either algebraically or combiatorically: a For p, 0, b p p 1 p 1 m m 1 0 Solutios a Cosider what the RHS is coutig. We are choosig p 1 elemets from 1 possible elemets. Let us umber these elemets 1, 2, 3,...,, 1. Let us cout the umber of ways to select p 1 elemets i a particular way. Suppose the maximal elemet piced is goig to be p 1. The we have p p ways of choosig the last p elemets. Now suppose the maximal elemet piced is goig 3

to be p 2. The we have p1 p ways of choosig the last p elemets. I geeral, if the maximal elemet piced is 1, the we have p ways of choosig the last p elemets. So we have p as desired. b Cosider the RHS. Let s apply Pascal s rule repeatedly: m 1 m m 1 m m 1 m 1 1 2 m m 1 m 2 m 2 1 2 3 as desired. p. m m 1 m 2 m 1... 1 2 1 m 0 Exercise 6 10 poits. Give a closed-form expressio without summatio for the followig: 2. Solutio 0 2 1 2 3 0 m 0 Exercise 7 10 poits. I a mathematics cotest with three problems, 80% of the participats solved the first problem, 75% solved the secod ad 70% solved the third. Prove that at least 25% of the participats solved all three problems. The claim might seem obvious fid a proof. Solutio Let the total umber of participats be > 0 if 0, the proof is trivial. Deote the set of people who missed the first problem by A, the set of people who missed the secod by B, ad the set who missed the third by C. We ow that A 0.8 0.2, B 0.75 0.25 ad C 0.7 0.3. We also ow, from the lecture otes, that A B C A B C 0.2 0.25 0.3 0.75 The set of people who solved all three problems is the complemet of A B C the set who missed at least oe problem, so it has size A B C 0.75 0.25 Therefore at least 25% of the participats solved all three problems. Exercise 8 10 poits. What is the umber of iteger solutios of the equatio such that 0 x i 20 for each 1 i 3? x 1 x 2 x 3 50, 4

Solutio Let us cout the complemet. At least 1 bi has more tha 20 balls. This problem may be thought of as the uordered with repetitio problem. Cosider 3 bis ad 50 balls. Without loss of geerality, let the first bi cotai at least 21 balls. The there are 29 balls remaiig. There are effectively 3 bis ad 29 balls, which maes for 293 1 29 ways of havig the first bi cotai at least 21 balls. Without loss of geerality, let the first two bis cotai at least 21 balls. The there are 8 balls remaiig. Still, there are effectively 3 bis ad 8 ball,s which maes for 83 1 8. There caot be at ay time all three bis havig at least 21 balls, as 21 3 63 > 50. Now we ca apply the iclusio-exclusio priciple. Let P {1} be the umber ways that we ca have bi 1 have more tha 20 balls, P {1, 2} be the umber of ways that we ca have bis 1 ad 2 have more tha 20 balls, etc. P {1} P {2} P {3} P {1, 2} P {1, 3} P {2, 3} P {1, 2, 3} 29 3 1 8 3 1 3 3 0 29 8 This is the complemet. I total, the umber of iteger solutios to the equatio is 503 1 50 with o restrictios. Therefore, the umber of ways to mae 0 x i 20 for each 1 i 3 is: 50 3 1 29 3 1 8 3 1 3 3 66 50 29 8 Exercise 9 10 poits. There are people at a party, ad each perso has arrived i a differet hat. The revelry leaves them slightly tipsy, so each of them goes home wearig someoe else s hat. Fid the umber of ways of puttig hats o people so that o perso is wearig his/her ow hat. Give the full proof. Solutio Refer sectio 11.2 Deragemets i lecture otes. 5