Cub11k's BIU Notes
Cub11k's BIU Notes
Assignments
Discrete-math
Discrete-math 1
Discrete-math 10
Discrete-math 11
Discrete-math 12
Discrete-math 2
Discrete-math 3
Discrete-math 4
Discrete-math 5
Discrete-math 6
Discrete-math 7
Discrete-math 8
Discrete-math 9
Infi-1
Infi-1 10
Infi-1 11
Infi-1 2
Infi-1 3
Infi-1 4
Infi-1 5
Infi-1 6
Infi-1 7
Infi-1 8
Infi-1 9
Linear-1
Linear-1 1
Linear-1 10
Linear-1 11
Linear-1 12
Linear-1 2
Linear-1 3
Linear-1 4
Linear-1 5
Linear-1 6
Linear-1 7
Linear-1 8
Linear-1 9
Linear-2
Linear-2 1
Lectures
Data-structures
Data-structures 1
Data-structures 2
Data-structures 3
Discrete-math
Discrete-math 10
Discrete-math 11
Discrete-math 12
Discrete-math 13
Discrete-math 14
Discrete-math 15
Discrete-math 16
Discrete-math 18
Discrete-math 19
Discrete-math 20
Discrete-math 21
Discrete-math 22
Discrete-math 23
Discrete-math 24
Discrete-math 25
Discrete-math 26
Discrete-math 3
Discrete-math 4
Discrete-math 5
Discrete-math 6
Discrete-math 7
Discrete-math 8
Discrete-math 9
Exam 2023 (2A)
Exam 2023 (2B)
Exam 2023 (A)
Exam 2023 (B)
Exam 2023 (C)
Exam 2024 (A)
Exam 2024 (B)
Exam 2024 (C)
Midterm
Infi-1
Exam 2022B (A)
Exam 2022B (B)
Exam 2023B (A)
Exam 2023B (B)
Exam 2024 (A)
Exam 2024 (B)
Exam 2025 (A)
Infi-1 10
Infi-1 12
Infi-1 13
Infi-1 14
Infi-1 15
Infi-1 16
Infi-1 17
Infi-1 19
Infi-1 20
Infi-1 21
Infi-1 22
Infi-1 23
Infi-1 24
Infi-1 25
Infi-1 26
Infi-1 5
Infi-1 6
Infi-1 7
Infi-1 9
Midterm
Theorems and proofs
Infi-2
Infi-2 1
Infi-2 10
Infi-2 11
Infi-2 12
Infi-2 13
Infi-2 14
Infi-2 15
Infi-2 16
Infi-2 17
Infi-2 2-3
Infi-2 3-4
Infi-2 5
Infi-2 6
Infi-2 7
Infi-2 8
Infi-2 9
Linear-1
Exam 2023 (B)
Exam 2023 (C)
Exam 2024 (A)
Exam 2024 (B)
Exam 2024 (C)
Exam 2025 (A)
Linear-1 11
Linear-1 12
Linear-1 13
Linear-1 4
Linear-1 5
Linear-1 6
Linear-1 7
Linear-1 8
Linear-1 9
Midterm
Random exams
Theorems and proofs
Linear-2
Linear-2 1
Linear-2 2
Linear-2 3
Linear-2 4
Linear-2 5
Linear-2 6
Linear-2 7
Linear-2 8
Seminars
CSI
CSI 2
Data-structures
Data-structures 1
Data-structures 2
Data-structures 3
Discrete-math
Discrete-math 1
Discrete-math 10
Discrete-math 11
Discrete-math 12
Discrete-math 2
Discrete-math 3
Discrete-math 4
Discrete-math 5
Discrete-math 6
Discrete-math 7
Discrete-math 8
Discrete-math 9
Infi-1
Infi-1 10
Infi-1 11
Infi-1 12
Infi-1 13
Infi-1 3
Infi-1 4
Infi-1 5
Infi-1 6
Infi-1 8
Infi-2
Infi-2 1
Infi-2 2
Infi-2 3
Infi-2 4
Infi-2 6
Infi-2 7
Infi-2 8
Linear-1
Linear-1 10
Linear-1 11
Linear-1 12
Linear-1 3
Linear-1 5
Linear-1 6
Linear-1 7
Linear-1 8
Linear-1 9
Linear-2
Linear-2 1
Linear-2 2
Linear-2 3
Linear-2 4
Linear-2 5
Linear-2 6
Linear-2 7
Templates
Lecture Template
Seminar Template
Home
Discrete-math 11
Discrete-math 11
Pigeonhole principle
|
A
|
>
|
B
|
f
:
A
→
B
⟹
∃
a
1
≠
a
2
∈
A
:
f
(
a
1
)
=
f
(
a
2
)
Exercise
A
⊆
Z
,
|
A
|
=
6
Prove:
∃
a
1
,
a
2
∈
A
:
5
∣
(
a
1
−
a
2
)
Solution:
Let
B
=
{
Remainders of division by 5
}
=
{
0
,
1
,
2
,
3
,
4
}
|
A
|
>
|
B
|
f
:
A
→
B
f
(
a
)
=
a
mod
5
⟹
∃
a
1
,
a
2
∈
A
:
f
(
a
1
)
=
f
(
a
2
)
=
x
⟹
{
a
1
=
5
n
+
x
a
2
=
5
m
+
x
⟹
a
1
−
a
2
=
5
(
n
−
m
)
⟹
f
(
a
1
−
a
2
)
=
0
⟹
5
∣
(
a
1
−
a
2
)
Exercise
n
≥
2
women shake hands
Prove: there are at least two women who shook the same number of hands
Proof:
Let
A
=
{
women
}
,
|
A
|
=
n
Let
B
=
{
possible numbers of handshakes
}
Case 1. One woman shook everybody’s hand
⟹
No woman shook 0 hands
⟹
Possible numbers of handshakes is from 1 to
n
−
1
⟹
|
A
|
>
|
B
|
=
n
−
1
Case 2. No woman shook everybody’s hand
⟹
Possible numbers of handshakes is from 0 to
n
−
2
⟹
|
A
|
>
|
B
|
=
n
−
1
Both cases lead to pigeonhole principle
Exercise
A
=⊆
{
1
,
…
,
100
}
,
|
A
|
=
51
Prove:
∃
a
,
b
∈
A
:
a
∣
b
Proof:
∀
x
∈
A
:
x
=
a
⋅
2
k
,
2
∤
a
Let
B
=
{
1
,
3
,
5
,
…
,
99
}
f
:
A
→
B
,
f
(
x
)
=
f
(
a
⋅
2
k
)
=
a
|
A
|
>
|
B
|
⟹
∃
x
1
,
x
2
∈
A
:
f
(
x
1
)
=
f
(
x
2
)
=
a
⟹
{
x
1
=
a
⋅
2
i
x
2
=
a
⋅
2
j
⟹
x
1
x
2
=
2
i
−
j
,
x
2
x
1
=
2
j
−
i
⟹
{
i
≤
j
⟹
x
1
∣
x
2
j
<
i
⟹
x
2
∣
x
1
Inclusion-Exclusion principle
|
⋃
i
=
1
n
A
i
|
=
∑
k
=
1
n
(
−
1
)
k
−
1
∑
1
≤
k
1
<
k
2
<
⋯
<
k
k
≤
n
|
⋂
i
∈
{
k
1
,
k
2
,
…
,
k
k
}
A
i
|
⋂
i
=
1
n
A
i
c
=
(
⋃
i
=
1
n
A
i
)
c
=
U
−
⋃
i
=
1
n
A
i
Exercise
80
balls
5
boxes
Each box has at most
24
balls
Solution:
Total number of ways to divide balls into boxes:
(
80
+
5
−
1
80
)
Let
A
=
{
At least one box has 25 balls
}
Let
A
i
=
{
Box
i
has at least
25
balls
}
|
A
i
|
=
(
55
+
5
−
1
55
)
|
A
i
∩
A
j
|
=
(
30
+
5
−
1
30
)
|
A
i
1
∩
⋯
∩
A
i
k
|
=
(
80
−
25
k
+
5
−
1
80
−
25
k
)
=
α
k
⟹
|
⋃
i
=
1
5
A
i
|
=
∑
k
=
1
5
(
−
1
)
k
−
1
(
5
k
)
α
k
=
∑
k
=
1
3
(
−
1
)
k
−
1
(
5
k
)
α
k
The final answer is:
(
80
+
5
−
1
80
)
−
∑
k
=
1
3
(
−
1
)
k
−
1
(
5
k
)
(
80
−
25
k
+
5
−
1
80
−
25
k
)
Exercise
A
=
{
1
,
2
,
…
,
n
}
f
:
A
→
A
x
∈
A
is a called a fixed point of
f
if
f
(
x
)
=
x
How many invertible functions with no fixed points there are?
Solution:
Number of invertible functions on
A
is
n
!
Let
A
i
=
{
f
∈
A
A
|
i
is a fixed point of
f
}
|
A
i
|
=
(
n
−
1
)
!
|
A
i
∩
A
j
|
=
(
n
−
2
)
!
…
α
k
=
(
n
−
k
)
!
⟹
|
⋃
i
=
1
n
A
i
|
=
∑
k
=
1
n
(
−
1
)
k
−
1
(
n
k
)
(
n
−
k
)
!
⟹
The final answer is:
n
!
−
∑
k
=
1
n
(
−
1
)
k
−
1
(
n
k
)
(
n
−
k
)
!