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 5
1
Let
A
be a set.
B
⊆
A
R
⊆
P
(
A
)
×
P
(
A
)
(
C
,
D
)
∈
R
⟺
C
∩
B
=
D
∩
B
1a
Prove:
R
is an equivalence relation
Proof:
∀
C
∈
P
(
A
)
:
C
∩
B
=
C
∩
B
⟹
(
C
,
C
)
∈
R
⟹
R
is reflexive
Let
(
C
,
D
)
∈
R
⟹
C
∩
B
=
D
∩
B
⟹
D
∩
B
=
C
∩
B
⟹
(
D
,
C
)
∈
R
⟹
R
is symmetric
Let
(
C
,
D
)
∈
R
,
(
D
,
E
)
∈
R
⟹
C
∩
B
=
D
∩
B
∧
D
∩
B
=
E
∩
B
⟹
C
∩
B
=
E
∩
B
⟹
(
C
,
E
)
∈
R
⟹
R
is transitive
R
is reflexive, symmetric and transitive
⟹
R
is an equivalence relation
1b
Prove:
∀
C
,
D
⊆
B
:
C
≠
D
⟹
[
C
]
R
≠
[
D
]
R
Proof:
C
⊆
B
⟹
C
∩
B
=
C
D
⊆
B
⟹
D
∩
B
=
D
C
≠
D
⟹
C
∩
B
≠
D
∩
B
⟹
(
C
,
D
)
∉
R
⟹
D
∈
[
D
]
R
∧
D
∉
[
C
]
R
⟹
[
D
]
R
≠
[
C
]
R
1c
Prove:
∀
C
⊆
A
:
∃
D
⊆
B
:
[
C
]
R
=
[
D
]
R
Proof:
[
C
]
R
=
{
X
|
X
∩
B
=
C
∩
B
}
[
D
]
R
=
{
X
|
X
∩
B
=
D
∩
B
=
D
}
⟹
[
C
]
R
=
[
D
]
R
⟺
C
∩
B
=
D
By properties of inclusion:
C
∩
B
⊆
B
⟹
∀
C
⊆
A
:
∃
D
⊆
B
:
D
=
C
∩
B
⟺
[
C
]
R
=
[
D
]
R
1d
A
=
{
1
,
2
,
3
,
4
}
,
B
=
{
1
,
4
}
[
∅
]
R
=
{
X
∈
P
(
A
)
|
X
∩
B
=
∅
∩
B
=
∅
}
X
∩
B
=
∅
⟺
1
∉
X
∧
4
∉
X
⟹
[
∅
]
R
=
{
∅
,
{
2
}
,
{
3
}
,
{
2
,
3
}
}
[
X
]
R
=
{
Y
∈
P
(
A
)
|
X
∩
B
=
Y
∩
B
}
What equivalence classes are there?
Let us take all possible values of
X
∩
B
,
they are all possible subsets of
B
:
∅
⊆
{
1
,
4
}
{
1
}
⊆
{
1
,
4
}
{
4
}
⊆
{
1
,
4
}
{
1
,
4
}
⊆
{
1
,
4
}
⟹
P
(
A
)
/
R
=
{
[
X
]
R
|
X
∈
P
(
A
)
}
=
{
[
∅
]
R
,
[
{
1
}
]
R
,
[
{
4
}
]
R
,
[
{
1
,
4
}
]
R
}
2
A
=
{
1
,
2
,
3
,
4
}
R
1
=
I
A
⟹
A
/
R
1
=
{
{
1
}
,
{
2
}
,
{
3
}
,
{
4
}
}
R
2
=
I
A
∪
{
(
1
,
2
)
,
(
2
,
1
)
}
⟹
A
/
R
2
=
{
{
1
,
2
}
,
{
3
}
,
{
4
}
}
R
3
=
I
A
∪
{
(
1
,
2
)
,
(
2
,
1
)
,
(
2
,
3
)
,
(
3
,
2
)
,
(
1
,
3
)
,
(
3
,
1
)
}
⟹
A
/
R
3
=
{
{
1
,
2
,
3
}
,
{
4
}
}
3a
R
on
R
×
R
(
x
1
,
y
1
)
R
(
x
2
,
y
2
)
⟺
x
1
2
+
y
1
2
=
x
2
2
+
y
2
2
[
(
1
,
1
)
]
R
=
{
(
x
,
y
)
|
x
2
+
y
2
=
2
}
(
1
2
,
7
2
)
R
(
1
,
1
)
⟺
1
4
+
7
4
=
1
+
1
⟹
(
1
2
,
7
2
)
∈
[
(
1
,
1
)
]
R
Equation of a circle:
(
x
−
a
)
2
+
(
y
−
b
)
2
=
r
2
⟹
The geometric interpretation of the partition would be
all different circles with the center at
(
0
,
0
)
3b
S
on
R
×
R
(
x
1
,
y
1
)
S
(
x
2
,
y
2
)
⟺
x
1
=
x
2
[
(
1
,
1
)
]
S
=
{
(
x
,
y
)
|
x
=
1
}
(
1
,
−
1
)
S
(
1
,
1
)
⟺
1
=
1
⟹
(
1
,
−
1
)
∈
[
(
1
,
1
)
]
S
Equation of a vertical line:
x
=
a
⟹
The geometric interpretation of the partition would be
all different vertical lines
3c
[
(
x
,
y
)
]
R
∩
S
=
{
(
a
,
b
)
|
a
2
+
b
2
=
x
2
+
y
2
∧
a
=
x
}
=
{
(
a
,
b
)
|
b
2
=
y
2
∧
a
=
x
}
=
=
{
(
a
,
b
)
|
b
=
±
y
∧
a
=
x
}
⟹
[
(
x
,
y
)
]
R
∩
S
=
{
{
(
x
,
y
)
}
y
=
0
{
(
x
,
y
)
,
(
x
,
−
y
)
}
y
≠
0
⟹
|
[
(
x
,
y
)
]
R
∩
S
|
=
{
1
y
=
0
2
y
≠
0
Geometrically this can be explained as:
A vertical line can either touch the circle in one point or cross it in two points
4
S
on
A
=
(
R
∖
{
0
}
)
×
(
R
∖
{
0
}
)
(
x
1
,
y
1
)
S
(
x
2
,
y
2
)
⟺
x
1
⋅
x
2
>
0
∧
y
1
⋅
y
2
>
0
x
1
⋅
x
2
>
0
⟺
{
x
1
<
0
∧
x
2
<
0
x
1
>
0
∧
x
2
>
0
y
1
⋅
y
2
>
0
⟺
{
y
1
<
0
∧
y
2
<
0
y
1
>
0
∧
y
2
>
0
⟹
(
x
1
,
y
1
)
S
(
x
2
,
y
2
)
⟺
{
x
1
,
x
2
,
y
1
,
y
2
<
0
x
1
,
x
2
<
0
∧
y
1
,
y
2
>
0
x
1
,
x
2
,
y
1
,
y
2
>
0
x
1
,
x
2
>
0
∧
y
1
,
y
2
<
0
⟹
A
/
S
=
{
[
(
1
,
1
)
]
S
,
[
(
1
,
−
1
)
]
S
,
[
(
−
1
,
1
)
]
S
,
[
(
−
1
,
−
1
)
]
S
}
⟹
|
A
/
S
|
=
4
Geometrical interpretation of
S
are quadrants, not including the axes
Let
A
=
{
1
,
2
,
3
}
5a
Nor symmetric, nor anti-symmetric
R
=
{
(
1
,
2
)
,
(
2
,
1
)
,
(
3
,
1
)
}
5b
Anti-symmetric, but not symmetric
R
=
{
(
1
,
2
)
}
5c
Symmetric, but not anti-symmetric
R
=
{
(
1
,
2
)
,
(
2
,
1
)
}
5d
Symmetric and anti-symmetric
R
=
I
A
6a
R
⊆
R
×
R
R
=
{
(
a
,
b
)
|
a
2
≤
b
2
}
R
is reflexive:
a
2
≤
a
2
⟹
(
a
,
a
)
∈
R
R
is not anti-symmetric:
a
2
≤
b
2
∧
b
2
≤
a
2
⟹
a
2
=
b
2
⟹
⧸
⟹
a
=
b
Example:
(
a
,
−
a
)
∈
R
,
(
−
a
,
a
)
∈
R
,
a
≠
−
a
⟹
R
is not a partially ordering relation
6b
(
A
,
R
)
is a partially ordered set (poset)
Let
B
⊆
A
,
S
=
R
∩
(
B
×
B
)
Let
a
∈
B
⟹
(
a
,
a
)
∈
B
×
B
(
a
,
a
)
∈
R
⟹
(
a
,
a
)
∈
S
⟹
S
is reflexive on
B
Let
a
,
b
∈
B
⟹
(
a
,
b
)
,
(
b
,
a
)
∈
B
×
B
(
a
,
b
)
∈
S
⟹
(
a
,
b
)
∈
R
⟹
[
(
b
,
a
)
∈
R
→
b
=
a
]
⟹
[
(
b
,
a
)
∈
S
→
b
=
a
]
⟹
S
is anti-symmetric on
B
Let
a
,
b
,
c
∈
B
⟹
(
a
,
b
)
,
(
b
,
c
)
,
(
a
,
c
)
∈
B
×
B
(
a
,
b
)
,
(
b
,
c
)
∈
S
⟹
(
a
,
b
)
,
(
b
,
c
)
∈
R
⟹
(
a
,
c
)
∈
R
⟹
(
a
,
c
)
∈
S
⟹
S
is transitive on
B
⟹
S
is a partially ordering relation on
B
6c
A
=
{
(
a
1
,
a
2
,
…
,
a
n
)
|
∀
k
∈
[
1
,
n
]
:
a
k
∈
{
0
,
1
}
}
R
=
{
(
(
a
1
,
a
2
,
…
,
a
n
)
,
(
b
1
,
b
2
,
…
,
b
n
)
)
|
∑
k
=
1
n
a
k
<
∑
k
=
1
n
b
k
}
Note: I will use notation
00
,
010
,
1011
,
e
t
c
.
to denote sequences
(
0
,
0
)
,
(
0
,
1
,
0
)
,
(
1
,
0
,
1
,
1
)
,
e
t
c
.
so that the solution is not too flooded with extra characters
e
.
g
.
10 in this case is not a number, but a sequence of length 2
Let
n
=
1
A
=
{
(
0
)
,
(
1
)
}
,
R
=
{
(
(
0
)
,
(
1
)
)
}
Let
n
=
2
A
=
{
00
,
01
,
10
,
11
}
R
=
{
(
00
,
01
)
,
(
00
,
10
)
,
(
00
,
11
)
,
(
01
,
11
)
,
(
10
,
11
)
}
R
is a relation comparing the number of 1s in two sequences
R
is not a partial ordering relation, because any sequence is not in relation
R
with itself
Let
S
=
R
∪
I
A
I
A
⊆
S
⟹
S
is reflexive
(
a
,
b
)
∈
S
∧
(
b
,
a
)
∈
S
is always false
⟹
S
is anti-symmetric
a
S
b
,
b
S
c
⟺
∑
a
<
∑
b
<
∑
c
⟹
∑
a
<
∑
c
⟹
a
S
c
⟹
S
is transitive
⟹
S
is a partially ordering relation
Sequence
0
A
=
(
0
,
0
,
…
,
0
)
n
is a minimum of set
A
:
∀
x
∈
A
:
(
0
A
,
x
)
∈
S
as all
x
will have at least one 1 or be equal to
0
A
Set
A
has a minimum
⟹
the only minimal element is
0
A
Sequence
1
A
=
(
1
,
1
,
…
,
1
)
n
is a maximum of set
A
:
∀
x
∈
A
:
(
x
,
1
A
)
∈
S
as all
x
will have at least one 0 or be equal to
1
A
Set
A
has a maximum
⟹
the only maximal element is
1
A
7
A
=
{
2
,
3
,
…
,
99
,
100
}
R
=
{
(
a
,
b
)
|
∃
k
∈
N
:
b
=
a
k
}
7a
How many maximal elements are there in this set?
Element is going to be maximal if it doesn’t divide any member of set
A
except for itself
∀
x
∈
A
:
x
≤
50
⟹
4
≤
2
x
≤
100
⟹
2
x
∈
A
⟹
x
∣
2
x
⟹
Any element less or equal to
50
is not maximal
∀
x
∈
A
:
x
>
50
,
k
≥
2
⟹
x
k
>
100
⟹
{
x
k
=
x
k
=
1
x
k
∉
A
k
≥
2
⟹
∀
x
>
50
∈
A
:
¬
(
∃
b
∈
A
:
b
≠
x
∧
x
∣
b
)
⟹
All elements of
A
greater than
50
are maximal, there are
50
of them
7b
Is there a smallest element?
2
∤
3
⟹
2
is not the smallest
∀
x
∈
[
3
,
100
]
:
x
∤
2
⟹
∀
a
∈
A
∃
x
∈
A
:
a
∤
x
⟹
There is no smallest element
7c
Add two elements to the set such that it has a smallest and a largest elements
First element to add would be
1
,
as it divides all elements of set A
⟹
1
is a minimum
Second element to add would be
∏
k
=
2
100
k
,
as it is divided by all elements of set A
⟹
∏
k
=
2
100
k
is a maximum
8
A
is a finite set
,
(
A
,
R
)
is a partially ordered set
Prove: If there is exactly one minimal element, then it is also a minimum
Proof:
Let
m
be a unique minimal element, but not a minimum of set
A
⟹
∃
x
∈
A
:
m
S̸
x
m
S
m
⟹
x
≠
m
⟹
x
S̸
m
Let
B
=
{
b
∈
A
|
b
S
x
}
x
∈
B
⟹
B
≠
∅
B
⊆
A
⟹
B
is finite
⟹
∃
z
∈
B
:
z
is a minimal element of
B
[
m
S
b
∧
b
S
x
→
m
S
x
]
⟹
∀
b
∈
B
:
m
S̸
b
⟹
m
S̸
z
⟹
m
≠
z
m
is a unique minimal of
A
⟹
z
is not minimal in
A
⟹
∃
a
∈
A
:
a
≠
z
∧
a
S
z
a
S
z
∧
z
S
x
⟹
By transitivity
a
S
x
⟹
a
∈
B
a
∈
B
∧
a
S
z
⟹
a
=
z
−
Contradiction!
⟹
m
is a minimum of A