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 20
Discrete-math 20
Pigeonhole principle variations
#theorem
There is
m
pigeons and
k
pigeonholes
Then there is a pigeonhole with at least
⌈
m
k
⌉
pigeons
Proof:
Let
c
i
be the number of pigeons in each pigeonhole
Let
∀
i
∈
[
1
,
n
]
:
c
i
<
⌈
m
k
⌉
⟹
c
i
≤
⌈
m
k
⌉
−
1
Then
m
=
∑
i
=
1
k
c
i
≤
∑
i
=
1
k
⌈
m
k
⌉
−
1
<
∑
i
=
1
k
(
m
k
+
1
−
1
)
=
m
−
Contradiction!
In any group of 6 people
there is a group of 3 people who are all friends of each other
or there is a group of 3 people who are all not friends of each other
Proof:
Let
A
be one of the 6 people
Let’s consider two groups:
1.
Friends of
A
2.
Not friend of
A
By the pigeonhole principle, at least one of the groups has
⌈
5
2
⌉
=
3
people
Case 1. There are at least 3 friends of
A
Case 1.1 There are two people in this group that are friends
Then
A
and these 2 people make a group of 3 people who are all friends of each other
Case 1.2 There are no two people in this group that are friends
Then this group is a group of at least 3 people that are all not friends of each other
Case 2. There are at least 3 people who are not friends of A
Case 2.1 There are two people who are not friends in this group
Then
A
and these two people make a group where all are not friends of each other
Case 2.2 There are no such pair
Then this group is at least 3 people who are all friends of each other
Normal forms of propositions
#definition
DNF and CNF
Literal: logical variable or it’s negation
∧
(AND) clause/term:
∧
of literals
∨
(OR) clause/term:
∨
of literals
Proposition
P
is a disjuncitve normal form (DNF)
if it is
∨
of AND clauses
DNF is complete if in any AND clause, any variable appears exactly once
For example:
x
1
,
x
2
,
x
3
:
(
x
1
∧
x
2
∧
x
3
)
∨
(
¬
x
1
∧
¬
x
2
∧
¬
x
3
)
Proposition
P
is a conjunctive normal form (CNF)
if it is
∧
of OR clauses
CNF is complete if in any OR clause, any variable appears exactly once
For example:
x
1
,
x
2
,
x
3
:
(
x
1
∨
x
2
∨
x
3
)
∧
(
¬
x
1
∨
¬
x
2
∨
¬
x
3
)
DNF existence
#theorem
For any proposition
P
which is not a contradiction
There is an equivalent proposition in complete DNF
Proof:
Process of building the DNF:
1.
Compute the truth table
2.
Choose all substitutions that yield True. Each substitution will be an AND clause
3.
Each variable will appear in the clause as is if it’s value is True
4.
Each variable will appear in the clause as a negation if it’s value is False
5.
Connect all chosen clauses with
∨
For example:
(
p
q
p
⊕
q
0
0
0
0
1
1
1
0
1
1
1
0
)
→
{
¬
p
∧
q
p
∧
¬
q
→
(
¬
p
∧
q
)
∨
(
p
∧
¬
q
)
CNF existence
#theorem
For any proposition
P
which is not a tautology
There is an equivalent proposition in complete
C
N
F
Proof:
P
is not a tautology
⟹
¬
P
is not a contradiction
⟹
∃
a complete
D
N
F
of
¬
P
¬
(
complete
D
N
F
of
¬
P
)
is a complete
C
N
F
of
P
⟹
∃
a complete
C
N
F
of
P
Complete set of logical connectives
#definition
Set of logical connectives is complete if we can express any proposition
using only this set
Connective
N
A
N
D
(
↑
)
p
↑
q
=
¬
(
p
∧
q
)
Connective
N
O
R
(
↓
)
p
↓
q
=
¬
(
p
∨
q
)
Completeness
#theorem
The following sets are complete:
1.
{
∨
,
∧
,
¬
}
2.
{
∨
,
¬
}
3.
{
∧
,
¬
}
4.
{
→
,
¬
}
5.
{
↑
}
6.
{
↓
}
Proof for 1
{
∨
,
∧
,
¬
}
is complete because any proposition has an equivalent in
D
N
F
Proof for 2
p
∧
q
=
¬
(
¬
p
∨
¬
q
)
⟹
By 1:
{
∨
,
¬
}
is complete
Proof for 3
p
∨
q
=
¬
(
¬
p
∧
¬
q
)
⟹
By 2:
{
∧
,
¬
}
is complete
Proof for 4
p
∨
q
=
¬
p
→
q
⟹
By 2:
{
→
,
¬
}
is complete
Proof for
5
¬
p
=
p
↑
p
p
∧
q
=
¬
(
p
↑
q
)
=
(
p
↑
q
)
↑
(
p
↑
q
)
⟹
By 3:
{
↑
}
is complete
Proof for 6
¬
p
=
p
↓
p
p
∨
q
=
¬
(
p
↓
q
)
=
(
p
↓
q
)
↓
(
p
↓
q
)
⟹
By 2:
{
↓
}
is complete