# Final F1B

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click
📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could print the page: , solve the problems, then enter all your answers at the end.
📗 Please do not refresh the page: your answers will not be saved. You can save and load your answers (only fill-in-the-blank questions) using the buttons at the bottom of the page.

# Warning: please enter your ID before you start!


# Question 1



# Question 2



# Question 3



# Question 4



# Question 5



# Question 6



# Question 7



# Question 8



# Question 9



# Question 10



📗 [4 points] Suppose K-Means with \(K = 2\) is used to cluster the data set and initial cluster centers are \(c_{1}\) = and \(c_{2}\) = \(x\). What is the smallest value of \(x\) if cluster 1 has \(n\) = points initially (before updating the cluster centers). Break ties by assigning the point to cluster 2.

📗 Note: the red points are the cluster centers and the other points are the training items.
Hint The \(n\) points on the left (or right, depending on the question) should be assigned to cluster 1. The \(n + 1\)-th point (call it \(x_{n + 1}\) from the left (or right) can be equidistant from cluster 1 center and cluster 2 center because if the distances to the clusters are the same, the point is assigned to cluster 2 due to the tie-breaking rule. Therefore, \(x_{n + 1} = \dfrac{1}{2} \left(c_{1} + c_{2}\right)\) can be used to solved for \(c_{2}\).
📗 Answer: .
📗 [4 points] There are lights in a row. The initial state is , 0 is "off", 1 is "on". A valid move finds two adjacent lights where one is on and the other is off, and switches them while keeping all other lights the same. That is, locally, you may do 01 to 10 or 10 to 01. What is the smallest number of moves to reach the goal state .
Hint See Fall 2013 Final Q20, Fall 2010 Midterm Q4. "Moving" a light from position \(i\) to position \(j\) requires at least \(j - i\) steps. All the lights need to be moved from the current position to the "correct" position specified by the goal state.
📗 Answer: .
📗 [4 points] Imagine a population of \(N\) = individuals. Each of them simultaneously chooses between taking the vaccine and not. All individuals have the same payoffs. Suppose there are \(n\) people who choose not to take the vaccine, then the payoff from not taking the vaccine is \(- \alpha \cdot \dfrac{n}{N}\), and the payoff from taking the vaccine is \(- c - \beta \cdot \dfrac{n}{N}\), \(\alpha\) = is the herd immunity coefficient, \(\beta\) = measures the ineffectiveness of the vaccine, and \(c\) = is the cost of getting the vaccine. In a Nash equilibrium, what is the largest number of individuals who choose NOT to take the vaccine?
📗 Note: \(n\) is the number of people NOT taking the vaccine, and the question is asking for the largest number of individuals who choose NOT to take the vaccine.
Hint
📗 Answer: .
📗 [2 points] You performed PCA (Principal Component Analysis) in \(\mathbb{R}^{3}\). If the first principal component is \(u_{1}\) = \(\approx\) and the second principal component is \(u_{2}\) = \(\approx\) . What is the new 2D coordinates (new features created by PCA) for the point \(x\) = ?

📗 In the diagram, the black axes are the original axes, the green axes are the PCA axes, the red vector is \(x\), the red point is the reconstruction \(\hat{x}\) using the PCA axes.
Hint See Fall 2018 Midterm Q13, Fall 2017 Final Q10. Coordinate \(i\) is given by the projection of \(x\) onto the principal component \(v_{i}\). If the principal component is a unit vector \(u_{i}\), use the simplified formula: \(u_{i^\top} x\); otherwise, use the formula: \(\dfrac{v_{i^\top} x}{v_{i^\top} v_{i}}\).
📗 Answer (comma separated vector): .
📗 [4 points] You are given the distance table. Consider the next iteration of hierarchical clustering using linkage. What will the new values be in the resulting distance table corresponding to the new clusters? If you merge two columns (rows), put the new distances in the column (row) with the smaller index. For example, if you merge columns 2 and 4, the new column 2 should contain the new distances and column 4 should be removed, i.e. the columns and rows should be in the order (1), (2 and 4), (3).
\(d\) =
Hint See Spring 2017 Midterm Q4. The resulting matrix should have 4 columns and 4 rows. Find the smallest non-zero number in the pair-wise distance matrix, suppose row \(i\) and column \(j\), merge columns \(i\) and \(j\) and rows \(i\) and \(j\) at the same time: for single linkage, take the minimum of the numbers in the two rows and columns; for complete linkage, take the maximum.
📗 Answer (matrix with multiple lines, each line is a comma separated vector): .
📗 [4 points] Imagine a world where each person has friends. Alice and Bob are \(d\) = "friendship links" away (i.e. if \(d\) = 1, Alice and Bob are friends; if \(d\) = 2, there is a third person X such that Alice and X are friends, and Bob and X are friends; and so on). Imagine a breadth first search (BFS) algorithm that has access to the friendship links. The algorithm starts at Alice and the goal is to find Bob. In the worst case, how many people (the same person visited multiple times are counted as multiple visits) the algorithm needs to visit (including Alice and Bob)?
Hint See Fall 2018 Midterm Q1, Fall 2016 Midterm Q1, Fall 2010 Final Q3. If the goal is the "last" node visited, then the number of nodes visited is the same as the total number of nodes in a complete tree with depth \(d\) and branching factor \(b\), which is \(\displaystyle\sum_{i=0}^{d} b^{i}\).
📗 Answer: .
📗 [4 points] In simulated annealing we move from \(s\) to an inferior neighbor \(t\) with probability \(\exp\left(\dfrac{- \left| f\left(s\right) - f\left(t\right) \right|}{T}\right)\), where \(T\) is the temperature parameter. Suppose \(f\left(s\right)\) = and \(f\left(t\right)\) = and \(T\) = . What is the probability we move to \(t\)?
📗 Note: we are minimizing the score.
Hint See Fall 2017 Midterm Q11. If \(f\left(s\right) > f\left(t\right)\), the probability of leaving is 1. If \(f\left(s\right) \leq f\left(t\right)\), the probability of leaving is \(\exp\left(\dfrac{- \left| f\left(s\right) - f\left(t\right) \right|}{T}\right)\). The probability of staying is 1 minus the probability of leaving.
📗 Answer: .
📗 [4 points] Given the following BoS (Battle of Sexes) game, what is the row (Romeo) player's (expected) value (i.e. payoff) in the mixed strategy Nash equilibrium?
Romeo \ Juliet Bach Stravinsky
Bach
Stravinsky

Hint
📗 Answer: .
📗 [4 points] What is the row player's value in a Nash equilibrium of the following zero-sum normal form game? A (row) is the max player, B (col) is the min player. If there are multiple Nash equilibria, use the one with the largest value (to the max player).
A \ B I II III IV
I        
II        
III        
IV        

Hint See Fall 2012 Final Q18, Fall 2006 Midterm Q12. Circle the largest number of each column and the smallest number of each row: the action pairs corresponding to the elements with two circles are the Nash equilibria. The action corresponding to a circled element is called the best response: a Nash equilibrium is when two actions are best responses to each other.
📗 Answer: .
📗 [1 points] Please enter any comments including possible mistakes and bugs with the questions or your answers. If you have no comments, please enter "None": do not leave it blank.
📗 Answer: .

# Grade


 * * * *


 * * * *
 

# Warning: remember to submit this on Canvas!


📗 Please copy and paste the text between the *s (not including the *s) and submit it on Canvas, F1B.
📗 Please save a copy as text file using the button or just copy and paste it into a text file.
📗 You could load your answers using the button from the text field:







Last Updated: July 14, 2024 at 8:38 PM