尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
Functions
18 Oct 2011
A B
f( ) =
This Lecture
We will define what is a function formally, and then
in the next lecture we will use this concept in counting.
We will also study the pigeonhole principle and its applications.
• Examples and definitions (injection, surjection, bijection)
• Pigeonhole principle and applications
Functions
function, f, from set A to set B
associates an element , with an element
:f A B→
( )f a B∈ .a A∈
The domain of f is A.
The codomain of f is B.
Definition: For every input there is exactly one output.
Functions
domain = R
codomain = R+
-{0}
domain = R+
-{0}
codomain = R
domain = R
codomain = [0,1]
domain = R+
codomain = R+
Functions
f(S) = |S|
f(string) = length(string)
f(student-name) = student-ID
f(x) = is-prime(x)
domain = the set of all sets
codomain = non-negative integers
domain = the set of all strings
codomain = non-negative integers
domain = positive integers
codomain = {T,F}
not a function,
since one input could have
more than one output
[two students may have same name]
≤ 1 arrow in
A B
f( ) =
Injections (One-to-One)
is an injection iff no two inputs have the same output.:f A B→
, .
( ( ) ( ')) ( ')
′∀ ∈
= → =
a a A
f a f a a a |A| ≤ |B|
Surjections (Onto)
A B
1 arrow in
is a surjection iff every output is possible.:f A B→
f( ) =
. ( )b B a A f a b∀ ∈ ∃ ∈ = |A| ≥ |B|
Bijections
A B
is a bijection iff it is surjection and injection.:f A B→
f( ) =
exactly one arrow in
|A| = |B|
Function Domain Codomain Injective? Surjective
?
Bijective?
f(x)=sin(x) Real Real
f(x)=2x
Real Positive
real
f(x)=x2
Real Non-
negative
real
Reverse
string
Bit strings
of length n
Bit strings
of length n
Exercises
Whether a function is injective, surjective, bijective
depends on its domain and the codomain.
Inverse Sets
A B
Given an element y in B, the inverse set of y := f-1
(y) = {x in A | f(x) = y}.
Inverse Function
A B
f( ) =
exactly one arrow in
Informally, an inverse function f-1
is to “undo” the operation of function f.
There is an inverse function f-1
for f if and only if f is a bijection.
Inverse Function
A B
f( ) =
exactly one arrow in
Informally, an inverse function f-1
is to “undo” the operation of function f.
There is an inverse function f-1
for f if and only if f is a bijection.
Composition of Functions
Two functions f:X->Y’, g:Y->Z so that Y’ is a subset of Y,
then the composition of f and g is the function g 。 f: X->Z, where
g 。 f(x) = g(f(x)).
X
Y
Z
Y’f g
Function f Function g g 。 f
injective?
g 。 f
surjective?
g 。 f
bijective?
f:X->Y
f surjective
g:Y->Z
g injective
f:X->Y
f surjective
g:Y->Z
g surjective
f:X->Y
f injective
g:Y->Z
g surjective
f:X->Y
f bijective
g:Y->Z
g bijective
f:X->Y f-1
:Y->X
Exercises
This Lecture
• Examples and definitions (injection, surjection, bijection)
• Pigeonhole principle and applications
If more pigeons
than pigeonholes,
Pigeonhole Principle
Pigeonhole Principle
then some hole must have at least two pigeons!
Pigeonhole principle
A function from a larger set to a smaller set cannot be injective.
(There must be at least two elements in the domain that have
the same image in the codomain.)
Example 1
Question: Let A = {1,2,3,4,5,6,7,8}
If five integers are selected from A,
must a pair of integers have a sum of 9?
Consider the pairs {1,8}, {2,7}, {3,6}, {4,5}.
The sum of each pair is equal to 9.
If we choose 5 numbers from this set,
then by the pigeonhole principle,
both elements of some pair will be chosen,
and their sum is equal to 9.
Example 2
Question: In a party of n people, is it always true that there are
two people shaking hands with the same number of people?
Everyone can shake hand with 0 to n-1 people, and there are n people,
and so it does not seem that it must be the case, but think about it carefully:
Case 1: if there is a person who does not shake hand with others,
then any person can shake hands with at most n-2 people,
and so everyone shakes hand with 0 to n-2 people,
0 to n-2 => n-1 possible values (i.e., cardinality of codomain = n-1)
There are n people (i.e., cardinality of domain = n)
so
the answer is “yes” by the pigeonhole principle.
Example 2
Question: In a party of n people, is it always true that there are
two people shaking hands with the same number of people?
Everyone can shake hand with 0 to n-1 people, and there are n people,
and so it does not seem that it must be the case, but think about it carefully:
Case 2: if everyone shakes hand with at least one person, then
any person shakes hand with 1 to n-1 people,
1 to n-1 => n-1 possible values (i.e., cardinality of codomain = n-1)
There are n people (i.e., cardinality of domain = n)
so
the answer is “yes” by the pigeonhole principle.
Birthday Paradox
In a group of 367 people, there must be two people having the same birthday.
Suppose n <= 365, what is the probability that in a random set of n people,
some pair of them will have the same birthday?
We can think of it as picking n random numbers from 1 to 365 without repetition.
There are 365n
ways of picking n numbers from 1 to 365.
[You have 365 choices to pick the first one, same for the second and so on…]
There are 365·364·363·…·(365-n+1) ways of picking n numbers from 1 to 365
without repetition.
[You have 365 choices to pick the first one, 364 for the second and so on…]
So the probability that no pairs have the same birthday is
equal to 365·364·363·…·(365-n+1) / 365n
This is smaller than 50% for 23 people, smaller than 1% for 57 people.
Generalized Pigeonhole Principle
If n pigeons and h holes,
then some hole has at least
n
h
 
  
pigeons.
Generalized Pigeonhole Principle
Cannot have < 3 cards in every hole.
♠ ♥ ♣ ♦
Subset Sum
Two different subsets of the 90 25-digit numbers shown above have the same sum.
Subset Sum
90 numbers, each with at most 25 digits.
So the total sum is at most 90x1025
Let A be the set of all subsets of the 90 numbers.
Let B be the set of integers from 0 to 90x1025
.
(pigeons)
(pigeonholes)
By pigeonhole principle, there are two different subsets with the same sum.
Club vs Strangers
Theorem: Every collection of 6 people includes a club of 3 people,
or a group of 3 strangers.
Let’s agree that given any two people, either they have met or not.
If every people in a group has met, then we’ll call the group a club.
If every people in a group has not met, then we’ll call a group of strangers.
Let x be one of the six people.
By the (generalized) pigeonhole principle, we have the following claim.
Claim: Among the remaining 5 people, either 3 of them have met x,
or 3 of them have not met x.
Club vs Strangers
Theorem: Every collection of 6 people includes a club of 3 people,
or a group of 3 strangers.
Claim: Among the remaining 5 people, either 3 of them have met x,
or 3 of them have not met x.
Case 1: “3 people have met x”
Case 1.1: No pair among those people met each other.
Then there is a group of 3 strangers.
OK!
Case 1.2: Some pair among those people have met each other.
Then that pair, together with x, form a club of 3 people.
OK!
Club vs Strangers
Theorem: Every collection of 6 people includes a club of 3 people,
or a group of 3 strangers.
Claim: Among the remaining 5 people, either 3 of them have met x,
or 3 of them have not met x.
Case 2: “3 people have not met x”
Case 2.1: Every pair among those people met each other.
Then there is a club of 3 people.
OK!
Case 2.2: Some pair among those people have not met each other.
Then that pair, together with x, form a group of 3 strangers.
OK!
Quick Summary
Make sure you understand basic definitions of functions.
These will be used in the next lecture for counting.
The pigeonhole principle is very simple,
but there are many clever uses of it to prove non-trivial results.

More Related Content

What's hot

3.1 higher derivatives
3.1 higher derivatives3.1 higher derivatives
3.1 higher derivatives
math265
 
4.6 radical equations
4.6 radical equations4.6 radical equations
4.6 radical equations
math123b
 
50 solving equations by factoring
50 solving equations by factoring50 solving equations by factoring
50 solving equations by factoring
alg1testreview
 
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program CorrectnessCMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
allyn joy calcaben
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
allyn joy calcaben
 
2 1 expressions
2 1 expressions2 1 expressions
2 1 expressions
math123a
 
4 1exponents
4 1exponents4 1exponents
4 1exponents
math123a
 
2 2linear equations i
2 2linear equations i2 2linear equations i
2 2linear equations i
math123a
 
6.1 system of linear equations and matrices
6.1 system of linear equations and matrices6.1 system of linear equations and matrices
6.1 system of linear equations and matrices
math260
 
49 factoring trinomials the ac method and making lists
49 factoring trinomials  the ac method and making lists49 factoring trinomials  the ac method and making lists
49 factoring trinomials the ac method and making lists
alg1testreview
 
1 4 cancellation
1 4 cancellation1 4 cancellation
1 4 cancellation
math123b
 
4.3 system of linear equations 1
4.3 system of linear equations 14.3 system of linear equations 1
4.3 system of linear equations 1
math123c
 
Maths 11
Maths 11Maths 11
Maths 11
Mehtab Rai
 
24 variables and evaluation
24 variables and evaluation24 variables and evaluation
24 variables and evaluation
alg1testreview
 
Ppt on polynomial
Ppt on polynomial Ppt on polynomial
Ppt on polynomial
Prakash Thapliyal
 
Higher order derivatives
Higher order derivativesHigher order derivatives
Higher order derivatives
Padme Amidala
 
Polynomials CLASS 10
Polynomials CLASS 10Polynomials CLASS 10
Polynomials CLASS 10
Nihas Nichu
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
DUBAN CASTRO
 
Factor theorem
Factor theoremFactor theorem
Factor theorem
Department of Education
 
Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)
Matthew Leingang
 

What's hot (20)

3.1 higher derivatives
3.1 higher derivatives3.1 higher derivatives
3.1 higher derivatives
 
4.6 radical equations
4.6 radical equations4.6 radical equations
4.6 radical equations
 
50 solving equations by factoring
50 solving equations by factoring50 solving equations by factoring
50 solving equations by factoring
 
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program CorrectnessCMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctness
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
 
2 1 expressions
2 1 expressions2 1 expressions
2 1 expressions
 
4 1exponents
4 1exponents4 1exponents
4 1exponents
 
2 2linear equations i
2 2linear equations i2 2linear equations i
2 2linear equations i
 
6.1 system of linear equations and matrices
6.1 system of linear equations and matrices6.1 system of linear equations and matrices
6.1 system of linear equations and matrices
 
49 factoring trinomials the ac method and making lists
49 factoring trinomials  the ac method and making lists49 factoring trinomials  the ac method and making lists
49 factoring trinomials the ac method and making lists
 
1 4 cancellation
1 4 cancellation1 4 cancellation
1 4 cancellation
 
4.3 system of linear equations 1
4.3 system of linear equations 14.3 system of linear equations 1
4.3 system of linear equations 1
 
Maths 11
Maths 11Maths 11
Maths 11
 
24 variables and evaluation
24 variables and evaluation24 variables and evaluation
24 variables and evaluation
 
Ppt on polynomial
Ppt on polynomial Ppt on polynomial
Ppt on polynomial
 
Higher order derivatives
Higher order derivativesHigher order derivatives
Higher order derivatives
 
Polynomials CLASS 10
Polynomials CLASS 10Polynomials CLASS 10
Polynomials CLASS 10
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
 
Factor theorem
Factor theoremFactor theorem
Factor theorem
 
Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)Lesson 5: Continuity (slides)
Lesson 5: Continuity (slides)
 

Similar to L07 msr

Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Matthew Leingang
 
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Mel Anthony Pepito
 
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
ghghghg3
 
5.7 Interactive Classroom Roots and Zeros.ppt
5.7 Interactive Classroom Roots and Zeros.ppt5.7 Interactive Classroom Roots and Zeros.ppt
5.7 Interactive Classroom Roots and Zeros.ppt
AARow1
 
Quantification
QuantificationQuantification
Quantification
Abdur Rehman
 
Fundamentals of AlgebraChu v. NguyenIntegral Exponents
Fundamentals of AlgebraChu v. NguyenIntegral ExponentsFundamentals of AlgebraChu v. NguyenIntegral Exponents
Fundamentals of AlgebraChu v. NguyenIntegral Exponents
DustiBuckner14
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
Shashindra Silva
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
Statistics Homework Helper
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
Shashindra Silva
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
Shashindra Silva
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Matthew Leingang
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Mel Anthony Pepito
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
Excel Homework Help
 
Lesson 25: Indeterminate Forms and L'Hôpital's Rule
Lesson 25: Indeterminate Forms and L'Hôpital's RuleLesson 25: Indeterminate Forms and L'Hôpital's Rule
Lesson 25: Indeterminate Forms and L'Hôpital's Rule
Matthew Leingang
 
Chapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.docChapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.doc
Desalechali1
 
5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions
smiller5
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebra
lucysolischar
 
Probability Assignment Help
Probability Assignment HelpProbability Assignment Help
Probability Assignment Help
Statistics Assignment Help
 
Number theory
Number theoryNumber theory
Number theory
Litty Cherian
 
Number theory.ppt22
Number theory.ppt22Number theory.ppt22
Number theory.ppt22
teena zacharias
 

Similar to L07 msr (20)

Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
 
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
Lesson 17: Indeterminate forms and l'Hôpital's Rule (slides)
 
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
9+&+10+English+_+Class+09+CBSE+2020+_Formula+Cheat+Sheet+_+Number+System+&+Po...
 
5.7 Interactive Classroom Roots and Zeros.ppt
5.7 Interactive Classroom Roots and Zeros.ppt5.7 Interactive Classroom Roots and Zeros.ppt
5.7 Interactive Classroom Roots and Zeros.ppt
 
Quantification
QuantificationQuantification
Quantification
 
Fundamentals of AlgebraChu v. NguyenIntegral Exponents
Fundamentals of AlgebraChu v. NguyenIntegral ExponentsFundamentals of AlgebraChu v. NguyenIntegral Exponents
Fundamentals of AlgebraChu v. NguyenIntegral Exponents
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
 
Pigeon hole principle
Pigeon hole principlePigeon hole principle
Pigeon hole principle
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
 
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
Lesson 14: Derivatives of Logarithmic and Exponential Functions (slides)
 
Mathematical Statistics Homework Help
Mathematical Statistics Homework HelpMathematical Statistics Homework Help
Mathematical Statistics Homework Help
 
Lesson 25: Indeterminate Forms and L'Hôpital's Rule
Lesson 25: Indeterminate Forms and L'Hôpital's RuleLesson 25: Indeterminate Forms and L'Hôpital's Rule
Lesson 25: Indeterminate Forms and L'Hôpital's Rule
 
Chapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.docChapter-6-Random Variables & Probability distributions-3.doc
Chapter-6-Random Variables & Probability distributions-3.doc
 
5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebra
 
Probability Assignment Help
Probability Assignment HelpProbability Assignment Help
Probability Assignment Help
 
Number theory
Number theoryNumber theory
Number theory
 
Number theory.ppt22
Number theory.ppt22Number theory.ppt22
Number theory.ppt22
 

More from Maruf Hamidi

6. User Interface
6. User Interface6. User Interface
6. User Interface
Maruf Hamidi
 
5. Entity-Relationship Diagram
5. Entity-Relationship Diagram5. Entity-Relationship Diagram
5. Entity-Relationship Diagram
Maruf Hamidi
 
4 Sequence Activity
4 Sequence Activity4 Sequence Activity
4 Sequence Activity
Maruf Hamidi
 
3. Collaboration
3. Collaboration3. Collaboration
3. Collaboration
Maruf Hamidi
 
2. Use Case Analysis
2. Use Case Analysis2. Use Case Analysis
2. Use Case Analysis
Maruf Hamidi
 
1. ISD Project Plan
1. ISD Project Plan1. ISD Project Plan
1. ISD Project Plan
Maruf Hamidi
 
BTCL Data Internet
BTCL Data InternetBTCL Data Internet
BTCL Data Internet
Maruf Hamidi
 

More from Maruf Hamidi (7)

6. User Interface
6. User Interface6. User Interface
6. User Interface
 
5. Entity-Relationship Diagram
5. Entity-Relationship Diagram5. Entity-Relationship Diagram
5. Entity-Relationship Diagram
 
4 Sequence Activity
4 Sequence Activity4 Sequence Activity
4 Sequence Activity
 
3. Collaboration
3. Collaboration3. Collaboration
3. Collaboration
 
2. Use Case Analysis
2. Use Case Analysis2. Use Case Analysis
2. Use Case Analysis
 
1. ISD Project Plan
1. ISD Project Plan1. ISD Project Plan
1. ISD Project Plan
 
BTCL Data Internet
BTCL Data InternetBTCL Data Internet
BTCL Data Internet
 

Recently uploaded

Basic principle and types Static Relays ppt
Basic principle and  types  Static Relays pptBasic principle and  types  Static Relays ppt
Basic principle and types Static Relays ppt
Sri Ramakrishna Institute of Technology
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
Kamal Acharya
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
dABGO KI CITy kUSHINAGAR Ak47
 
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
hotchicksescort
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
yogita singh$A17
 
Covid Management System Project Report.pdf
Covid Management System Project Report.pdfCovid Management System Project Report.pdf
Covid Management System Project Report.pdf
Kamal Acharya
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book NowKandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
SONALI Batra $A12
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
AK47
 
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
sexytaniya455
 
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 MinutesCall Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
kamka4105
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
sathishkumars808912
 
Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
Kamal Acharya
 
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptxMODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
NaveenNaveen726446
 
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
dulbh kashyap
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
ssuser381403
 
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
sonamrawat5631
 

Recently uploaded (20)

Basic principle and types Static Relays ppt
Basic principle and  types  Static Relays pptBasic principle and  types  Static Relays ppt
Basic principle and types Static Relays ppt
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
 
Cricket management system ptoject report.pdf
Cricket management system ptoject report.pdfCricket management system ptoject report.pdf
Cricket management system ptoject report.pdf
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
 
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
❣Unsatisfied Bhabhi Call Girls Surat 💯Call Us 🔝 7014168258 🔝💃Independent Sura...
 
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl LucknowCall Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
Call Girls In Lucknow 🔥 +91-7014168258🔥High Profile Call Girl Lucknow
 
Covid Management System Project Report.pdf
Covid Management System Project Report.pdfCovid Management System Project Report.pdf
Covid Management System Project Report.pdf
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book NowKandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
Kandivali Call Girls ☑ +91-9967584737 ☑ Available Hot Girls Aunty Book Now
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
 
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
Call Girls Nagpur 8824825030 Escort In Nagpur service 24X7
 
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 MinutesCall Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
Call Girls In Tiruppur 👯‍♀️ 7339748667 🔥 Free Home Delivery Within 30 Minutes
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
 
Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
 
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptxMODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
MODULE 5 BIOLOGY FOR ENGINEERS TRENDS IN BIO ENGINEERING.pptx
 
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
🚺ANJALI MEHTA High Profile Call Girls Ahmedabad 💯Call Us 🔝 9352988975 🔝💃Top C...
 
Microsoft Azure AD architecture and features
Microsoft Azure AD architecture and featuresMicrosoft Azure AD architecture and features
Microsoft Azure AD architecture and features
 
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
🔥Young College Call Girls Chandigarh 💯Call Us 🔝 7737669865 🔝💃Independent Chan...
 

L07 msr

  • 2. This Lecture We will define what is a function formally, and then in the next lecture we will use this concept in counting. We will also study the pigeonhole principle and its applications. • Examples and definitions (injection, surjection, bijection) • Pigeonhole principle and applications
  • 3. Functions function, f, from set A to set B associates an element , with an element :f A B→ ( )f a B∈ .a A∈ The domain of f is A. The codomain of f is B. Definition: For every input there is exactly one output.
  • 4. Functions domain = R codomain = R+ -{0} domain = R+ -{0} codomain = R domain = R codomain = [0,1] domain = R+ codomain = R+
  • 5. Functions f(S) = |S| f(string) = length(string) f(student-name) = student-ID f(x) = is-prime(x) domain = the set of all sets codomain = non-negative integers domain = the set of all strings codomain = non-negative integers domain = positive integers codomain = {T,F} not a function, since one input could have more than one output [two students may have same name]
  • 6. ≤ 1 arrow in A B f( ) = Injections (One-to-One) is an injection iff no two inputs have the same output.:f A B→ , . ( ( ) ( ')) ( ') ′∀ ∈ = → = a a A f a f a a a |A| ≤ |B|
  • 7. Surjections (Onto) A B 1 arrow in is a surjection iff every output is possible.:f A B→ f( ) = . ( )b B a A f a b∀ ∈ ∃ ∈ = |A| ≥ |B|
  • 8. Bijections A B is a bijection iff it is surjection and injection.:f A B→ f( ) = exactly one arrow in |A| = |B|
  • 9. Function Domain Codomain Injective? Surjective ? Bijective? f(x)=sin(x) Real Real f(x)=2x Real Positive real f(x)=x2 Real Non- negative real Reverse string Bit strings of length n Bit strings of length n Exercises Whether a function is injective, surjective, bijective depends on its domain and the codomain.
  • 10. Inverse Sets A B Given an element y in B, the inverse set of y := f-1 (y) = {x in A | f(x) = y}.
  • 11. Inverse Function A B f( ) = exactly one arrow in Informally, an inverse function f-1 is to “undo” the operation of function f. There is an inverse function f-1 for f if and only if f is a bijection.
  • 12. Inverse Function A B f( ) = exactly one arrow in Informally, an inverse function f-1 is to “undo” the operation of function f. There is an inverse function f-1 for f if and only if f is a bijection.
  • 13. Composition of Functions Two functions f:X->Y’, g:Y->Z so that Y’ is a subset of Y, then the composition of f and g is the function g 。 f: X->Z, where g 。 f(x) = g(f(x)). X Y Z Y’f g
  • 14. Function f Function g g 。 f injective? g 。 f surjective? g 。 f bijective? f:X->Y f surjective g:Y->Z g injective f:X->Y f surjective g:Y->Z g surjective f:X->Y f injective g:Y->Z g surjective f:X->Y f bijective g:Y->Z g bijective f:X->Y f-1 :Y->X Exercises
  • 15. This Lecture • Examples and definitions (injection, surjection, bijection) • Pigeonhole principle and applications
  • 16. If more pigeons than pigeonholes, Pigeonhole Principle
  • 17. Pigeonhole Principle then some hole must have at least two pigeons! Pigeonhole principle A function from a larger set to a smaller set cannot be injective. (There must be at least two elements in the domain that have the same image in the codomain.)
  • 18. Example 1 Question: Let A = {1,2,3,4,5,6,7,8} If five integers are selected from A, must a pair of integers have a sum of 9? Consider the pairs {1,8}, {2,7}, {3,6}, {4,5}. The sum of each pair is equal to 9. If we choose 5 numbers from this set, then by the pigeonhole principle, both elements of some pair will be chosen, and their sum is equal to 9.
  • 19. Example 2 Question: In a party of n people, is it always true that there are two people shaking hands with the same number of people? Everyone can shake hand with 0 to n-1 people, and there are n people, and so it does not seem that it must be the case, but think about it carefully: Case 1: if there is a person who does not shake hand with others, then any person can shake hands with at most n-2 people, and so everyone shakes hand with 0 to n-2 people, 0 to n-2 => n-1 possible values (i.e., cardinality of codomain = n-1) There are n people (i.e., cardinality of domain = n) so the answer is “yes” by the pigeonhole principle.
  • 20. Example 2 Question: In a party of n people, is it always true that there are two people shaking hands with the same number of people? Everyone can shake hand with 0 to n-1 people, and there are n people, and so it does not seem that it must be the case, but think about it carefully: Case 2: if everyone shakes hand with at least one person, then any person shakes hand with 1 to n-1 people, 1 to n-1 => n-1 possible values (i.e., cardinality of codomain = n-1) There are n people (i.e., cardinality of domain = n) so the answer is “yes” by the pigeonhole principle.
  • 21. Birthday Paradox In a group of 367 people, there must be two people having the same birthday. Suppose n <= 365, what is the probability that in a random set of n people, some pair of them will have the same birthday? We can think of it as picking n random numbers from 1 to 365 without repetition. There are 365n ways of picking n numbers from 1 to 365. [You have 365 choices to pick the first one, same for the second and so on…] There are 365·364·363·…·(365-n+1) ways of picking n numbers from 1 to 365 without repetition. [You have 365 choices to pick the first one, 364 for the second and so on…] So the probability that no pairs have the same birthday is equal to 365·364·363·…·(365-n+1) / 365n This is smaller than 50% for 23 people, smaller than 1% for 57 people.
  • 22. Generalized Pigeonhole Principle If n pigeons and h holes, then some hole has at least n h      pigeons. Generalized Pigeonhole Principle Cannot have < 3 cards in every hole. ♠ ♥ ♣ ♦
  • 23. Subset Sum Two different subsets of the 90 25-digit numbers shown above have the same sum.
  • 24. Subset Sum 90 numbers, each with at most 25 digits. So the total sum is at most 90x1025 Let A be the set of all subsets of the 90 numbers. Let B be the set of integers from 0 to 90x1025 . (pigeons) (pigeonholes) By pigeonhole principle, there are two different subsets with the same sum.
  • 25. Club vs Strangers Theorem: Every collection of 6 people includes a club of 3 people, or a group of 3 strangers. Let’s agree that given any two people, either they have met or not. If every people in a group has met, then we’ll call the group a club. If every people in a group has not met, then we’ll call a group of strangers. Let x be one of the six people. By the (generalized) pigeonhole principle, we have the following claim. Claim: Among the remaining 5 people, either 3 of them have met x, or 3 of them have not met x.
  • 26. Club vs Strangers Theorem: Every collection of 6 people includes a club of 3 people, or a group of 3 strangers. Claim: Among the remaining 5 people, either 3 of them have met x, or 3 of them have not met x. Case 1: “3 people have met x” Case 1.1: No pair among those people met each other. Then there is a group of 3 strangers. OK! Case 1.2: Some pair among those people have met each other. Then that pair, together with x, form a club of 3 people. OK!
  • 27. Club vs Strangers Theorem: Every collection of 6 people includes a club of 3 people, or a group of 3 strangers. Claim: Among the remaining 5 people, either 3 of them have met x, or 3 of them have not met x. Case 2: “3 people have not met x” Case 2.1: Every pair among those people met each other. Then there is a club of 3 people. OK! Case 2.2: Some pair among those people have not met each other. Then that pair, together with x, form a group of 3 strangers. OK!
  • 28. Quick Summary Make sure you understand basic definitions of functions. These will be used in the next lecture for counting. The pigeonhole principle is very simple, but there are many clever uses of it to prove non-trivial results.
  翻译: