Question: 5 . 2 [ 2 p t ] Suppose that there is a 3 - regular graph ( i . e . each vertex is
Suppose that there is a regular graph ie each vertex is connected with an edge to three other vertices with vertices in total. To each vertex, we assign a random number from a uniform distribution over 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 verticesselected that takes the number of vertices, as an input and returns the expected number of vertices that will be selected. For this question, the input will always be such that a regular graph is possible.
Hint: Use Trick # from the lecture about expectation, and let be the random variable that equals if vertex is selected and equals if it is not selected.
In : def verticesselectedn:
# YOUR CODE HERE
raise NotImplementedError
In : #hidden tests for problem are within this cell
Write a function called univariance that takes and as inputs and returns the variance of a uniform random variable over Hint: Use i the result about the variance of a uniform rv over and ii Trick # from the lecture about variance.
In : def univariance :
# YOUR CODE HERE
raise NotImplementedError
In : #hidden tests for problem are within this cell
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
