1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0

advertisement
Discrete Mathematics
In Problems
Reporter: Anton Kuznietsov,
Kharkiv Karazin National University,
Ukraine
Discrete mathematics and programming
Ideas from
combination theory and
graph theory
are applied in
Algorithmic
programming
Math packages and
programming
are applied in
Some problems in
discrete
mathematics
Scheme of the presentation


Problems
 1. Knights and Liars
 2. Competing people
 3. Search for the culprit
 4. Queens
 5. Knight’s move
 6. Pavement
Conclusions
1. Knights & Liars
a = true  A – knight
A: a  b  c
B: (a  b  c)  (a  b  c)  (a  b  c)

Suppose, we are on a certain island and have talked with three
inhabitants A, B and C.
Each of them is either a knight or a liar. Knights always say
truth, liars always lie.
Two of them (A and B) came out with the following suggestions:

A: We all are liars.

B: Exactly one of us is a knight.



Question: Who of the inhabitants A, B and C is a knight, and
who is a liar? Write down the inhabitants’ propositions, using
formulas of proposition calculus.
1. Knights & Liars - solution
a = true  A – knight
A: a  b  c
B: (a  b  c)  (a  b  c)  (a  b  c)
a
a
bc
↯
b
c
b
at least 2 said truth,
↯
Answer: B is the only knight, A and C are liars.
2. Competing people
0110
1110
1000
0001









Four boys – Alex, Bill, Charles and Daniel – had a running-competition.
Next day they were asked: “Who and what place has taken?”
The boys answered so:
Alex: I wasn’t the first and the last.
Bill: I wasn’t the last.
Charles: I was the first.
Daniel: I was the last.
It is known, than three of these answers are true and one is false.
Question: Who has told a lie? Who is the champion?
2. Competing people - solution
0110
1110
1000
0001
A - liar
B - liar
C - liar
D - liar
1001
0110
0110
0110
1110
0001
1110
1110
1000
1000
0111
1000
0001
0001
0001
1110
Answer: Charles is a liar, Bill is the champion.
3. Search for the culprit
A  A is guilty






A B C
A B  C
CD
A D
(1)
(2)
(3)
(4)
Four people (A, B, C, D) are under suspicion of
committing a crime. The following is ascertained:
If A and B are guilty, then the suspected C is also
guilty.
If A is guilty, then B or C is also guilty.
If C is the culprit, then D is also guilty.
If A is innocent, then D is the culprit.
Question: Is D guilty?
3. Search for the culprit - solution
A B C
A B  C
CD
A D
A
(2)  B  C
B
(1)  C
(3)  D
Answer: D is guilty.
C
(3)  D
(1)
(2)
(3)
(4)
A
( 4)  D
4. Queens


Dispose eight queens on
the chess-board so, that
the queens don't
threaten each other.
Find all variants of such
arrangement.
4. Queens - solution
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
5. Knight’s moves




There is a chess-board of
size n x n (n <= 10).
A knight stands initially on
the field with coordinates
(x0, y0).
The knight has to visit every
field of the chess-board
exactly once.
Find the sequence of knight’s
moves (if it exists).
5. Knight’s moves - solution
1
4
9
18
21
10
17
20
3
8
5
2
13
22
19
16
11
24
7
14
25
6
15
12
23
6. Pavement 2 x N



Roadmen have pavement
plates of size 1x1 and 1x2.
How many ways are there to
pave the road of size 2xN
(1<=N<=1000)?
The plates 1x2 are made on
factory so, that they can be
placed only with the wide
side lengthwise the road.
N = 1, 2, 3, …
1, 4, 9, 25, 64, 169, 441, …
6. Pavement 2 x N
xN
– the number of ways to pave the road.
xN  xN 1  xN 2 ;
F0  0, F1  1;
x1  1, x2  2;
xN  FN 1
6. Pavement 2 x N
N = 1, 2, 3, …
1, 4, 9, 25, 64, 169, 441, …
2
N 1
F
6. Pavement 2 x N



Roadmen have only plates of
size 1x2.
The plates can be placed
both lengthwise and
crosswise the road.
How many ways are there in
this case?
y1  1, y2  2;
y N  FN 1.
6. Pavement 3 x N

Roadmen have only plates of
size 1x2.
The plates can be placed
both lengthwise and
crosswise the road.
How many ways are there in
this case?
1 < N < 1000.

N is even.



6. Pavement 3 x N
,
Am  Am1  2 Bm1
Bm1  Am1  Bm2
n
m ;
2
A-mthe required quantity;
Bm-1the number of ways to pave this road:
m = 1, 2, 3, …
Am = 3, 11, 41, 153,
571, 2131, 7953, …
Conclusions
Programming
are applied in
Problems of logic,
combination theory,
graph theory
Combination theory, graph
theory, pounding theory,
Fibonacci numbers,
Catalan numbers
are applied in
Algorithmic
programming
Thank you for your kind
attention!
Reporter: Anton Kuznietsov,
Kharkiv Karazin National University,
Ukraine
Download