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 25
Discrete-math 25
Exam 2023(A)
Prove: for any simple acyclic graph
G
=
(
V
,
E
)
there is a coloring of vertices in 2 colors such that no adjacent vertices have the same color
Proof:
Base case. Let
n
=
1
We can color 1 vertex black and we are done
Induction step. Let there be such a coloring for any graph with
n
vertices
Let
G
=
(
V
,
E
)
be a graph with
n
+
1
vertices
G
′
is a forest
⟹
Any connected component of
G
′
is a tree
Case 1. All connected components each have 1 vertex
⟹
Any vertex can be colored either black or white, there are no adjacent ones
Case 2. At least one connected component has 2 vertices or more
Any tree with
n
≥
2
vertices has at least 1 leaf
Let this leaf be vertex
v
with one neighbor
u
G
′
=
G
∖
{
v
}
has
n
vertices
⟹
there is such a coloring for
G
′
Let us use the coloring of
G
′
and let the color of
v
be different from the color of
u
⟹
There is such a coloring for
G
Proved by induction
Exam 2023(B)
Let
G
=
(
V
,
E
)
be a simple graph
Define the complement
G
―
of graph
G
To be
G
―
=
(
V
,
E
―
)
:
E
―
=
{
{
u
,
v
}
|
u
,
v
∈
V
,
{
u
,
v
}
∉
E
}
Prove: for any simple graph with
n
≥
5
vertices either
G
or
G
―
has a cycle
Proof:
|
E
―
|
=
n
(
n
−
1
)
2
−
|
E
|
Let
|
E
|
≥
n
⟹
G
has a cycle
Let
|
E
|
<
n
⟹
|
E
―
|
>
n
(
n
−
1
)
2
−
n
=
n
2
−
n
−
2
n
2
=
n
(
n
−
3
)
2
n
≥
5
⟹
n
−
3
2
≥
2
2
=
1
⟹
n
(
n
−
3
)
2
≥
n
⟹
|
E
―
|
>
n
⟹
G
―
has a cycle
Exam 2024(A)
Dani has 10 different fruits
In how many ways can he arrange them such that 3 apples (green, red, yellow)
are next to each other, but banana and orange are not next to each other
Solution:
There are
3
!
ways to arrange three apples
Let us treat 3 apples as 1 item
⟹
There are
3
!
⋅
8
!
ways to arrange all the fruits
Let us subtract the number of ways to arrange the fruits such that
apples are next to each other and banana and orange are next to each other
Let us treat banana and orange as 1 item
There are
3
!
⋅
2
!
⋅
7
!
ways to do so
⟹
The final answer is:
3
!
⋅
8
!
−
3
!
⋅
2
!
⋅
7
!
Now Dani needs to plan 3 of his school lunches with these 10 different fruits
His mom allows him to take at most 5 fruits per day
Solution:
Let us count the total number of options without the limit of 5:
Each fruit can be taken in one of three days
⟹
the number of such options is
3
10
Let us now count the number of options where Dani took exactly
6
≤
k
≤
10
fruits in one day
It is
∑
k
=
6
10
(
10
k
)
⋅
2
10
−
k
Dani can take more than 5 fruits in only one day
⟹
The answer is:
3
10
−
(
3
1
)
∑
k
=
6
10
(
10
k
)
⋅
2
10
−
k
Prove combinatorially:
∑
i
=
0
n
−
1
9
i
(
n
−
1
i
)
=
10
n
−
1
Proof:
On the right side we are making a
(
n
−
1
)
-long string of decimal digits
⟹
10
n
−
1
On the left side we first choose
(
n
−
1
−
i
)
places for digit 0 which is
(
n
−
1
i
)
And then choose
i
places for 9 digits left which is
9
i
⟹
The left side is
∑
i
=
0
n
−
1
9
i
(
n
−
1
i
)
⟹
∑
i
=
0
n
−
1
9
i
(
n
−
1
i
)
=
10
n
−
1
Exam 2024(B)
Park has 4 stations: crafting, ice skating, water fight and science
The day is divided into 10 hours, each visit to the station takes 1 hour
After water-fight children are not allowed to do ice-skating
In how many ways can the child plan his day?
Solution:
Case 1. There are no water-fights in the plan
⟹
There are
3
10
options
Case 2. There is a first water-fight in the
i
-th position in the plan
There are
3
i
−
1
options before water-fight and
3
10
−
i
options after it
⟹
number of such options is:
3
9
There are 10 options for i
⟹
There are a total of
10
⋅
3
9
such options
⟹
The final answer is:
3
10
+
10
⋅
3
9
Prove combinatorially:
∑
k
=
0
n
(
2
n
+
1
k
)
=
2
2
n
Proof:
Let us choose two disjoint groups of numbers from
[
2
n
+
1
]
This is
∑
k
=
0
n
(
2
n
+
1
k
)
Let us now take number 1 to be a first group
Let us now separate
2
n
elements left into two groups:
Group of 1 and the other one
There are
2
2
n
ways to do so
⟹
∑
k
=
0
n
(
2
n
+
1
k
)
=
2
2
n