Question: 5 . 2 [ 2 p t ] Suppose that there is a 3 - regular graph ( i . e . each vertex is

5.2[2pt] Suppose that there is a 3-regular graph (i.e. each vertex is connected with an edge to three other vertices) with n vertices in total. To each vertex, we assign a random number from a uniform distribution over 0,1. Then we select a set of vertices using the following rule: a vertex will be selected if its random number is greater than the random numbers of all of its three neighbors. Write a function called vertices_selected that takes the number of vertices, n, as an input and returns the expected number of vertices that will be selected. For this question, the input n will always be such that a 3-regular graph is possible.
Hint: Use Trick #1 from the lecture about expectation, and let xi be the random variable that equals 1 if vertex i is selected and equals 0 if it is not selected.
In []: def vertices_selected(n):
# YOUR CODE HERE
raise NotImplementedError()
In []: #hidden tests for problem 5.2 are within this cell
5.3[1pt] Write a function called uni_variance that takes b and c as inputs and returns the variance of a uniform random variable over b,c. Hint: Use (i) the result about the variance of a uniform r.v. over 0,1, and (ii) Trick #2 from the lecture about variance.
In []: def uni_variance (b,c) :
# YOUR CODE HERE
raise NotImplementedError()
In []: #hidden tests for problem 5.3 are within this cell
 5.2[2pt] Suppose that there is a 3-regular graph (i.e. each vertex

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!