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 4
1
Given:
a
1
∈
R
,
d
∈
N
,
∀
n
≥
2
:
a
n
=
a
n
−
1
+
d
Prove:
∑
k
=
1
n
a
k
=
n
(
a
1
+
a
n
)
2
Proof:
Base case. Let
n
=
1
∑
k
=
1
n
a
k
=
a
1
=
1
(
a
1
+
a
n
)
2
Induction step. Let
∑
k
=
1
n
a
k
=
n
(
a
1
+
a
n
)
2
a
n
=
a
1
+
(
n
−
1
)
⋅
d
a
n
+
1
=
a
1
+
n
⋅
d
∑
k
=
1
n
+
1
a
k
=
∑
k
=
1
n
a
k
+
a
n
+
1
=
n
(
a
1
+
a
n
)
2
+
a
n
+
1
=
=
n
(
a
1
+
a
n
)
+
2
a
n
+
1
2
=
n
a
1
+
n
a
n
+
1
−
n
⋅
d
+
a
n
+
1
+
a
1
+
n
⋅
d
2
=
(
n
+
1
)
(
a
1
+
a
n
+
1
)
2
⟹
∀
n
∈
N
:
∑
k
=
1
n
a
k
=
n
(
a
1
+
a
n
)
2
⟹
∑
k
=
1
n
+
1
a
k
=
(
n
+
1
)
(
a
+
a
n
+
1
)
2
Base case + induction step
⟹
Proved by induction
Given:
P
0
=
A
∀
n
∈
N
:
P
n
=
¬
P
n
−
1
∨
A
2a
Prove:
For all odd
n
,
P
n
is a tautology
Proof:
Base case. Let
n
=
1
P
1
=
¬
P
0
∨
A
=
¬
A
∨
A
≡
T
Induction step. Let
P
n
be a tautology
P
n
+
2
=
¬
P
n
+
1
∨
A
=
¬
(
¬
P
n
∨
A
)
∨
A
=
(
P
n
⏟
≡
T
∧
¬
A
)
∨
A
=
¬
A
∨
A
≡
T
⟹
P
n
is a tautology
⟹
P
n
+
2
is a tautology
⟹
By Induction
∀
odd
n
:
P
n
≡
T
2b
Prove:
For all even
n
,
P
n
=
A
Proof:
Base case. Let
n
=
0
P
0
=
A
Induction step. Let
P
n
=
A
P
n
+
2
=
¬
P
n
+
1
∨
A
=
¬
(
¬
P
n
∨
A
)
∨
A
=
(
P
n
∧
¬
A
)
∨
A
=
(
A
∧
¬
A
)
∨
A
≡
A
⟹
P
n
=
A
⟹
P
n
+
2
=
A
⟹
By Induction
∀
even
n
:
P
n
=
A
3
Prove: It is possible to cover a
2
n
×
2
n
grid with one cell missing,
with L-shaped tiles consisting of three connected cells for all natural
n
Proof:
Base case. Let
n
=
1
2
×
2
grid can be filled like this:
(
1
0
1
1
)
0
represents the missing cell, other numbers represent the index of a tile used
Let us define four ways to fill this grid:
A
1
R
U
=
(
1
0
1
1
)
,
A
1
L
U
=
(
0
1
1
1
)
,
A
1
L
L
=
(
1
1
0
1
)
,
A
1
R
L
=
(
1
1
1
0
)
Where first R/L is right or left, second U/L is upper or lower and index is the value of
n
Induction step.
Now let us see if we can fill the grid for
n
+
1
, given that we can do it for
n
A
n
+
1
=
2
n
+
1
×
2
n
+
1
can be represented as
2
⋅
2
n
×
2
n
⋅
2
=
4
⋅
2
n
×
2
n
−
four
A
n
grids
Let us compose
A
n
+
1
the following way
:
A
n
+
1
=
(
A
n
R
L
A
n
L
L
A
n
R
U
A
n
L
U
)
=
(
⋯
⋯
⋯
⋯
⋯
0
0
⋯
⋯
0
0
⋯
⋯
⋯
⋯
⋯
)
We can see that the center has four empty cells,
which is logical as each
A
n
grid has one empty cell and there are four such grids
This empty center can be filled with one L-shaped tile:
(
⋯
⋯
⋯
⋯
⋯
x
x
⋯
⋯
x
0
⋯
⋯
⋯
⋯
⋯
)
Now let us prove that for any
n
it is possible to fill the grid as
A
n
L
U
,
A
n
L
L
,
A
n
R
U
,
A
n
R
L
A
n
=
(
⋯
⋯
⋯
⋯
⋯
0
x
⋯
⋯
x
x
⋯
⋯
⋯
⋯
⋯
)
=
(
A
n
−
1
R
L
⋯
⋯
⋯
)
→
Turn
A
n
−
1
R
L
by 180 degress
(
A
n
−
1
L
U
⋯
⋯
⋯
)
=
A
n
L
U
A
n
=
(
⋯
⋯
⋯
⋯
⋯
x
x
⋯
⋯
x
0
⋯
⋯
⋯
⋯
⋯
)
=
(
⋯
⋯
⋯
A
n
−
1
L
U
)
→
Turn
A
n
−
1
L
U
by 180 degrees
(
⋯
⋯
⋯
A
n
−
1
R
L
)
=
A
n
R
L
A
n
=
(
⋯
⋯
⋯
⋯
⋯
x
x
⋯
⋯
0
x
⋯
⋯
⋯
⋯
⋯
)
=
(
⋯
⋯
A
n
−
1
R
U
⋯
)
→
Transpose
A
n
−
1
R
U
(
⋯
⋯
A
n
−
1
L
L
⋯
)
=
A
n
L
L
A
n
=
(
⋯
⋯
⋯
⋯
⋯
x
0
⋯
⋯
x
x
⋯
⋯
⋯
⋯
⋯
)
=
(
⋯
A
n
−
1
L
L
⋯
⋯
)
→
Transpose
A
n
−
1
L
L
(
⋯
A
n
−
1
R
U
⋯
⋯
)
=
A
n
R
U
Base case + Induction step
⟹
Proved for all
n
by induction
4
Let
a
≠
0
∈
R
:
a
+
1
a
∈
Z
Prove:
∀
n
∈
N
:
a
n
+
1
a
n
∈
Z
Proof:
b
1
=
a
+
1
a
=
a
2
+
1
a
∈
Z
Let
b
n
=
a
n
+
1
a
n
=
a
2
n
+
1
a
n
⟹
b
n
+
1
=
a
2
n
+
2
+
1
a
n
+
1
Base case. Let
n
=
1
b
1
=
a
+
1
a
⟹
b
1
∈
Z
Let
n
=
2
b
2
=
a
2
+
1
a
2
=
a
4
+
1
a
2
=
(
a
2
+
1
)
2
−
2
a
2
a
2
=
(
a
2
+
1
a
)
2
−
2
a
2
+
1
a
∈
Z
⟹
(
a
2
+
1
a
)
2
∈
Z
⟹
(
a
2
+
1
a
)
2
−
2
=
b
2
∈
Z
Strong induction step. Let
∀
k
∈
[
1
,
n
]
:
b
k
∈
Z
b
1
⋅
b
n
=
(
a
2
+
1
)
(
a
2
n
+
1
)
a
⋅
a
n
=
a
2
(
n
+
1
)
+
1
+
a
2
n
+
a
2
a
n
+
1
=
=
a
2
(
n
+
1
)
+
1
a
n
+
1
⏟
b
n
+
1
+
a
2
(
n
−
1
)
+
1
a
n
−
1
⏟
b
n
−
1
=
b
n
+
1
+
b
n
−
1
⟹
b
n
+
1
=
b
1
⋅
b
n
−
b
n
−
1
b
1
,
b
n
−
1
,
b
n
∈
Z
⟹
b
1
⋅
b
n
∈
Z
⟹
b
1
⋅
b
n
−
b
n
−
1
=
b
n
+
1
∈
Z
Base step + Strong induction step
⟹
Proved by strong induction for all
n
∈
N
5
R
=
{
(
1
,
1
)
,
(
1
,
2
)
,
(
1
,
3
)
,
(
2
,
1
)
,
(
3
,
1
)
,
(
2
,
2
)
}
A
=
{
1
,
2
}
,
B
=
{
1
,
2
,
3
}
Show:
R
=
A
×
B
or
R
≠
A
×
B
Solution:
(
2
,
3
)
∈
A
×
B
,
(
2
,
3
)
∉
R
⟹
R
≠
A
×
B
Another reason being:
(
3
,
1
)
∉
A
×
B
,
(
3
,
1
)
∈
R
A
is a set
A
1
,
A
2
,
…
,
A
n
:
∀
i
∈
[
1
,
n
]
:
A
i
⊆
A
R
⊆
A
×
A
,
R
=
{
(
x
,
y
)
∈
A
×
A
|
∃
i
:
x
∈
A
i
∧
y
∈
A
i
}
6a
Prove or disprove:
⋃
i
∈
[
1
,
n
]
A
i
=
A
⟹
R
is reflexive
Proof:
Let
x
∈
A
x
∈
A
⟹
x
∈
⋃
i
∈
[
1
,
n
]
A
i
⟹
∃
i
∈
[
1
,
n
]
:
x
∈
A
i
⟹
∃
i
∈
[
1
,
n
]
:
x
∈
A
i
∧
x
∈
A
i
⟺
(
x
,
x
)
∈
R
⟺
R
is reflexive
6b
Prove or disprove:
R
is reflexive
⟹
⋃
i
∈
[
1
,
n
]
A
i
=
A
Proof:
R
is reflexive
⟺
∀
x
∈
A
:
(
x
,
x
)
∈
R
⟺
∀
x
∈
A
:
∃
i
∈
[
1
,
n
]
:
x
∈
A
i
Let
x
∈
A
x
∈
A
⟹
R
is reflexive
∃
i
∈
[
1
,
n
]
:
x
∈
A
i
⟹
x
∈
⋃
i
∈
[
1
,
n
]
A
i
⟹
1.
A
⊆
⋃
i
∈
[
1
,
n
]
A
i
Let
x
∈
⋃
i
∈
[
1
,
n
]
A
i
x
∈
⋃
i
∈
[
1
,
n
]
A
i
⟹
∃
i
∈
[
1
,
n
]
:
x
∈
A
i
A
i
⊆
A
⟹
∃
i
∈
[
1
,
n
]
:
x
∈
A
⟹
2.
⋃
i
∈
[
1
,
n
]
A
i
⊆
A
1.
and
2.
⟹
A
=
⋃
i
∈
[
1
,
n
]
A
i
6c
Prove or disprove:
(
∀
i
≠
j
:
A
i
∩
A
j
=
∅
)
⟹
R
is transitive
Proof:
Let
a
,
b
,
c
∈
A
,
(
a
,
b
)
∈
R
,
(
b
,
c
)
∈
R
(
a
,
b
)
∈
R
⟺
∃
i
∈
[
1
,
n
]
:
a
∈
A
i
∧
b
∈
A
i
(
b
,
c
)
∈
R
⟺
∃
j
∈
[
1
,
n
]
:
b
∈
A
j
∧
c
∈
A
j
Let
i
≠
j
Then
b
∈
A
i
∧
b
∈
A
j
⟹
A
i
∩
A
j
≠
∅
−
Contradiction!
⟹
i
=
j
⟹
∃
i
∈
[
1
,
n
]
:
a
∈
A
i
∧
b
∈
A
i
∧
c
∈
A
i
⟺
(
a
,
c
)
∈
R
⟹
R
is transitive
6d
Prove or disprove:
R
is transitive
⟹
∀
i
≠
j
:
A
i
∩
A
j
=
∅
Disproof:
Counter-example:
A
=
{
1
,
2
,
3
,
4
}
A
1
=
A
,
A
2
=
A
R
is transitive on
A
But
A
1
∩
A
2
≠
∅
Disproved
7a
Given:
R
,
S
−
equivalence relations on
A
Prove or disprove:
R
∩
S
is an equivalence relation on
A
Proof:
R
is an equivalence relation on
A
⟺
R
is reflexive, symmetric and transitive
S
is an equivalence relation on
A
⟺
S
is reflexive, symmetric and transitive
∀
a
∈
A
:
(
a
,
a
)
∈
R
∧
(
a
,
a
)
∈
S
⟺
∀
a
∈
A
:
(
a
,
a
)
∈
(
R
∩
S
)
∀
a
,
b
∈
A
:
(
(
a
,
b
)
∈
R
→
(
b
,
a
)
∈
R
)
∧
(
(
a
,
b
)
∈
S
→
(
b
,
a
)
∈
S
)
(
1
)
(
a
,
b
)
∈
(
R
∩
S
)
≡
(
a
,
b
)
∈
R
∧
(
a
,
b
)
∈
S
⟹
(
1
)
(
b
,
a
)
∈
R
∧
(
b
,
a
)
∈
S
⟺
(
b
,
a
)
∈
(
R
∩
S
)
∀
a
,
b
,
c
∈
A
:
(
(
a
,
b
)
∈
R
∧
(
b
,
c
)
∈
R
)
→
(
a
,
c
)
∈
R
(
2
)
∀
a
,
b
,
c
∈
A
:
(
(
a
,
b
)
∈
S
∧
(
b
,
c
)
∈
S
)
→
(
a
,
c
)
∈
S
(
3
)
(
a
,
b
)
,
(
b
,
c
)
∈
(
R
∩
S
)
⟺
(
a
,
b
)
,
(
b
,
c
)
∈
R
∧
(
a
,
b
)
,
(
b
,
c
)
∈
S
⟹
(
2
)
,
(
3
)
(
a
,
c
)
∈
R
∧
(
a
,
c
)
∈
S
⟺
(
a
,
c
)
∈
(
R
∩
S
)
⟹
(
R
∩
S
)
is reflexive, symmetric and transitive
⟺
(
R
∩
S
)
is an equivalence relation
7b
Given:
R
,
S
−
equivalence relations on
A
Prove or disprove:
R
∪
S
is an equivalence relation on
A
Disproof:
Let
(
a
,
b
)
∈
(
R
∪
S
)
,
(
b
,
c
)
∈
(
R
∪
S
)
Then this is possible:
(
a
,
b
)
∈
R
,
(
b
,
c
)
∉
R
,
(
b
,
c
)
∈
S
For example:
A
=
{
1
,
2
,
3
,
4
}
R
=
{
(
1
,
1
)
,
(
2
,
2
)
,
(
3
,
3
)
,
(
4
,
4
)
,
(
1
,
2
)
,
(
2
,
1
)
}
S
=
{
(
1
,
1
)
,
(
2
,
2
)
,
(
3
,
3
)
,
(
4
,
4
)
,
(
2
,
3
)
,
(
3
,
2
)
}
R
∪
S
=
{
(
1
,
1
)
,
(
2
,
2
)
,
(
3
,
3
)
,
(
4
,
4
)
,
(
1
,
2
)
,
(
2
,
1
)
,
(
2
,
3
)
,
(
3
,
2
)
}
(
1
,
2
)
∈
R
∪
S
,
(
2
,
3
)
∈
R
∪
S
But
(
1
,
3
)
∉
R
∪
S
⟹
(
R
∪
S
)
is not transitive
⟺
(
R
∪
S
)
is not an equivalence relation
8
S
is a relation on
(
R
∖
{
0
}
)
×
(
R
∖
{
0
}
)
S
=
{
(
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
)
|
x
1
⋅
x
2
>
0
∧
y
1
⋅
y
2
>
0
}
Prove that
S
is an equivalence relation on
(
R
∖
{
0
}
)
×
(
R
∖
{
0
}
)
Proof:
Let
(
a
,
b
)
∈
(
R
∖
{
0
}
)
a
⋅
a
>
0
∧
b
⋅
b
>
0
⟹
(
(
a
,
b
)
,
(
a
,
b
)
)
∈
S
⟹
S
is reflexive
Let
(
(
a
,
b
)
,
(
c
,
d
)
)
∈
S
Then
a
⋅
c
>
0
∧
b
⋅
d
>
0
(
(
c
,
d
)
,
(
a
,
b
)
)
∈
S
⟺
c
⋅
a
>
0
⏟
≡
a
⋅
c
>
0
∧
d
⋅
b
>
0
⏟
≡
b
⋅
d
>
0
⟹
S
is symmetric
Let
(
(
a
,
b
)
,
(
c
,
d
)
)
,
(
(
c
,
d
)
,
(
e
,
f
)
)
∈
S
Then
a
⋅
c
>
0
,
b
⋅
d
>
0
,
c
⋅
e
>
0
,
d
⋅
f
>
0
a
⋅
c
⋅
c
⋅
e
>
0
⟹
a
⋅
e
⋅
c
2
>
0
⟹
a
⋅
e
>
0
b
⋅
d
⋅
d
⋅
f
>
0
⟹
b
⋅
f
⋅
d
2
>
0
⟹
b
⋅
f
>
0
a
⋅
e
>
0
∧
b
⋅
f
>
0
⟺
(
(
a
,
b
)
,
(
e
,
f
)
)
∈
S
⟹
S
is transitive
S
is reflexive, symmetric and transitive
⟺
S
is an equivalence relation