CS3203 #5. 6/9/04 Janak J Parekh

Similar documents
Combinatorics. Chapter Permutations. Reading questions. Counting Problems. Counting Technique: The Product Rule

8. Combinatorial Structures

}, how many different strings of length n 1 exist? }, how many different strings of length n 2 exist that contain at least one a 1

PERMUTATIONS AND COMBINATIONS

PERMUTATION AND COMBINATION

7. Counting Measure. Definitions and Basic Properties

Ch 9 Sequences, Series, and Probability

Counting and Probability CMSC 250

We often find the probability of an event by counting the number of elements in a simple sample space.

Permutation Enumeration

1. How many possible ways are there to form five-letter words using only the letters A H? How many such words consist of five distinct letters?

AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

PERMUTATIONS AND COMBINATIONS

COMBINATORICS 2. Recall, in the previous lesson, we looked at Taxicabs machines, which always took the shortest path home

COLLEGE ALGEBRA LECTURES Copyrights and Author: Kevin Pinegar

Logarithms APPENDIX IV. 265 Appendix

THE LUCAS TRIANGLE RECOUNTED. Arthur T. Benjamin Dept. of Mathematics, Harvey Mudd College, Claremont, CA Introduction

Counting III. Today we ll briefly review some facts you dervied in recitation on Friday and then turn to some applications of counting.

AMC AMS AMR ACS ACR ASR MSR MCR MCS CRS

Counting on r-fibonacci Numbers

Roberto s Notes on Infinite Series Chapter 1: Series Section 2. Infinite series

x y z HD(x, y) + HD(y, z) HD(x, z)

Extra Practice 1. Name Date. Lesson 1.1: Patterns in Division

AS Exercise A: The multiplication principle. Probability using permutations and combinations. Multiplication principle. Example.

Grade 6 Math Review Unit 3(Chapter 1) Answer Key

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 12

Math 7 Flipped Mastery Self Tester Worksheet Name: Class:. Chapter 1 (Unit 1) Patterns and Relationships - Accommodated 1.1 Patterns In Division /36

Combinatorics. ChaPTer a The addition and multiplication principles introduction. The addition principle

CHAPTER 5 A NEAR-LOSSLESS RUN-LENGTH CODER

arxiv: v2 [math.co] 15 Oct 2018

Data Mining the Online Encyclopedia of Integer Sequences for New Identities Hieu Nguyen

Combinatorics and probability

H2 Mathematics Pure Mathematics Section A Comprehensive Checklist of Concepts and Skills by Mr Wee Wen Shih. Visit: wenshih.wordpress.

X-Bar and S-Squared Charts

On Parity based Divide and Conquer Recursive Functions

Shuffling Cards. D.J.W. Telkamp. Utrecht University Mathematics Bachelor s Thesis. Supervised by Dr. K. Dajani

General Model :Algorithms in the Real World. Applications. Block Codes

Mathematical Explorations of Card Tricks

Chapter (6) Discrete Probability Distributions Examples

Procedia - Social and Behavioral Sciences 128 ( 2014 ) EPC-TKS 2013

Intermediate Information Structures

Unit 5: Estimating with Confidence

Shuffling. Shahrzad Haddadan. March 7, 2013

2. There are n letter and n addressed envelopes. The probability that all the letters are not kept in the right envelope, is. (c)

Table Of Contents Blues Turnarounds

APPLICATION NOTE UNDERSTANDING EFFECTIVE BITS

BOUNDS FOR OUT DEGREE EQUITABLE DOMINATION NUMBERS IN GRAPHS

EMCdownload. Acknowledgements. Fair use

Arithmetic Sequences and Series Sequences and Series Preliminary Maths

On the Number of Permutations on n Objects with. greatest cycle length

lecture notes September 2, Sequential Choice

Introduction to Wireless Communication Systems ECE 476/ECE 501C/CS 513 Winter 2003

Summary of Random Variable Concepts April 19, 2000

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Making sure metrics are meaningful

Math 140 Introductory Statistics

13 Legislative Bargaining

PRACTICAL FILTER DESIGN & IMPLEMENTATION LAB

You Think You ve Got Problems? Marc Brodie Associate Professor of Mathematics, WJU

POWERS OF 3RD ORDER MAGIC SQUARES

202 Chapter 9 n Go Bot. Hint

Fingerprint Classification Based on Directional Image Constructed Using Wavelet Transform Domains

CS 201: Adversary arguments. This handout presents two lower bounds for selection problems using adversary arguments ëknu73,

The Institute of Chartered Accountants of Sri Lanka

Chapter 2: Probability

Blues Soloing Masterclass - Week 1

3. Error Correcting Codes

Lecture 29: MOSFET Small-Signal Amplifier Examples.

Wavelet Transform. CSEP 590 Data Compression Autumn Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual)

A Math Learning Center publication adapted and arranged by. EUGENE MAIER and LARRY LINNEN

VIII. Shell-Voicings

A study on the efficient compression algorithm of the voice/data integrated multiplexer

IV054 IV054 IV054 IV054 LITERATURE INTRODUCTION HISTORY OF CRYPTOGRAPHY

Final exam PS 30 December 2009

EECE 301 Signals & Systems Prof. Mark Fowler

Lecture 4: Frequency Reuse Concepts

MDM 4U MATH OF DATA MANAGEMENT FINAL EXAMINATION

PROJECT #2 GENERIC ROBOT SIMULATOR

HIGHER SECONDARY FIRST YEAR MATHEMATICS. ALGEBRA Creative Questions Time : 1.15 Hrs Marks : 45 Part - I Choose the correct answer 10 1 = 10.

Chapter 3 Digital Logic Structures

[MT93a, ALS94, Nie95, MNR95]. All these algorithms exploit kow characterizatios of extesios of default theories i terms of sets of geeratig defaults,

A New Design of Log-Periodic Dipole Array (LPDA) Antenna

Technical Explanation for Counters

Single Bit DACs in a Nutshell. Part I DAC Basics

H(X,Y) = H(X) + H(Y X)

11.11 Two-Channel Filter Banks 1/27

Name Class. Date Section. Test Form A Chapter Chapter 9 Infinite Series. 1 n 1 2 n 3n 1, n 1, 2, 3, Find the fourth term of the sequence

Compression Programs. Compression Outline. Multimedia. Lossless vs. Lossy. Encoding/Decoding. Analysis of Algorithms

Alignment in linear space

GENERALIZED FORM OF A 4X4 STRONGLY MAGIC SQUARE

Density Slicing Reference Manual

Subject Record (MARC21 format)

A SELECTIVE POINTER FORWARDING STRATEGY FOR LOCATION TRACKING IN PERSONAL COMMUNICATION SYSTEMS

信號與系統 Signals and Systems

Discrete Mathematics: Logic. Discrete Mathematics: Lecture 15: Counting

信號與系統 Signals and Systems

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

ELEC 350 Electronics I Fall 2014

ELEC 204 Digital Systems Design

A generalization of Eulerian numbers via rook placements

Transcription:

CS3203 #5 6/9/04 Jaak J Parekh

Admiistrivia Exam o Moday All slides should be up We ll try ad have solutios for HWs #1 ad #2 out by Friday I kow the HW is due o the same day; ot much I ca do, uless you guys would strogly prefer the midterm o Weds. Exam format

Coutig, product rule Logical extesio of algebraic defiitios we ve see Combiatorics is fudametal to may problems How may passwords ca a particular scheme have? Product rule: If a procedure ca be broke dow ito a sequece of two tasks, there are 1 2 ways of doig the combiatio. 1 AND 2 Ca geeralize for m tasks

Product rule examples There are three available flights from Idiaapolis to St. Louis ad, regardless of which of these flights is take, there are five available flights from St. Louis to Dallas. I how may ways ca a perso fly from Idiaapolis to St. Louis to Dallas? A certai type of push-butto door lock requires you to eter a code before the lock will ope. The lock has five buttos, umbered 1, 2, 3, 4 ad 5. If you must choose a etry code that cosists of a sequece of four digits, with repeated umbers allowed, how may etry codes are possible? If you must choose a etry code that cosists of a sequece of four digits, with o repeated digits allowed, how may etry codes are possible? If aswers are large, do t bother multiplyig them out

Sum rule If a first task ca be doe 1 ways ad a secod task i 2 ways, but they caot be doe at the same time, there are 1 + 2 ways of doig oe of these tasks. 1 or 2 Also ca geeralize for m Geerally ituitive A studet ca choose a computer project from oe of three lists. The three lists cotai 23, 15, ad 19 possible projects. How may possible projects are there to choose from?

Set equivaleces For fiite sets, cartesia product: A 1 A A = A A L 2 L m 1 2 A m Number of differet subsets of a fiite set, i.e., P(S) = 2 S. For disjoit sets, # of ways to choose a elemet from oe of the sets: A A + 1 2 L Am = A1 + A2 + L A m Commoality makes additio much harder

More complicated coutig problems Combie rules, ad be clever Fid the umber of strigs of legth 10 of letters of the alphabet with o repeated letters that cotai o vowels. 21. 20. 13. 12. that begi with a vowel. 5. 25 17 that have C ad V at the eds (i either order) Add the two subsets, each of which are 24. 23 18. 17. that have vowels i the first two positios. 5. 4. 24. 23 18. 17 Use slots ad diagram out!

Aother example Te me ad te wome are to stad i a row. Fid the umber of possible rows. 20*19* *1, or 20! Fid the umber of possible rows if o two people of the same sex stad adjacet. 10*10*9*9* *2*2*1*1 ways for MFMF ad double if you iclude FMFM Fid the umber of possible rows if Beryl, Carol, ad Darryl wat to stad ext to each other (i some order, such as Carol, Beryl, ad Darryl, or Darryl, Beryl, ad Carol). 3! possibilities for DCB Make them oe slot out of 18 18! possibilities, so 3!*18!

Iclusio-exclusio priciple Whe two tasks ca be doe at the same time, caot use the sum rule twice, as it duplicates the # of ways to do both tasks Istead, add the umber of ways to do each of the two tasks ad subtract the umber of ways to do both. Aki to uioig two odistict sets: A1 A2 = A1 + A2 A1 A2

Oe more example Fid the umber of strigs of legth 10 of letters of the alphabet with repeated letters allowed that cotai o vowels: 21 10 begi with a vowel: 5*26 9 have vowels i the first two positios: 5 2 *26 8 begi with C ad ed with V: 26 8 begi with C or ed with V: (2*26 9 ) 26 8 (i.e., subtract out the ad case)

Tree diagrams Useful way of drawig out possibilities But ot really practical for large cases Example: how may bit strigs of legth four do ot have two cosecutive oes? Aswer o page 309

Pigeohole priciple Extraordiarily simple cocept that s hard to visualize sometimes If k+1 or more objects are placed ito k boxes, the there is at least oe box cotaiig two or more of the objects. Souds very obvious, but I ay group of 27 Eglish words, there must be at least two that begi with the same letter. At least two of us are bor i the same seaso. At least two people i NYC have the same umber of hairs o their head. Prove that i ay group of three positive itegers, there are at least two whose sum is eve. Cosider two pigeoholes, labeled EVEN ad ODD. If three positive itegers are placed i these pigeoholes, oe of the pigeoholes must have at least two itegers (say a ad b) i it. Thus, a ad b are either both eve or both odd. I either case, a+b is eve.

Geeralized Pigeohole priciple If N objects are placed ito k boxes, the there is at least oe box cotaiig N/k objects. I a class of size 100, there are at least 9 who were bor i the same moth. How may cards must be selected from a stadard deck of 52 cards to guaratee that at least three cards of the same suit are chose? (9, sice 9/4 = 3) Each studet is classified as a member of oe of the followig classes: Freshma, Sophomore, Juior, Seior. Fid the miimum umber of studets who must be chose i order to guaratee that at least eight belog to the same class. (29) Numerous elegat applicatios; a few are listed i the book

Permutatios We ve approached this implicitly, but ow let s come up with some more precise defiitios. A permutatio of a set of distict objects is a ordered arragemet of these objects. If r elemets are to be ordered, r-permutatio. P(,r) = umber of r-permutatios of a set with distict elemets is = (-1)(-2) (-r+1). P(,) =! A class has 30 studets erolled. I how may ways ca four be put i a row for a picture? all 30 be put i a row for a picture? all 30 be put i two rows of 15 each (that is, a frot row ad a back row) for a picture? How may permutatios of ABCDEFGH cotai the strig ABC? ABC is oe possibility, DEFGH are possibilities. So arrage 6 items, or 6!. Fallig power otatio

Combiatios If orderig does t matter, the use combiatios Subsets Formula is C (, r)! r!( r)! Note secod otatio also called biomial coefficiet Note that P(,r) = C(,r) + P(r,r) i.e., applicatio of orderig. Also, C(,r) = C(,-r) Simple math Idea: whe orderig does t matter, who you keep i is equivalet to who you keep out C(,0) = C(,) = 1 = r =

Examples How may ways are there to select 5 players from a 10-member teis team to make a trip to a match at aother school? How may ways are there to choose a committee of size five cosistig of three wome ad two me from a group of te wome ad seve me? C(10,3) * C(7,2) = 2,520 How may ways ca you take a deck of cards ad Break them ito four equal piles A, B, C, D; C(52,13)*C(39,13)*C(26,13)*C(13,13) Four equal piles that are ot labeled Divide the previous oe by 4! (i.e., get rid of the labelig permutatios)

Biomial coefficiets r-combiatios occur as coefficiets i the expasio of powers of biomial expressios, such as (a+b). Biomial theorem: if x, y are variables ad is a oegative iteger = = + j j j y x j y x 0 ) ( y xy y x y x x + + + + + = 1 2 2 1 1 2 1 0 L

Examples What is the expasio of (x+y) 4? Write the expasio of (x+2y) 3. What is the coefficiet of a 17 b 23 i the expasio of (3a-7b) 40? C(40,23)3 17 (-7) 23

Corollaries Proof: just use x = 1, y = 1 Implies C(,0)+C(,2)+C(,4)+ = C(,1)+C(,3)+C(,5)+ Some other iterestig tidbits i the book = = k k 0 2 ( ) = = k k k 0 0 1

+ k Pascal s Idetity 1 = + k 1 Complete with idetities, ca be used to recursively defie biomial coefficiets less work tha calculatig factorial Ca therefore be used to form a triagle, where the th row cosists of coefficiets C(,k), k = 0, 1,, k

A few more idetities Vadermode s idetity Idea: two ways to select r elemets out of the uio of m i oe set ad i aother. Either literal uio (additio), or repeatedly pick k from the first set ad r-k from the secod set ad vary k (ad combie usig product rule). Corollary: = = k k 0 2 2 = = + r k k k r m r m 0

Geeralized permutatios ad combiatios Permutatios with repetitio How may strigs of legth ca be formed from the Eglish alphabet? r r-permutatios from objects Combiatios with repetitio C(+r-1, r) r-combiatios from a set with elemets whe repetitio is allowed How may ways to select 5 bills from a cash box cotaiig $1, $2, $5, $10, $20, $50, $100, where order does ot matter, ad that there are at least 5 idetical bills of each type = 7, r = 5, so C(11, 5) = 462

Aother example How may solutios does the equatio x 1 +x 2 +x 3 = 11 have, give x are oegative itegers? Select 11 items from a set with three elemets, i.e., x 1 items of type oe, x 2 items of type 2, x 3 items of type 3. So, 11- combiatios of 3 elemets with repetitio (i.e., ulimited umbers of those three elemets), i.e., C(13,11) = C(13, 2) = 78.

Bigger example A bakery sells four kids of cookies: chocolate, jelly, sugar, ad peaut butter. You wat to buy a bag of 30 cookies. Assumig that the bakery has at least 30 of each kid of cookie, how may bags of 30 cookies could you buy if you must choose: at least 3 chocolate cookies ad at least 6 peaut butter cookies. 21 udefied cookies of 4 types, so select 4 elemets i 21 combiatios, or C(24,21) = C(24,3) Note that it feels backwards but legit. Model as c+j+s+p = 21 if you prefer.

Cot d. exactly 3 chocolate cookies ad exactly 6 peaut butter cookies. = 2, r = 21 (oly variace is jelly vs. sugar), so C(22,21) = C(22,1) = 22. at most 5 sugar cookies. C(33,30) { umber of possible combiatios of all} C(27,24) { umber of possibilities with 6 sugar cookies } or C(33,3) - C(27,3) = 2,925 at least oe of each of the four types of cookies. = 4, r = 26, so C(29,26) = C(29,3) = 3,654

Permutatios with idistiguishable objects Ex: How may strigs ca be made by reorderig SUCCESS? Note that orderig matters, but ot amogst the three Ss ad two Cs. Need to combie multiple combiatios How may ways ca you choose three places to put the Ss amogst the 7 slots? C(7,3); P(7,3) would imply the three Ses have a differece. Similarly, C(4,2) for Cs after Ss have bee placed. U ca be placed i C(2,1) ways, ad E ca oly be placed i oe positio Ad : product rule aswer is 420.

Aother example A jar cotais 30 peies, 20 ickels, 20 dimes, ad 15 quarters. (The cois of each deomiatio are cosidered to be idetical.) Fid the umber of ways to put all 85 cois i a row. C(85,30)*C(55,20)*C(35,20)*1 Fid the umber of possible hadfuls of 12 cois. Sice we have more cois of each type tha 12, simply the previous class of problems (combiatios with repetitio), or C(15,12) = C(15,3) = 455. I how may ways ca 7 of the 8 letters i CHEMISTS be put i a row? Oly S idistiguished, but eed to cosider both cases where oe ad two Ses are kept C(7,2)*P(6,5) + C(7,1)*P(6,6) = 6*(7!/2!) + 7!

Easier way Where you have objects, with 1 istiguishable objects of type 1, 2 of type 2, etc. ca be represeted by!!! L 1 2 k! Similar to distributig distiguishable objects ito distiguishable boxes How may ways are there to distribute hads of 5 cards to each of four players from the stadard deck of 52 cards? C(52,5)C(47,5)C(42,5)C(37,5) = 52!/(5!*5!*5!*5!*32!) ote the leftover box

Lots of techiques! Trick is to figure out which oe Remember ad vs or for product vs sum rules Remember orderig for permutatios vs. combiatios For the rest, eed to apply some ituitio ad careful thought Lots of useful equatios o page 340-341

Next time Start chapter 5 probability Midterm