﻿ 离散数学课业代写 Python代写 - Python代写, 数学代写

# 离散数学课业代写 Python代写

2022-03-11 14:33 星期五 所属： Python代写 浏览：288 ## Instructions

Answer all questions on paper or a tablet using your own handwriting. Please number each page Include a cover page with your name, student ID number and a list of the questions you have answered.

• Sections: 11.1, 11.2, 3.4, 3.5, 3.6

Definitions, Concepts & Keywords

• Understand more terminology for graphs and trees.
• Know when two paths, cycles, graphs, and trees are not the same.
• Can calculate basic probabilities for discrete events.

### Exercises  离散数学课业代写

Section 11.1 Exercises 5.

Section 11.2 Exercises 9(a), 12(b).

Section 3.4 Exercises 6, 9.

Section 3.5 Exercises 10 (omit Pr(A △ B)).

Section 3.6 Exercises 2, 8.

### Instructors Questions  离散数学课业代写

1.For a positive integer n, what is the value of the counter after the following code has been executed. (Both C and Python code are included, use the language you are familiar with.)

C code:

```int i,j,k,counter;
counter = 0;
for( i=1; i<=n; i++ )
for( j=1; j<=i; j++ )
for( k=1; k<=j; k++ )
counter ++;```

python code:

```counter = 0
for i in range(1,n+1):
for j in range(1,i+1):
for k in range(1,j+1):
counter = counter + 1```

2.Consider the graph G with vertices V = {1, 2, 3, 4, 5} and edges E = {{1, 2}, {2, 3}, {3, 1}, {3, 4}, {4, 5}, {5, 1}}.

(a) Draw G.

(b) How many cycles does G have? List them.

(c) Is G bipartite? Explain.

(d) Give a spanning subgraph of G that is a tree.

(e) Draw the subgraph of G induced by the vertices {2, 4, 5}.

#### 3.  离散数学课业代写

A graph G = (V, E) is called regular if every vertex in G has the same degree. Draw a graph with 6 vertices where

(a) every vertex has degree 1

(b) every vertex has degree 2

(c) every vertex has degree 3

(d) every vertex has degree 4

4.Up to isomorphism, find all unlabelled graphs on 5 vertices with 5 edges.

5.Let n and k be integers with 3 ≤ k ≤ n.

How many cycles of length k are there in the complete graph Kn?

Hint: we can select a cycle of length k from Kn by choosing a sequence of k distinct vertices

v1, v2, . . . , vk and then selecting the cycle with vertex set {v1, . . . , vk} and edge set {{v1, v2}, . . . , {vk1, vk}, {vk, v1}}. It will help to determine (to avoid over-counting) for each cycle of length k how many sequences select this cycle.

9.Suppose 6 men and 6 women attend a party.

The host wants to select some of the 12 guests to play a game.

(a) If the host chooses two guests at random, what is the probability of choosing two women?

(b) If the host chooses two guests at random, what is the probability of choosing one man and one woman?

(c) If the host chooses four guests at random, what is the probability of choosing two women and two men? You should get 5/11.

#### 10.

At a university there are 300 first year computing majors. Suppose 100 can program in Python, 60 can program in Java, 80 can program in C++, 20 can program in Python and Java, 20 can program in Java and C++, 10 can program in Python and C++ and none can program in all three languages.

(a) If a student is selected at random, what is the probability that they can program in exactly 2 languages.

(b) If a student is selected at random, what is the probability that they can only program in Python?

(c) If two students are picked at random, what is the probability they can both program in Java? Hint: use a Venn diagram.

#### 11.  离散数学课业代写

Let S be a finite sample space and A, B and C be subsets of S.

(a) In class we showed that

Pr(A ∪ B) = Pr(A) + Pr(B) − Pr(A ∩ B).

Generalize this to find a formula for Pr(A ∪ B ∪ C).

(b) Let set S = {1, 2, . . . , 60}. Using the formula from part (a), find the probability of choosing x ∈ S that is divisible by 2 or 3 or 5. You should get 11/15.

12.A US company has developed an antibody test for whether a person has had COVID.If a person has had COVID, the probability that the test is positive is 0.98. If a person has NOT had COVID, the probability that the test if positive is 0.03. Suppose 10% of Americans have had COVID – which will probably be true by the time you are reading this. Use Bayes’ theorem to determine the probability that an American who tests positive has had COVID. 