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
Exam 2024 (C)
1b
Let
G
=
(
V
,
E
)
be a tree with
|
V
|
≥
2
Prove:
∃
v
∈
V
such that removing vertex
v
and all its edges will result in a graph
G
′
=
(
V
∖
{
v
}
,
E
′
)
such that in all connected components of
G
′
there is at most
|
V
|
2
vertices
Proof:
Let
∃
tree
G
=
(
V
,
E
)
:
∀
v
∈
V
:
∃
connected component of
G
′
=
(
V
∖
{
v
}
,
E
′
)
:
|
[
u
]
∼
|
>
n
2
2a
Let
A
Let
f
:
A
→
A
Let
g
:
P
(
A
)
→
P
(
A
)
,
g
(
B
)
=
f
−
1
[
B
]
Prove or disprove:
g
is surjective
⟹
f
is surjective
Disproof:
Let
f
:
N
→
N
,
f
(
n
)
=
n
+
1
f
is not surjective
Let
C
∈
P
(
N
)
Let
B
=
{
n
+
1
|
n
∈
C
}
⊆
N
g
(
B
)
=
f
−
1
[
B
]
=
C
2b
Let
A
Let
f
:
A
→
A
Let
g
:
P
(
A
)
→
P
(
A
)
,
g
(
B
)
=
f
−
1
[
B
]
Prove or disprove:
g
is surjective
⟹
f
is injective
Proof:
Let
g
be surjective
3
Let
f
:
N
→
N
,
{
f
(
n
)
<
n
n
≠
1
f
(
n
)
≤
n
n
=
1
3a
Prove:
∀
n
∈
N
:
∃
k
∈
N
:
∀
m
≤
n
:
f
k
(
m
)
=
1
Proof:
{
f
(
n
)
<
n
n
≠
1
f
(
n
)
≤
n
n
=
1
⟹
[
f
(
n
)
=
n
⟹
f
(
n
)
=
n
=
1
]
Let
n
∈
N
Let
k
=
n
Let
m
≤
n
f
n
(
m
)
≤
f
n
−
1
(
m
)
≤
⋯
≤
f
(
m
)
≤
m
Let
∀
i
∈
[
1
,
n
]
:
f
i
(
m
)
<
f
i
−
1
(
m
)
⟹
|
{
f
n
(
m
)
,
f
n
−
1
(
m
)
,
…
,
f
(
m
)
,
m
}
|
=
n
+
1
>
|
[
m
]
|
=
m
{
f
n
(
m
)
,
f
n
−
1
(
m
)
,
…
,
f
(
m
)
,
m
}
⊆
[
m
]
−
Contradiction!
⟹
∃
i
∈
[
1
,
n
+
1
]
:
f
i
(
m
)
=
f
i
−
1
(
m
)
then
f
(
f
i
−
1
(
m
)
)
=
f
i
−
1
(
m
)
=
1
⟹
f
n
+
1
(
m
)
=
f
n
(
m
)
=
⋯
=
f
i
−
1
(
m
)
=
1
⟹
f
k
(
m
)
=
1
3b
Is there
k
∈
N
:
∀
n
∈
N
:
f
k
(
n
)
=
1
?
Solution:
Let
f
(
n
)
=
{
n
−
1
n
>
1
1
n
=
1
Let
k
∈
N
Let
n
=
k
+
2
⟹
f
(
n
)
=
k
+
1
,
f
2
(
n
)
=
k
,
…
,
f
k
(
n
)
=
2
≠
1
⟹
∀
k
∈
N
:
∃
n
∈
N
:
f
k
(
n
)
≠
1
⟹
The answer is no, such
k
does not exist
4a
How many ways there are to sit 30 students in two circles, such that in one circle there are
exactly 20 students and in the other there are exactly 10 students?
Solution:
Let us first choose 10 students to sit in the second circle
(
30
10
)
Let us then arrange students in the first circle:
19
!
Let us then arrange students in the second circle:
9
!
⟹
The answer is:
(
30
10
)
19
!
9
!
=
30
!
20
⋅
10
=
30
!
200
4b
How many ways there are to sit 30 students in two circles?
Solution:
Let one of the circle have 0 people
Then there are
29
!
ways to arrange 30 students in a circle
Let us choose
1
≤
i
≤
29
people to go to the first circle
29
!
+
29
!
+
∑
i
=
1
29
(
30
i
)
(
30
−
i
−
1
)
!
(
i
−
1
)
!
=
∑
i
=
1
29
30
!
(
30
−
i
)
i
+
2
⋅
29
!
4c
How many ways there are to rearrange 30 students in a circle such that
for each student the left neighbor is new?
Solution:
Let us enumerate students in the circle from 1 to 30
Let us choose number
1
≤
i
≤
30
Let us count the number of ways to sit 30 students in a way that
neighbors
(
i
,
(
i
+
1
)
mod
30
)
sit as they were
Let
A
i
=
{
ways to arrange students such that
(
i
,
(
i
+
1
)
mod
30
)
sit as they were
}
|
A
i
|
=
(
30
−
1
−
1
)
!
Let us now choose
k
such numbers
1
≤
i
1
≤
i
2
≤
⋯
<
i
k
≤
30
|
A
i
1
∩
A
i
2
∩
⋯
∩
A
i
k
|
=
(
30
−
1
−
k
)
!
⟹
By the Inclusion-Exclusion principle:
|
⋃
i
=
1
30
A
i
|
=
∑
k
=
1
30
(
−
1
)
k
−
1
(
30
k
)
(
30
−
1
−
k
)
!
Total number of ways to sit 30 students in a circle is 29!
⟹
The answer is:
29
!
−
∑
k
=
1
30
(
−
1
)
k
−
1
(
30
k
)
(
30
−
1
−
k
)
!
=
∑
k
=
0
30
(
−
1
)
k
(
30
k
)
(
29
−
k
)
!
4d
How many ways there are to arrange 30 students in a circle such that
Each student has a number and only one student has a number bigger than his neighbors
Solution:
Note that this special student can only have number 30
29 can only be near 30
⟹
There are
2
ways
28 can only be near 29 or 30
⟹
There are also
2
ways
27 can only be near 28 or one of (29,30)
⟹
There are also
2
ways
And so on until we get to 1 which can only be placed between 2 and the other number
⟹
The answer is
2
28
5
Let
X
be a set
R
≠
∅
⊆
P
(
X
)
is called a ring if
∀
A
,
B
∈
R
:
[
A
∩
B
∈
R
]
∧
[
A
△
B
∈
R
]
5a
Let
R
⊆
P
(
X
)
be a ring
Prove:
∃
K
∈
R
:
∀
A
∈
R
:
A
△
K
=
A
Proof:
∀
A
,
B
∈
R
:
[
A
∩
B
∈
R
]
∧
[
A
△
B
∈
R
]
R
≠
∅
⟹
∃
C
∈
R
⟹
(
C
∩
C
∈
R
)
∧
(
C
△
C
∈
R
)
⟹
C
∈
R
∧
∅
∈
R
∀
D
:
D
△
∅
=
D
⟹
∃
K
=
∅
∈
R
:
∀
A
∈
R
:
A
△
K
=
A
△
∅
=
A
5b
Let
X
be a set
Let
{
R
i
}
i
∈
I
be a family of rings
Prove:
⋂
i
∈
I
R
i
is a ring
Proof:
Let
A
,
B
∈
⋂
i
∈
I
R
i
⟹
∀
i
∈
I
:
A
,
B
∈
R
i
⟹
∀
i
∈
I
:
(
A
∩
B
∈
R
i
)
∧
(
A
△
B
∈
R
i
)
⟹
(
A
∩
B
∈
⋂
i
∈
I
R
i
)
∧
(
A
△
B
∈
⋂
i
∈
I
R
i
)
⟹
⋂
i
∈
I
R
i
is a ring
5c
Let
R
⊆
P
(
X
)
be a ring
Prove:
∀
A
,
B
∈
R
:
(
A
∖
B
∈
R
)
∧
(
A
∪
B
∈
R
)
Proof:
∀
A
,
B
∈
R
:
[
A
∩
B
∈
R
]
∧
[
A
△
B
∈
R
]
Let
A
,
B
∈
R
A
∩
B
∈
R
,
A
△
B
=
(
A
∪
B
)
∖
(
A
∩
B
)
∈
R
(
A
△
B
)
△
(
A
∩
B
)
=
A
∪
B
⟹
A
∪
B
∈
R
(
A
∩
B
)
△
A
=
(
(
A
∩
B
)
∪
A
)
∖
(
A
∩
B
∩
A
)
=
A
∖
(
A
∩
B
)
A
∖
(
A
∩
B
)
=
{
x
|
x
∈
A
∧
x
∉
A
∩
B
}
=
{
x
|
x
∈
A
∧
(
x
∉
A
∨
x
∉
B
)
}
=
=
{
x
|
(
x
∈
A
∧
x
∉
A
)
∨
(
x
∈
A
∧
x
∉
B
)
}
=
A
∖
B
⟹
A
∖
B
∈
R
5d
Let
R
⊆
P
(
X
)
R
is called an algebra if
∃
E
∈
R
:
∀
A
∈
R
:
A
∩
E
=
A
Let
R
=
{
A
∈
P
(
X
)
|
A
is finite
}
Prove:
R
is algebra
⟺
X
is finite
Proof:
Let
X
be finite
⟹
R
=
P
(
X
)
is finite
⟹
X
∈
R
∀
A
∈
P
(
X
)
:
X
∩
A
=
A
⟹
R
is an algebra
Let
R
be an algebra
⟹
∃
E
∈
R
:
∀
A
∈
R
:
A
∩
E
=
A
E
∈
R
⟹
E
is finite
Let
T
=
{
{
x
}
|
x
∈
X
}
T
⊆
R
⟹
∀
{
x
}
∈
T
:
E
∩
{
x
}
=
{
x
}
⟹
∀
x
∈
X
:
{
x
}
⊆
E
⟹
x
∈
E
⟹
X
⊆
E
⟹
X
is finite