\documentclass{article}

% Packages required to support encoding
\usepackage{ucs}
\usepackage[utf8x]{inputenc}

% Packages required by code


% Packages always used
\usepackage{hyperref}
\usepackage{xspace}
\usepackage[usenames,dvipsnames]{color}
\hypersetup{colorlinks=true,urlcolor=blue}

\input{preamble.tex}


\begin{document} 
\hypertarget{homework_3_1}{}\section*{{Homework 3}}\label{homework_3_1}

These problems are due in-class on November 3rd.

\hypertarget{problem_1_5_pts_2}{}\subsection*{{Problem 1 (5 pts)}}\label{problem_1_5_pts_2}

For a simple, undirected graph, show that the sum of the eigenvalues of its adjacency matrix must be equal to 0.\newline (This is a quick problem.)

\textbf{Solution} The trace of the matrix is 0 because there are no self-loops, so the sum of the eigenvalues is too.

\hypertarget{problem_2_10_pts_3}{}\subsection*{{Problem 2 (10 pts)}}\label{problem_2_10_pts_3}

You'{}ve recently been hired as a senior researcher at Bingle!, a new scrappy search startup. They want to test out some algorithms for weakly preferential PageRank because they don'{}t think that resetting ``{}everywhere''{} from a dangling node is a realistic model. However, they only have a routine to compute a strongly preferential PageRank vector. That is, they have a program {\colorbox[rgb]{1.00,0.93,1.00}{\tt pagerank\char40alpha\char44v\char41}} that solves the system

\begin{displaymath}
(\eye - \alpha \mPbar - \alpha \vv \vd^T) \vx = (1-\alpha)\vv
\end{displaymath}
on their distributed MapReduce cluster for their current crawl of the web. The matrix $\mPbar$ is a column sub-stochastic matrix from a hand-tuned random walk process on their web graph, and $\vd = \ve^T - \ve^T\mPbar$ is the dangling node vector\newline It'{}s very time-consuming and expensive to change that code (and so, for this problem, you cannot). They'{}ve asked you to determine if there is another way to compute weakly preferential PageRank.

Thankfully, you'{}ve taken CS-59000 NMC at Purdue, and this is your chance to shine and earn your yearly bonus early. Show how to compute a weakly preferential PageRank vector by using their {\colorbox[rgb]{1.00,0.93,1.00}{\tt pagerank\char40alpha\char44v\char41}} routine and one additional routine {\colorbox[rgb]{1.00,0.93,1.00}{\tt mult\char40x\char41}} which computes $\mPbar \vx$. Psst, the weakly preferential PageRank system is:

\begin{displaymath}
(\eye -\alpha \mPbar - \alpha \vu \vd^T) \vy = (1-\alpha) \vv.
\end{displaymath}
\textbf{Solution} The simplest way to solve the problem is to notice that we can convert $(\eye - \alpha \mPbar - \alpha \vv \vd^T) \vx = (1-\alpha) \vv$ into the solution of a PseudoRank system by computing: $\gamma = \vd^T \vx = \ve^T (\vx - \mP \vx)$, which involves a multiplication, a difference, and a summation. Thus, we find $\hat{\vx} = \vx/(1-\alpha + \alpha \gamma)$ satisfies

\begin{displaymath}
(\eye - \mPbar) \hat{\vx} = \vv.
\end{displaymath}
We can do the same thing with the solution of $(\eye - \alpha \mPbar - \alpha \vv \vd^T )\vw = (1-\alpha \vu$ as well. This means we have all the ingredients to apply the Sherman-Morrison formula. However, we can do better. (In fact, this is usually true when you apply the Sherman-Morrison formula --{} there is almost always a better way, so use it for intuition and not algorithms.)

Notice that

\begin{displaymath}
(\eye - \alpha \mPbar - \alpha \vu \vd^T ) \vx + \alpha \gamma \vu - \alpha \gamma \vv = (1-\alpha) \vv.
\end{displaymath}
Also, we have $\vu = (1-\alpha)^{-1} (\eye - \alpha \mPbar - \alpha \vu \vd^T) \vw.$ Consequently,

\begin{displaymath}
(\eye - \alpha \mPbar - \alpha \vu \vd^T ) (\vx + \frac{\alpha \gamma}{1-\alpha} \vw) = (1-\alpha + \alpha \gamma) \vv.
\end{displaymath}
At this point, we are basically done, because we have a linear combination of $\vx$ and $\vw$ that is equal to a multiple of $\vv.$ Because the solution must sum to one, we just have to normalize this vector and we are done.

Hence, the algorithm is:

\begin{enumerate}%
\item Compute {\colorbox[rgb]{1.00,0.93,1.00}{\tt x\char32\char61\char32pagerank\char40alpha\char44v\char41}}
\item Compute {\colorbox[rgb]{1.00,0.93,1.00}{\tt w\char32\char61\char32pagerank\char40alpha\char44w\char41}}
\item Compute {\colorbox[rgb]{1.00,0.93,1.00}{\tt gamma\char32\char61\char32sum\char40x\char32\char45\char32mult\char40x\char41\char41}}
\item Set {\colorbox[rgb]{1.00,0.93,1.00}{\tt y\char32\char61\char32x\char32\char43\char32alpha\char42gamma\char47\char40\char49\char45~alpha\char41\char42w}}
\item Update {\colorbox[rgb]{1.00,0.93,1.00}{\tt y\char32\char61\char32y\char47sum\char40y\char41}}

\end{enumerate}
\hypertarget{problem_3_10_pts_4}{}\subsection*{{Problem 3 (10 pts)}}\label{problem_3_10_pts_4}

Google recently announced a change in how they process {\colorbox[rgb]{1.00,0.93,1.00}{\tt rel\char61nofollow}} links on the web. Please read about it here: \url{http://www.mattcutts.com/blog/pagerank-sculpting/} Mathematically describe how this change affects how Google constructs the matrix $\mP$ for PageRank.

\textbf{Solution}

Let $\mA_1$ be the graph of links without no-follow and $\mA_2$ be the graph of links with no-follow, and let $\mD_1$ and $\mD_2$ be the respective degree matrices. . Then the original PageRank formulation used $\mA_1$ as the web-graph and normalized it as $\mD_1^{-1} \mA_1$ to get a random walk. The new formulation uses $(\mD_1 + mD_2)^{-1} \mA_1$ to normalize the walk.

\hypertarget{problem_4_10_pts_5}{}\subsection*{{Problem 4 (10 pts)}}\label{problem_4_10_pts_5}

Bingle! is back with another problem. One of their interns implemented a super-duper fast routine to compute a PseudoRank vector:

\begin{displaymath}
(\eye - \alpha \mPbar) \vy = \vv.
\end{displaymath}
This intern claimed that they could replace all their PageRank computations using this routine if they just normalized $\vy$, i.e. $\vx = \vy/\normof{\vy}$. Unfortunately, the intern was hired by the White House to help manage the government'{}s data efforts and left without justifying this result. There is apparently no time left to handle Bingle!'{}s email'{}s marked URGENT!

And so, they come to you. Can you solve the mystery of the normalization? To be precise, show exactly that $\normof{\vy}$ is the correct adjustment to $\vy$.

\textbf{Solution} This is implicit in the first problem. The key is to show that $\ve^T \vy = \frac{1-\alpha \vd^T \vy}{1-\alpha}$ by using $\ve^T \mPbar \vy = \ve^T \vy - \vd^T \vy$ and $\ve^T \vy = \alpha \ve^T \mPbar \vy + 1$. Then show that $\vx = \frac{1-\alpha}{1-\alpha \vd^T \vy} \vy$ solves $(\eye - \alpha \mPbar - \alpha \vv \vd^T) \vx = (1-\alpha) \vv$.

\hypertarget{problem_5_5_pts_6}{}\subsection*{{Problem 5 (5 pts)}}\label{problem_5_5_pts_6}

Tell me your preferred ranking of the following days for the in-class presentations:

\begin{itemize}%
\item November 15th
\item November 22nd
\item November 29th
\item December 1st

\end{itemize}
Rank each day from 1-4. There is no guarantee I'{}ll be able to assign you to the day you'{}d like, but we'{}ll see what we can do.

Due to scheduling details at the end of class, we will have to adjust the length of the presentations. We need two people to volunteer to split their presentation over two days (so we can do 2.5 presentations a day). If you'{}d be willing to split your presentation, please let me know.


\end{document}
