\documentclass[10pt]{article}
\usepackage{fullpage}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[english]{babel}
\usepackage[capitalize, noabbrev]{cleveref}
\usepackage{paralist} 

% these are compressed lists to help fit into a 1 page limit
\newenvironment{enumerate*}%
  {\vspace{-2ex} \begin{enumerate} %
     \setlength{\itemsep}{-1ex} \setlength{\parsep}{0pt}}%
  {\end{enumerate}}
 
\newenvironment{itemize*}%
  {\vspace{-2ex} \begin{itemize} %
     \setlength{\itemsep}{-1ex} \setlength{\parsep}{0pt}}%
  {\end{itemize}}
 
\newenvironment{description*}%
  {\vspace{-2ex} \begin{description} %
     \setlength{\itemsep}{-1ex} \setlength{\parsep}{0pt}}%
  {\end{description}}

\DeclareMathOperator*{\E}{\mathbb{E}}
\let\Pr\relax
\DeclareMathOperator*{\Pr}{\mathbb{P}}

\newcommand{\inprod}[1]{\left\langle #1 \right\rangle}
\newcommand{\eqdef}{\mathbin{\stackrel{\rm def}{=}}}
\newcommand{\llbracket}{[\![}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}

\author{Thibaut Horel \& Paul Tylkin}
\title{Economics 2099 Problem Set 1 -- Solutions}

\begin{document}

\maketitle

\section{Exercise 2.5}
\begin{enumerate}[(a)]
\item We are analyzing the scenario when agent 1 has values in $U[0,1]$ and agent $U[0,\frac{1}{2}]$. Informally, we are considering two different scenarios: one in which agent 1's value exceeds $\frac{1}{2}$, and one in which his value is less than $\frac{1}{2}$. In the first scenario, agent 1 will always win.

We formalize this as follows. We first calculate the strategies for each agent.

Because we are looking for a Bayes-Nash equilibrium in which the item is always allocated to the agent with the highest value, we can consider $\Pr[v_1 \geq v_2]$ as the probability that the item is allocated to agent 1.

For agent 1, $$\Pr[v_1 \geq v_2] = \begin{cases} 1 &\text{ if } v_1 > \frac{1}{2} \\ v_1 &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$

$$P_1^{FP}(v_1) = s_1(v_1)\cdot \Pr[v_1 \geq v_2] = s_1(v_1) \cdot  \begin{cases} 1 &\text{ if } v_1 > \frac{1}{2} \\ v_1 &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$

For agent 1, $P_1^{SP}(v_1)$ equals $\E[v_2|v_1\geq v_2]\cdot \Pr[v_1 \geq v_2]$. By Revenue Equivalence (Corollary 2.5), for $i \in \{1,2\}$, $P_i^{SP}(v_i) = P_i^{FP}(v_i)$. 

We directly compute $$\E[v_2|v_1\geq v_2] =  \begin{cases} \frac{1}{4} &\text{ if } v_1 > \frac{1}{2} \\ \frac{v_1}{2} &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$

Combining this, we get

$$P_1^{SP}(v_1) = \E[v_2|v_1\geq v_2]\cdot \Pr[v_1 \geq v_2] = \begin{cases} \frac{1}{4} &\text{ if } v_1 > \frac{1}{2} \\ \frac{v_1^2}{2} &\text{ if } v_1  \leq \frac{1}{2} \end{cases}.$$ So we get $$s_1(v_1) = \begin{cases} \frac{1}{4} &\text{ if } v_1 > \frac{1}{2} \\ \frac{v_1}{2} &\text{ if } v_1  \leq \frac{1}{2} \end{cases}.$$ For agent 2, the only case to consider is $v_1 \leq \frac{1}{2}$ (since otherwise agent 2's probability of winning is 0). This case is exactly the same as for agent 1, conditioned on $v_1 \leq \frac{1}{2}$. This leads to $$s_2(v_2) = \frac{v_2}{2}.$$ We need to show two more things: that the strategies we obtain satisfy the restriction that the item is allocated to the agent with the highest value, and that there are no other strategies that dominate the strategy profile described above.

If $v_1 > \frac{1}{2}$, then $v_1$ will bid $\frac{1}{4}$ which is greater than or equal to any bid that agent 2 may have, so agent 1 will be allocated the item. If $v_1 \leq \frac{1}{2}$ and $v_1 > v_2$ then $\frac{v_1}{2} > \frac{v_2}{2}$ and he will again be allocated the item. If $v_1 \leq \frac{1}{2}$ and $v_1 < v_2$ then $\frac{v_1}{2} < \frac{v_2}{2}$ and agent 2 will be allocated the item, as desired. 

Suppose that agent 1 bids greater than $\frac{1}{4}$. Then, his probability of winning does not increase (it is 1 at a bid of $\frac{1}{4}$, and so he pays more without increasing the probability of winning (his utility strictly decreases with a higher bid). Suppose that agent 2 bids greater than $\frac{1}{4}$. Since the largest possible value that agent 2 can have is $\frac{1}{4}$, for any bid greater than $\frac{1}{4}$, he pays more than his value and hence his utility is negative. 

So we have demonstrated that there is a Bayes-Nash Equilibrium.

\item We are analyzing the scenario when agent 1 has values in $U[0,1]$ and agent 2 has values in $U[\frac{1}{2},1]$. There are again two scenarios to consider: one in which agent 1's value exceeds $\frac{1}{2}$, and one in which his value is less than $\frac{1}{2}$. In the first scenario, agent 1 will always lose (i.e. agent 2 will always win).

For agent 1,$$\Pr[v_1 \geq v_2] = \begin{cases} \int_{\frac{1}{2}}^{v_1} 2\,dx = 2v_1 -1 &\text{ if } v_1 > \frac{1}{2} \\ 0 &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$ $$P_1^{FP}(v_1) = s_1(v_1)\cdot \Pr[v_1 \geq v_2] = s_1(v_1) \cdot  \begin{cases} 2v_1 - 1 &\text{ if } v_1 > \frac{1}{2} \\ 0 &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$

For agent 1, $P_1^{SP}(v_1)$ equals $\E[v_2|v_1\geq v_2]\cdot \Pr[v_1 \geq v_2]$. By Revenue Equivalence (Corollary 2.5), for $i \in \{1,2\}$, $P_i^{SP}(v_i) = P_i^{FP}(v_i)$. 

We directly compute $$\E[v_2|v_1\geq v_2] =  \begin{cases} \int_{\frac{1}{2}}^{v_1} 2x\,dx = v_1^2 - \frac{1}{4} &\text{ if } v_1 > \frac{1}{2} \\ 0 &\text{ if } v_1  \leq \frac{1}{2} \end{cases}$$

Thus, 
$$s_1(v_1) = v_1^2-\frac{1}{4} \text{ if } v_1 > \frac{1}{2}.$$

For agent 2,  $$\Pr[v_2 \geq v_1] =  \int_{0}^{v_2}\,dx = v_2$$

Computing $$\E[v_1|v_2\geq v_1] =  \int_0^{v_2} x\,dx = \frac{v_2^2}{2}$$

So $$s_2(v_2) = \frac{v_2^2}{2}.$$

We will show a counterexample to the requirement that the item it always allocated to the agent with the highest value. Specifically, we will exhibit a scenario where $v_1 < v_2$ but $s_1(v_1) > s_2(v_2)$ and so agent 1 will be allocated the item despite having a lower valuation. Let $v_1 = \frac{7}{8}$ and let $v_2 = 1$. Then, $$s_1(v_1) = \frac{49}{64} - \frac{16}{64} = \frac{33}{64}$$ but $$s_2(v_2) = \frac{1}{2.}$$ Therefore, no Bayes-Nash Equilibrium with the desired properties can exist.

\end{enumerate}

\section{Exercise 2.10}

We first try to find a symmetric Bayes-Nash equilibrium. Let us assume that
such a symmetric equilibrium exists and let us denote by $s$ the common
strategy of the agents. Using the payment identity of Theorem 2.10, we have:
\begin{displaymath}
    p_i(v_i) = v_ix_i(v_i) - \int_0^{v_i} x_i(z)dz,\quad i\in\{1,2\}
\end{displaymath}
Since bidders pay their bids when they are served, we can write $p_i(v_i)
= s(v_i)x_i(v_i)$ and obtain:
\begin{equation}\label{eq:strag}
    s(v_i) = v_i - \frac{\int_0^{v_i} x_i(z)dz}{x_i(v_i)},\quad i\in\{1,2\}
\end{equation}

We now compute $x_1(v_1)$; the situation being symmetric, $x_2(v_2)$ can be
computed by replacing $1$ by $2$ and vice versa in what follows. By
conditioning on whether agent $1$ wins, we get:
\begin{displaymath}
    x_1(v_1) = w_1 \Pr[s(v_1)\geq s(v_2)] + w_2\Pr[s(v_1)\leq s(v_2)]
\end{displaymath}
By assumption, $s$ is strictly increasing. Hence, $\Pr[s(v_1)\geq s(v_2)]
= \Pr[v_1 \geq v_2]$ and similarly,
$\Pr[s(v_1) \leq s(v_2)] = \Pr[v_1\leq v_2]$. Now, denoting by $F$ the
distribution of the agent's values, we can rewrite:
\begin{displaymath}
    x_1(v_1) = w_1F(v_1) + w_2\big(1-F(v_1)\big) = w_2 + (w_1-w_2)F(v_1)
\end{displaymath}
Combining this with \cref{eq:strag} yields:
\begin{displaymath}
    s(v_i) = v_i - \frac{w_2v_i + (w_1 - w_2)\int_0^{v_i} F(z)dz}{w_2 + (w_1
    - w_2)F(v_i)}
\end{displaymath}
Rearranging the right hand side, we get:
\begin{equation}\label{eq:strag2}
    s(v_i) = \frac{(w_1 - w_2)\big(v_iF(v_i) - \int_0^{v_i} F(z)dz\big)}{w_2 + (w_1
    - w_2)F(v_i)}
\end{equation}
Finally, using integration by parts, we see that:
\begin{displaymath}
    \int_0^{v_i} F(z)dz = v_iF(v_i) - \int_0^{v_i}zf(z)d(z)
\end{displaymath}
where $f(z) = F'(z)$ denotes the density function of $F$. This, in addition to
\cref{eq:strag2} leads to the following expression for our candidate strategy:
\begin{displaymath}
    \boxed{
    s(v_i) = \frac{(w_1 - w_2)\big(\int_0^{v_i} zf(z)dz\big)}{w_2 + (w_1
    - w_2)F(v_i)}
}
\end{displaymath}

Let us now verify that $s$ is indeed increasing. We compute:
\begin{displaymath}
    s'(v_i) = \frac{(w_1-w_2)v_if(v_i)\big(w_2 + (w_1-w_2)F(v_i)\big)
    - (w_1-w_2)\big(\int_0^{v_i}zf(z)dz\big)(w_1-w_2)f(v_i)}{\big(w_2+(w_1-w_2)F(v_i)\big)^2}
\end{displaymath}
We only care about the sign of the numerator, because the denominator is always
positive. Rearranging the terms, it is
equal to:
\begin{displaymath}
    (w_1-w_2)w_2v_if(v_i) + (w_1-w_2)^2f(v_i)\left(v_iF(v_i)
    - \int_0^{v_i}zf(z)dz\right)
\end{displaymath}
It is easy to see that this quantity is non-negative since the term inside the
rightmost parentheses is equal to $\int_0^{v_i}F(z)dz$ using the same integration by
parts as above.

As noted above, $s$ being increasing implies that the allocation rule of
the position auction with strategy $s$ is also increasing. By design, $s$
satisfies the payment identity of Theorem 2.10. But we cannot conclude that $s$
is a Bayes-Nash equilibrium yet because it is not onto. However, we can show
that bids which are not attained by $s$ are dominated. Since $s$ is
non-decreasing, its maximum value is:
\begin{displaymath}
    s(1) = \frac{(w_1-w_2)\int_0^1 zf(z)dz}{w_1}
\end{displaymath}
Let us show that bids above $s(1)$ are dominated by $s(1)$. The utility of an
agent with value $v$ when bidding $s(1)$ is $u = w_1\big(v-s(1)\big)$ since he will be
allocated to the first position in this case. Then consider a bid $b>s(1)$; the
utility in this case will be $u' = w_1(v-b)$ which is less than $u$.

We have now established the uniqueness of a symmetric Bayes-Nash equilibrium.
Furthermore we can rule out the possibility of assymetric strategy profiles by
applying verbatim the proof of Theorem 2.10.

\section{Exercise 3.1}

We recall that the virtual value function for agent $i$ is defined as $$\phi_i(v_i) = v_i - \frac{1 - F_i(v_i)}{f_i(v_i)}$$ for a cumulative density function $F_i(v_i)$ and density function $f_i(v_i)$, with $F_i'(v_i) \stackrel{\text{def}}{=} f_i(v_i)$. The virtual function satisfies the following relationship:
\begin{equation}\label{eq:virt}
    \E[p_i(v_i)] = \E[\phi_i(v_i)x_i(v_i)].
\end{equation}
If the residual surplus is $$\sum_i \left(v_ix_i - p_i\right) - c({\mathbf x}),$$ where $x_i$ is the probability that agent $i$ will be allocated the item and $c({\mathbf x})$ is the service cost, and so if we want to maximize this, we are maximizing

\begin{align*}
    \E\left[\sum_i \left(v_ix_i(v_i) - p_i(v_i)\right)\right] =  
    \sum_i\E\big[v_ix_i(v_i)-p_i(v_i)\big]
\end{align*}
Using \cref{eq:virt}, this is equal to:
\begin{displaymath}
    \sum_i\E\big[x_i(v_i)(v_i-\phi_i(v_i))\big] =
    \sum_i\E\big[x_i(v_i)h_i(v_i)\big]
\end{displaymath}
where we defined $h_i(v_i)$ to be the inverse of the hazard rate function:
\begin{displaymath}
    h_i(v_i) \eqdef \frac{1-F_i(v_i)}{f_i(v_i)}
\end{displaymath}

Note that by assumption, $h_i$ is non-increasing (since the harzard rate function
is non-decreasing). Hence, we need to consider $\bar{h_i}$, the function obtained
by ironing $h_i$. Since $h_i$ is non-increasing, we have to apply the ironing
procedure to the whole interval of values, leading to a constant ironed
function $\bar{h_i} = c_i$. We will call $c_i$ the \emph{ironed constant} of
agent $i$.

By construction, the mechanism maximizing residual surplus is the VSM mechanism
where we use the $(c_1,\ldots,c_n)$ as virtual functions. Note that it is easy
to see in this case that truth telling is a dominant strategy equilibrium: the
mechanism ignores the bids of the players and only allocates based on the
ironed constants



\section{Exercise 3.4}

\begin{enumerate}[(a)]

\item By the definition of virtual functions, we will maximize revenue when we maximize the virtual surplus (this follows from the definition $\E[p_i(v_i)] = \E[\phi_i(v_i)x_i(v_i)]$. Following Definition 3.5, we can do this via the VSM (VCG) mechanism. So in particular, we are trying to solve the following maximization problem:

$$\max \left[ \sum_i x_i\phi_i(v_i) -  c({\mathbf x}) \right].$$ According to the given cost structure (either every agent is served or none of the agents are served), this means that we will only allocate to the agents (to maximize revenue) when $$\sum_{i=1}^n \phi_i (v_i) \geq 0,$$ because otherwise we can allocate to none of the agents and have revenue of $0$. So to summarize our mechanism is as follows:

$$\begin{cases} \text {allocate to all agents if } &\sum_{i=1}^n \phi_i (v_i) \geq 0 \\ \text {allocate to none of the agents if } &\sum_{i=1}^n \phi_i (v_i) < 0\end{cases}$$

\item If all of the agents' values are i.i.d. from U[0,1], then the agents' virtual functions are given by $$\phi_i(v_i) = (2v_i - 1),$$ and so we will allocate to all agents only if \begin{align*} &\sum_{i=1}^n (2v_i - 1) \geq 0 \\ &\implies \left(2\sum_{i=1}^n v_i \right)- n \geq 0 \\ &\implies \sum_{i=1}^n v_i \geq \frac{n}{2}. \end{align*} So to summarize, our mechanism is: 

$$\begin{cases} \text {allocate to all agents if } &\sum_{i=1}^n v_i \geq \frac{n}{2} \\ \text {allocate to none of the agents if } &\sum_{i=1}^n v_i < \frac{n}{2}\end{cases}.$$

\end{enumerate}

\end{document}
