Principles of Counting. Debdeep Mukhopadhyay IIT Madras

Similar documents
Binomial Coefficient Identities/Complements

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

Counting. Math 301. November 24, Dr. Nahid Sultana

CS 210 Foundations of Computer Science

Chapter 8 Sequences, Series, and Probability

{ 0! = 1 n! = n(n 1)!, n 1. n! =

Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting

What you learned in Math 28. Rosa C. Orellana

Number Theory and Counting Method. Divisors -Least common divisor -Greatest common multiple

An Introduction to Combinatorics

CS 2336 Discrete Mathematics

CS Foundations of Computing

2 - Strings and Binomial Coefficients

Lecture 4: Counting, Pigeonhole Principle, Permutations, Combinations Lecturer: Lale Özkahya

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

Counting. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

MATH 10B METHODS OF MATHEMATICS: CALCULUS, STATISTICS AND COMBINATORICS

Announcements. CSE 321 Discrete Structures. Counting. Counting Rules. Important cases of the Product Rule. Counting examples.

Numbers and their divisors

Notes. Combinatorics. Combinatorics II. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Counting. Spock's dilemma (Walls and mirrors) call it C(n,k) Rosen, Chapter 5.1, 5.2, 5.3 Walls and Mirrors, Chapter 3 10/11/12

Updated Jan SESSION 4 Permutations Combinations Polynomials

Discrete Mathematics, Spring 2004 Homework 4 Sample Solutions

AS1051: Mathematics. 0. Introduction

Algebra I. Book 2. Powered by...


The candidates are advised that they must always show their working, otherwise they will not be awarded full marks for their answers.

Math Fall Final Exam. Friday, 14 December Show all work for full credit. The problems are worth 6 points each.

Chapter 2 PROBABILITY SAMPLE SPACE

W3203 Discrete Mathema1cs. Coun1ng. Spring 2015 Instructor: Ilia Vovsha.

MULTI-RESTRAINED STIRLING NUMBERS

MATH 114 Fall 2004 Solutions to practice problems for Final Exam

Solution: There are 30 choices for the first person to leave, 29 for the second, etc. Thus this exodus can occur in. = P (30, 8) ways.

Counting with Categories and Binomial Coefficients

Combinatorics & Discrete Probability Theory

Counting Review R 1. R 3 receiver. sender R 4 R 2

The Basics: Twenty-Seven Problems

EXERCISE - 02 BRAIN TEASERS UNIT # 12 PERMUTATION & COMBINATION PERMUTATION & COMBINATION AND PROBABILITY EXERCISE - 01 CHECK YOUR GRASP

Logic. Facts (with proofs) CHAPTER 1. Definitions

UNCORRECTED SAMPLE PAGES. Extension 1. The binomial expansion and. Digital resources for this chapter

Math 461 B/C, Spring 2009 Midterm Exam 1 Solutions and Comments

1 Functions, relations, and infinite cardinality

PUTNAM PROBLEMS SEQUENCES, SERIES AND RECURRENCES. Notes

Topics in Combinatorics

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Jong C. Park Computer Science Division, KAIST

Mathematical Induction Assignments

Alg1CP Sem2 Review. Multiple Choice Identify the choice that best completes the statement or answers the question. 1. Simplify y 5 y 3.

Notes on counting. James Aspnes. December 13, 2010

Math Challengers Provincial 2016 Blitz and Bull s-eye rounds.

DISCRETE STRUCTURES AMIN WITNO

Combinatorics. But there are some standard techniques. That s what we ll be studying.

The Pigeonhole Principle

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

First Midterm Examination

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Text: Brualdi, Introductory Combinatorics 5th Ed. Prof: Paul Terwilliger Selected solutions II for Chapter 2

CS2800 Fall 2013 October 23, 2013

1 Functions, relations, and infinite cardinality

Sets. your school. A group of odd natural numbers less than 25.

Combinatorial Analysis

Permutations and Combinations

ASSIGNMENT Use mathematical induction to show that the sum of the cubes of three consecutive non-negative integers is divisible by 9.

132 CHAPTER 5. MODULE-WISE EXERCISES. Exercise for Module 1 Y X = {2,4,8}?

Counting Strategies: Inclusion-Exclusion, Categories

NATIONAL OPEN UNIVERSITY OF NIGERIA

Topic 3: Introduction to Probability

Rooks and Pascal s Triangle. shading in the first k squares of the diagonal running downwards to the right. We

Mathathon Round 1 (2 points each)

Statistical Inference

Basic Combinatorics. Math 40210, Section 01 Fall Homework 8 Solutions

SET THEORY. 1. Roster or Tabular form In this form the elements of the set are enclosed in curly braces { } after separating them by commas.

Tenth Bit Bank Mathematics Real Numbers

Revision papers for class VI

Algorithms: Background

3/15/2010 ENGR 200. Counting

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

6.5 Dividing Polynomials

Algebraic. techniques1

The solutions to the two examples above are the same.

UNC Charlotte 2004 Algebra with solutions

5.1 Modelling Polynomials

Probability. Part 1 - Basic Counting Principles. 1. References. (1) R. Durrett, The Essentials of Probability, Duxbury.

Section 1.1 Notes. Real Numbers

3. Coding theory 3.1. Basic concepts

Mark Scheme (Results) January 2007


Slides for a Course Based on the Text Discrete Mathematics & Its Applications (5 th Edition) by Kenneth H. Rosen

Some Review Problems for Exam 3: Solutions

1 The Basic Counting Principles

Introduction to Decision Sciences Lecture 11

Discrete Probability

Combinatorial Proofs and Algebraic Proofs I

Counting With Repetitions

MATH 310 Course Objectives

Evaluate algebraic expressions for given values of the variables.

The Inclusion Exclusion Principle

True/False. Math 10B with Professor Stankova Worksheet, Midterm #1; Friday, 2/16/2018 GSI name: Roy Zhao

AB ExamSolutions Texas A&M High School Math Contest November 8, 2014

Transcription:

Principles of Counting Debdeep Mukhopadhyay IIT Madras

Part-I

The Sum Rule Two tasks T 1 and T 2 are to be performed. If the task T 1 can be performed in m different ways and if the task T 2 can be performed in n different ways. The two tasks cannot be performed simultaneously, then one of the two tasks (T 1 or T 2 ) can be performed in m+n ways. This can be generalised to k tasks.

Examples Suppose there are 16 boys and 18 girls in a class. We wish to select one of these students (either a boy or a girl) as the class representative. The number of ways of selecting a student (boy or girl) is 16+18=34. Suppose a library has 12 books on Mathematics, 10 books on Physics, 16 books on Computer Sc and 11 books on Electronics. Suppose a student wishes to choose one of the books for study. He can do that in 12+10+16+11=49 ways.

Examples Suppose T 1 is the task of selecting a prime number less than 10. T 2 is say the task of selecting an even number less than 10. Thus T 1 =4 and T 2 =4. The task T of selecting a prime or even number less than 10 is 4+4-1=7 (why did we subtract 1?)

The Product Rule Suppose two tasks T 1 and T 2 are to be performed one after the other. If T 1 can be performed in n 1 different ways and for each of these ways T 2 can be performed in n 2 different ways, then both the tasks can be performed in n 1 n 2 different ways.

Examples A person has 3 shirts and 5 ties. Then he has 3 χ 5 different ways of choosing a tie and a shirt. Suppose we wish to construct a password of 4 symbols: first two alphabets and last two being numbers. The total number of passwords is: 26x25x10x9 (wo repetitions) 26 2 x10 2 (with repetitions)

Examples Suppose a restaurant sells 6 South Indian dishes, 4 North Indian dishes, 3 hot and 4 cold beverages. If a student wants a breakfast which comprises of 1 South Indian dish and 1 hot beverage or 1 North Indian dish and 1 cold beverage, the total number of ways in which he chooses his breakfast is: 6x3+4x4 ways. (apply both the sum and product rules).

Examples A telegraph can transmit two different signals: a dot and a slash. What length of those symbols is needed to encode 26 letters of the English alphabet and 10 digits. Number k length sequences is 2 k. So, the number of non-trivial sequences of length n or less is: 2+2 2 +2 3 + +2 n =2 n+1-2 36 => n 5.

Examples Find the number of 3 digit even numbers with no repetition in digits. Let the number be xyz. z can be 0, 2, 4, 6, 8 If z is 0, x cannot be 0, so it could be any of the 9 digits. y can be any of the 8 digits. So, there are 1x9x8=72 ways. If z is not 0, x cannot be either 0 or the value which z has taken. So, there are 8 choices for z. There are still 8 choices for y and hence there are 4x8x8=256 ways. Thus there are in total 72+256=328 ways (note that the choices are distinct and so we may apply the sum rule of counting).

Examples How many among the first 100,000 positive integers contain exactly one 3, one 4 and one 5 in their decimal representation. Answer is 5x4x3x7x7=2940.

Examples Find the number of proper divisors of 441000. 441000=2 3 3 2 5 3 7 2. Number of divisors are : (3+1)(2+1)(3+1)(2+1)=144. If we subtract 2 cases, for the divisors 1 and the number itself, we have 142 as the answer.

Permutations In some counting problems, order is important. Suppose we are given n distinct objects and we wish to arrange r of them in line. Since there are n ways of choosing the 1 st object, then (n-1) ways of choosing the 2 nd object and similarly the r th object may be chosen in (n-r+1) ways. Thus the total number of ways of choosing is: n(n-1) (n-r+1)=(n!)/(n-r)!=p(n,r) The number of different arrangements of n distinct objects is P(n,n)=n! It Is also called the permutation of n distinct objects.

Handling multisets The objects in a multiset may not be distinct (as in a set). Suppose we are required to find the arrangement of n objects of which n 1 are of one type, n 2 are of some other type and so on till n k are of the k th type=> n 1 +n 2 + n k =n. Then the number of permutations of the n objects is: P(n,(n 1,n 2,,n k ))=(n!)/(n 1!n 2!...n k!)

Example How many positive integers n can we form using the digits 3, 4, 4, 5, 5, 6, 7 if we wish to exceed 5,00,000? The number is of the form : x 1 x 2 x 3 x 4 x 5 x 6 x 1 can be either 5, 6, 7. When x 1 =5, the remaining 5 digits have to be a permutation of digits from the multiset containing, 1(5),1(3),2(4),1(6) and 1(7). Thus the number of arrangements are: 5!/2! Answer is (5!/2!)+(5!/2! 2 )+(5!/2! 2 ).

Example In how many ways can n persons be seated at a round table if arrangements are considered the same when one can be obtained from the other by rotation? Let one of them be seated anywhere. The other (n-1) persons can be seated in (n-1)! ways. Thus the answer is (n-1)! ways. Can you tell what is the difference between a linear and a circular arrangement?

Examples Find the total number of positive integers that can be formed from the digits 1,2,3 and 4 if no digits are repeated in one integer. Note that the integer cannot contain more than 4 digits. Let it contain 1 digit. No of such numbers=4

Examples Let it contain 2 digits. No of such numbers=4x3=12. No of 3 digit integers=4x3x2=24 No of 4 digit integers=4x3x2x1=24 Hence the total number of numbers=4+12+24+24=64.

Examples on Divisibility If k is a positive integer, and n=2k, prove that (n!)/2 k is a positive integers. Consider symbols: x 1,x 1,x 2,x 2,,x k,x k. The total number of symbols is 2k and there are k partitions of cardinality 2 each. So, the total number of arrangements in the multi-set: (2k)!/(2!2!...2!)=(2k)!/(2) k. Thus, 2 k (2k)!.

Another example Prove that (n!)! is divisible by (n!) (n-1)! Set N=n! (n-1)!=n!/n=n/n. Thus we can consider a collection of N objects, which has (n-1)! partitions of cardinality n each. The number of arrangements is N!/(n!...n!)=N!/(n!) (n-1)!. Thus, (n!) (n-1)! divides N!

Combinations Suppose, we are selecting (choosing) a set of r objects, from a set of n r objects without regard to order. The set of r objects being selected is traditionally called combination of r objects.

Relating to Permutations Let C(n,r) be the combination of r distinct objects that can be selected from n different objects. The r objects chosen may be arranged in r! different ways. Thus, the total number of arrangements of the r objects chosen from the n distinct objects=c(n,r)r!=p(n,r) Thus C(n,r)=P(n,r)/r! Note that C(n,r)=C(n,n-r)

Examples How many committees of five with a given chairperson can be selected from 12 persons? Select the given chairperson. Select the remaining 4 members from the 11 persons (excluding the chairperson). Answer is C(11,4)

Examples Find the number of committees of 5 that can be selected from 7 men and 5 women if the committee is to consist of at least 1 man and 1 woman. Without restriction: C(12,5) Selections with 5 men: C(7,5) Selections with 5 women: C(5,5) Answer is C(12,5)-C(7,5)-C(5,5).

Examples Find the number of 5 digit positive integers such that in each of them every digit is greater than the digit to the right. A set of 5 distinct digits can be selected in C(10,5) ways. Of the digits selected there is only 1 arrangement, namely the descending order which is what we require. So, answer is 1xC(10,5).

Examples Find the number of ways of seating r out of n persons around a circular table and the others around another circular table. Answer is C(n,r)(r-1)! x (n-r-1)!

Examples Find the number of arrangements of the letters in TALLAHASSEE which have no adjacent A s. The A s have to be placed in the dashes: T L L H S S E E The number of possible arrangements of the remaining letters is M=8!/(2!) 3. The dashes can be filled in N=C(9,3). Thus, the total number of arrangements=mn

Example How many arrangements are possible for 11 players, such that the batting order among A, B and C is A <<B<< C. Soln 1: Fix A in posn 1, B in posn 2. C can come in 9 places. Move B to 3, C can come in 8 places so on till 1. Thus, there are 9x10/2 ways. Move A to posn 2, there are 8x9/2 ways. A can be in 9 positions, from 1 to 9. The other 8 players may be arranged in 8! ways.

Thus there are in total: 8!Σk(k+1)/2, where k runs from 1 to 9. Soln2: There are 11 places. Select 3 positions for A, B and C. This can be done in C(11,3) ways. Of each selection there is only way which satisfies the ordering. The other places can be arranged in 8! ways.

Example Thus, there are in total C(11,3)x8! ways. Thus the result is 11!/3! Can you explain the answer in some other way?

Pascals Triangle Pascals formula: n n 1 n 1 = + k k k 1 Proof is simple: LHS is no of ways of selecting k distinct objects from n distinct objects. We can treat the problem in two mutually disjoint ways: A (in which an object say x is always selected). This can be done in C(n-1,r-1) ways. B (in which the object x is never selected). This can be done in C(n- 1,r) ways. The proof follows from the sum rule.

Illustration of the proof n=5, k=3, S={x,a,b,c,d} A={(x,a,b),(x,a,c),(x,a,d),(x,b,c),(x,b,d),(x,c,d)}. Upon deleting x we obtain the number of possible ways of selecting 2 distinct objects from 4 distinct objects, C(4,2). B={(a,b,c),(a,b,d),(a,c,d),(b,c,d)}. The number of possible ways of selecting 3 distinct objects from 4 distinct objects, C(4,3). Thus result is C(4,2)+C(4,3) from the sum rule. This is equal to C(5,3).

Binomial Theorem Binomial Theorem for a positive integer n: n n n r n r ( x+ y) = x y r= 0 r The coefficients of x r y n-r is called the binomial coefficient.

Computing Binomial Coefficients without Computing factorials n/k 0 1 2 3 4 0 1 1 1 1 2 1 2 1 3 1 3 3 1 4 1 4 6 4 1

Another way of looking Define paths in the triangle with moves which are either vertically downward or which are diagonally to the right. Let Pth(n,k) be the number of paths from the entry C(0,0) to the entry C(n,k)

Another way of looking Pth(0,0)=1, Pth(n,0)=1, Pth(n,n)=1 For k<n, Pth(n,k)=Pth(n-1,k-1)+Pth(n-1,k) Thus we have the same recurrence relation and the same initial conditions as C(n,r). Thus, Pth(n,r)=C(n,r)

Multinomial Theorem For positive integers n and t, the coefficients of n!/(n 1!n 2!...n t!) in the expansion of ( x + x + x +... x ) n t is: n1 n2 n3 nt x1 x2 x3... xt 1 2 3

Combinations of multisets Let S be a multiset with objects of k types, each with an infinite repetition number. Then the number of r combinations is equal to C(r+k-1,k-1)=C(r+k-1,r) Proof Outline: The multiset is { (a1), (a2),, (ak)}. Any r combination can be represented as the multiset {x1(a1),x2(a2), xk(ak)} st. x1+x2+ +xk=r. We require integral solutions to the above equations.

Combinations of multisets 12 r We have to divide the line into k subparts. Add k-1 stickers labeled as *. Thus we have (r+k-1) distinct objects. Select (k-1) objects from them. Each selection will correspond to one such division. Thus, we have C(r+k-1,k-1) ways.

Examples A bakery boasts 8 varieties of doughnuts. If a box contains a dozen, how many boxes can you buy? Thus the bakery has 8 varieties, with a (possibly) large number of each. Select 12 dougnuts, with repetitions of a variety. Thus, we have C(12+8-1,8-1)=C(12+8-1,12).