Homework 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

TECHNICAL UNIVERSITY OF MANABI

FACULTY OF COMPUTER SCIENCES


TECHNOLOGY ENGINEERING
INFORMATION.

Resolution exercise #5

LEVEL:
SECOND SEMESTER

SUBJECT:

DISCRETE MATHEMATICS

PARALLEL: “B”

STUDENT :
ROSALES LOOR AXEL ALEJANDRO.

TEACHER:

WILSON FABIÁN CHÁVEZ RODRÍGUEZ

PERIOD: APRIL 2021 – SEPTEMBER 2021


Resolution exercise #5
Solve the following exercises
• PAGE 550. EXERCISES 1 TO 8 EULER AND HAMILTON
• PAGE 562. EXERCISES 2,3,4 MINIMUM PATH
• PAGE 598, EXERCISES 1 TO 3. TREES
• PAGE 612, EXERCISES 1 TO 5. BINARY SEARCH TREES
• PAGE 614 AND 615, EXERCISES 37 AND 38. TREES DECISION GAME

In problems 1-8 determine whether or not the corresponding graph contains an Eulerian circuit. If no
Eulerian circuit exists, determine whether the graph contains a change or not an Eulerian path and
construct one if it exists.
• PAGE 550. EXERCISES 1 TO 8 EULER AND HAMILTON

The graph has no Eulerian circuit and no Eulerian path

The graph has an Eulerian circuit; a, b, e, h, i, f, h, g, d, b, c, f, e, d, a. and a Eulerian path; a, b, e, h, i, f, h, g,


d, b, c, f, e, d, a.

The graph does not have Eulerian circuits. The graph has an Eulerian path; a, e, c, e, b, e, d, b, a, c, d .
The graph does not have an Eulerian circuit. The
graph has an Eulerian path; c, e, a, f, e,d, c, b, d, a, b,
f

The graph has a circuit and an Eulerian path; a, b, c, d, c, e, d, b, e, a, e, a.

The graph does not have an Eulerian circuit. The graph has an Eulerian path; c, i, h, a, d,e, f, d, g,
i, b, a, i, d, c, b

The graph has a circuit and an Eulerian path; a, i, h, g, d, e, f, g, c, e, h, d, c, a, b, i, c,b, h, a

The graph has an Eulerian circuit; l, k, f, a, b, d, e,


j, o, n, i, j, c, d, i, h, c, b, g, f, m, h,g, l, n, m, l.

• PAGE 562. EXERCISES 2,3,4 MINIMUM PATH


In Problems 2-4, determine the length of a path of minimum length between a and z
in the corresponding weighted graph.
minimum length =
7.

16

minimum length =
16.

minimum length
=16

• PAGE 598, EXERCISES 1 TO 3. TREES


1. Which of these graphs are trees

If it is a
tree

It's not a
tree

If it is a
tree

It's not a
tree
If it is a
tree

It's not a
tree

2. Which of these graphs are trees?

If it is a
tree
3. Answer the following questions regarding the rooted tree below.

a) What is the root vertex?


TO
b) What are the internal vertices?
A, b, c, d, f, h, j, q, t.
c) Which vertex are leaves?
e, g, i, k, l, m, n, o, p, r, s, u.
d) Which vertex are children of j?
Q, r.
e) Which vertex is the parent of h?
c.
f) Which vertex are siblings of o?
p.
g) What are the ancestors of m?
F, b, a.
h) What are the descendants of b?
E, f, l, m, n.

• PAGE 612, EXERCISES 1 TO 5. BINARY SEARCH TREES


1. Build a binary search tree for the words (banana, pear, plantain, coconut,
mango and papaya) using lexicographic order.
2. Build a binary search tree for the words (oncology,
psychology, cardiology, ichthyology, literature, alchemy and astrology)
using
the lexicographic order.
Oncology

Cardiology
Psycholog
y

Ichthyolo Literatur Alchemy Astrology


gy e

3. How many comparisons are necessary to locate or add each of these words in
the search tree of Problem 1 starting from the beginning each time?

a) Pear
b) Banana
c) Kiwi
d) Nettle

Answers:

a) Pear (3)
b) Banana (1)
c) Kiwi (4)
d) Nettle (5)
4. How many comparisons are necessary to locate or add each of the words in
the search tree of Problem 2, starting from the beginning each time?

a) Paleontology
b) Etymology
c) Parapsychology
d) Glaciology

Answers:
a) Paleontology (1)
b) Etymology (4)
c) Parapsychology (2)
d) Glaciology (7)
5. Using alphabetical order, construct a binary search tree for the words in the
phrase “I suggest melted white cheese or a Manchego square cheese.”
• PAGE 614 AND 615, EXERCISES 37 AND 38. TREES DECISION GAME
37. Draw the subtree of the three-line game tree starting at each of the
following positions. Calculate the value of each of these subtrees.
This figure is impossible: This position cannot appear in any
game.
38. Suppose that the first four moves of a three-line game are those shown in a
figure. Does the first player, whose moves are represented by X, have any strategies
that allow him to always win?

x eith x x eith x
eith er
x x eith er
x
er eith eith
eith
er er er
x eith x x eith x
x er
eith x eith er
x eith
x er eith eith eith eith x
Or Win er er er er
Empathize

x eith x x
eith er
eith x x eith x
er er er

Tie Or win
x eith x eith
er er
x eith x x eith x
x er eith x eith er
eith eith
eith x eith xer eith
er xer
er er er
x eith x eith eith x
x er
x eith er
x er
x
eith er eith eith
er er er
x eith x eith eith x
eith xer eith xer xer eith
eith eith x eith x x
er
Tie er erTie

x d)
x eit
he

x x x
x eitheith x eith eith
eith x eith er
x er
x
er er
x x x x eith eith
x eit eith eith x
eith xher eith
er er Or Win
er
X Win er
x x eith
Tie er Or win

You might also like