Counting Problems - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Counting, Counting Techniques, Pair of Dice, Number of Possible Schedules, Nested Loop, Inner Loop, Counting and Probability, Random Processes, Sample Space and Events, Finite Set, Example on Probability

Typology: Slides

2012/2013

Uploaded on 04/27/2013

ashwini
ashwini 🇮🇳

4.5

(18)

167 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE115/ENGR160 Discrete Mathematics
04/19/12
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Counting Problems - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

CSE115/ENGR160 Discrete Mathematics 04/19/

8.1 Recurrence relations

  • Many counting problems can be solved with recurrence relations
  • Example: The number of bacteria doubles every 2 hours. If a colony begins with 5 bacteria, how many will be present in n hours?
  • Let a (^) n =2a (^) n-1 where n is a positive integer with a 0 =

Recursion and recurrence

  • A recursive algorithm provides the solution of a problem of size n in terms of the solutions of one or more instances of the same problem of smaller size
  • When we analyze the complexity of a recursive algorithm, we obtain a recurrence relation that expresses the number of operations required to solve a problem of size n in terms of the number of operations required to solve the problem for one or more instance of smaller size

Example

  • Let {a (^) n } be a sequence that satisfies the recurrence relation a (^) n =a (^) n-1 – an-2 for n=2, 3, 4, … and suppose that a 0 =3 and a 1 =5, what are a (^2) and a 3?
  • Using the recurrence relation, a 2 =a 1 -a 0 =5-3= and a 3 =a 2 -a 1 =2-5=-

Modeling with recurrence relations

  • Compound interest: Suppose that a person deposits $10,000 in a savings account at a bank yielding 11% per year with interest compounded annually. How much will it be in the account after 30 years?
  • Let Pn denote the amount in the account after n years. The amount after n years equals the amount in the amount after n-1 years plus interest for the n-th year, we see the sequence {Pn } has the recurrence relation Pn =Pn-1+0.11Pn-1=(1.11)Pn-

Modeling with recurrence relations

  • The initial condition P 0 =10,000, thus
  • P 1 =(1.11)P 0
  • P 2 =(1.11)P 1 =(1.11) 2 P (^0)
  • P 3 =(1.11)P 2 =(1.11) 3 P (^0)
  • Pn =(1.11)Pn-1=(1.11)n^ P 0
  • We can use mathematical induction to establish its validity

8.2 Solving linear recurrence

relations

From mathematical induction

  • Theorem

Example

8.5 Inclusion-exclusion

  • The principle of inclusion-exclusion: For two sets A and B, the number of elements in the union is defined by |A⋃B|=|A|+|B|-|A⋂B|
  • Example: How many positive integers not exceeding 1000 are divisible by 7 or 11?

19

142 90 12 220

7 11

1000 11

1000 7

1000

| | | | | | | |

= + − =

    − ⋅   +    =

AB = A + BAB

Principle of inclusion-exclusion

  • Consider union of n sets, where n is a positive integer
  • Let n=

20

| ABC |=| A |+| B |+| C |−| AB |−| BC |−| CA |+| ABC |