Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Counting and Recurrence Relations, Summaries of Mathematics

The basics of counting principles, including the product rule, sum rule, and inclusion-exclusion principle. It also introduces recurrence relations, which are used to model and solve various counting problems. Divide-and-conquer algorithms and their relationship to recurrence relations, as well as theorems like the master theorem that can be used to analyze the complexity of recurrence relations. The content covers a range of examples and exercises related to counting bit strings, password generation, team selection, and more. This comprehensive overview of counting techniques and recurrence relations would be valuable for students studying discrete mathematics, algorithms, and related fields.

Typology: Summaries

2021/2022

Uploaded on 09/30/2022

lie-white
lie-white 🇻🇳

1 document

1 / 55

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 5 & 7
Counting
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37

Partial preview of the text

Download Counting and Recurrence Relations and more Summaries Mathematics in PDF only on Docsity!

Chapter 5 & 7

Counting

Objectives

Some questions we can face:

  • (^) “How can we determine the complexity of an algorithm?”
  • (^) “How can we generate input data from given initial data?”
  • (^) A password consists of six characters. How many such password with some criteria?
  • (^) How many bit strings of length n that do not have two consecutive 0s?

5.1- The Basics of Counting

 Basic Counting Principles : Product rule, sum rule, The Inclusion-Exclusion Principle  Tree Diagrams

Basic Counting Principle Ex1: How many ways are there to distribute 3 distinct balls to 2 bags? Solution: We must do ……….. times, each time we have …… ways to select a bags. There are r n ways to distribute n distinct objects to r bags

Basic Counting Principle I II III Select 1/ 12  12 ways After select 1 team for the first position, one of 11 teams can be select into the second team  11 ways After select 1 team for the second position, one of 10 remaining teams can be select into the third team  10 ways Ex3: 12 teams. How many ways to select 3 teams for the first, second and third teams. Answer:

Ex4: Choose a 6 – character password: ****** (Note:

  • can be 0,…,9, a,…,z, A,…Z) How many possible passwords? Answer:

Ex6: How many functions are there from {a, b} to {2, 3, 5}? Answer: Ex7: How many one-to-one functions are there from a set with m elements to one with n elements? Answer:

Ex8: a. How many positive divisors does 120 have? Answer: b. In how many ways can a teacher seat 4 girls and 3 boys in a row seats if a boy must be seated in the first and a girl in the last seat? Answer:

Ex10: There are 37 faculties, 83 students. A person either a faculty or student can be choose to attend a committee. How many ways are there to select such person? Answer:

Ex11: A student can choose a project from one of three field: Information system: 32 projects Software Engineering: 12 projects Computer Science: 15 projects. How many ways are there for a student to choose? Answer:

Basic Counting Principles… Ex12: Name of a variable in BASIC language, a case insensitive language, is a string of 1 or 2 characters in which the first must be a letter, the second may be an alphanumeric characters, and must be different from 5 two-character keywords. How many different variable names are there?

Basic Counting Principles… Ex13: Each user on a computer system has a password, which has properties:

  • Six to eight characters long
  • Character is a letter or a digit
  • Contain at least one digit. How many possible passwords are there?

Basic Counting Principles: The Inclusion-Exclusion Principle Ex14: How many 7-bit strings either start with 1 or end with 00?

Basic Counting Principles: The Inclusion-Exclusion Principle Ex15: 350 applications, in which A1: 220 people majored in IT A2: 147 people majored in business A3: 51 people majored both in IT and business How many applicants majored neither in IT nor business?