CS 70 Discrete Mathematics and Probability Theory Fall 2020 HW 3Python

Java Python CS 70

Discrete Mathematics and Probability Theory

Fall 2020 HW 3

Due: Sunday 09/20 at 10:00 PM

Grace period until Sunday 09/20 at 11:59 PM

Sundry

Before you start writing your final homework submission, state briefly how you worked on it. Who else did you work with? List names and email addresses. (In case of homework party, you can just describe the group.)

1    Graph Basics

In the first few parts, you will be answering questions on the following graph G.

(a) What are the vertex and edge sets V and E for graph G?

(b) Which vertex has the highest in-degree?  Which vertex has the lowest in-degree?  Which ver- tices have the same in-degree and out-degree?

(c) What are the paths from vertex B to F, assuming no vertex is visited twice? Which one is the shortest path?

(d) Which of the following are cyclesin G?

i.  (B; C); (C;D); (D;B)

ii.  (F; G); (G; F)

iii.  (A;B); (B; C); (C;D); (D;B)

iv.  (B; C); (C;D); (D;H); (H ; G); (G; F); (F; E); (E ;D); (D;B)

(e) Which of the following are walksin G?

i.  (E ; G)

ii.  (E ; G); (G; F)

iii.  (F; G); (G; F)

iv.  (A;B); (B; C); (C;D); (H ; G) v.  (E ; G); (G; F); (F; G); (G; C)

vi.  (E ;D); (D;B); (B; E); (E ;D); (D;H); (H ; G); (G; F)

(f) Which of the following are tours in G?

i.  (E ; G)

ii.  (E ; G); (G; F)

iii.  (F; G); (G; F)

iv.  (E ;D); (D;B); (B; E); (E ;D); (D;H); (H ; G); (G; F)

In the following three parts, let’s consider a general undirected graph G with n vertices (n ≥ 3).

(g) True/False: If each vertex of G has degree at most 1, then G does not have a cycle.

(h) True/False: If each vertex of G has degree at least 2, then G has a cycle.

(i) True/False: If each vertex of G has degree at most 2, then G is not connected.

2   Binary Trees

You have seen the recursive definition of binary trees from lecture and from previous classes. Here, we define binary trees in graph theoretic terms as follows (Note: here we will modify the definition of leaves slightly for consistency).

• A binary tree of height > 0 is a tree where exactly one vertex, called the root, has degree 2, and all other vertices have degrees 1 or 3. Each vertex of degree 1 is called a leaf. The height his defined as the maximum length of the path between the root and any leaf.

• A binary tree of height 0 is the graph with a single vertex.  The vertex is both a leaf and a root.

(a) Let T be a binary tree of height > 0, and leth(T ) denote it’s height. Let r be the root in T and u and v be it’s neighbors.  Show that removing r from T will result in two binary trees, L;R with ro CS 70 Discrete Mathematics and Probability Theory Fall 2020 HW 3Python ots uand v respectively. Also, show that h(T ) = max (h(L); h(R))+ 1

(b) Using the graph theoretic definition of binary trees, prove that the number of vertices in a binary tree of height his at most 2h+1 - 1

(c) Prove that all binary trees with n leaves have 2n - 1 vertices

3   Proofs in Graphs

Please prove or disprove the following claims.

(a)  On the axis from San Francisco traffic habits to Los Angeles traffic habits, Old California is more towards San Francisco:  that is,  civilized.  In Old California, all roads were one way streets. Suppose Old California hadn cities (n ≥ 2) such that for every pair of cities X and Y , either X had a road to Y or Y had a road to X. Prove or disprove that there existed a city which was reachable from every other city by traveling through at most 2 roads.

[Hint: Induction]

(b) In lecture, we have shown that a connected undirected graph has an Eulerian tour if and only if every vertex has even degree.

Consider a connected graph G with n vertices which has exactly 2m vertices of odd degree, where m > 0. Prove or disprove that there are m walks that together cover all the edges of G (i.e., each edge of G occurs in exactly one of them walks, and each of the walks should not contain any particular edge more than once).

4   Planarity

(a) Prove that K3;3 is nonplanar.

(b)  Consider graphs with the property T :  For every three distinct vertices v1 ; v2 ; v3  of graph G, there are at least two edges among them.  Use a proof by contradiction to show that if G is a graph on ≥ 7 vertices, and G has property T , then G is nonplanar.

5   Always, Sometimes, or Never

In each part below, you are given some information about the so-called original graph, OG. Using only the information in the current part, say whether OG will always be planar, always be non- planar, or could be either.  If you think it is always planar or always non-planar, prove it.  If you think it could be either, give a planar example and a non-planar example.

(a) OG can be vertex-colored with 4 colors.

(b) OG requires 7 colors to be vertex-colored.

(c) e ≤ 3v - 6, where e is the number of edges of OG and vis the number of vertices of OG.

(d) OG is connected, and each vertex in OG has degree at most 2.

(e) Each vertex in OG has degree at most 2.

6   Touring Hypercube

In the lecture, you have seen that if G is a hypercube of dimension n, then

• The vertices of G are the binary strings of length n.

u and v are connected by an edge if they differ in exactly one bit location.

A Hamiltonian tour of a graph is a sequence of vertices v0;v1 ; . . . ; vk such that:

• Each vertex appears exactly once in the sequence.

• Each pair of consecutive vertices is connected by an edge.

v0 and vk are connected by an edge.

(a)  Show that a hypercube has an Eulerian tour if and only if n is even. (Hint: Eulers theorem)

(b)  Show that every hypercube has a Hamiltonian tour         

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值