Vickrey Auction question I'm looking at this webpage here:
https://gilkalai.wordpress.com/2013/05/18/test-your-intuition-21-auctions/

I've generated the R code below to simulate the value for each Bidder 1000's times. I'm trying to figure out the optimal allocation strategy as well as the expected revenue.  

Assuming a Vickrey Auction, it seems that the sample space is as follows:

Event         Probability     Revenue 
3x300           .1^3            300
2x300, 1x100    .1^2 * .9       300
1x300, 2x100    .1 * .9^2       100
2x300           .9^3            100


This gives me an expected revenue of $105.6. This is inline with the simulation below.

However, I'm confused by what's exactly meant by "optimal allocation" strategy. Any suggestions?

generateBid &lt;- function(x){
  epsilonValue &lt;- runif(1, min = -1 , max =1)
  isNostalgic &lt;- rbinom(1, size = 1, prob = .1)
  finalValue &lt;- epsilonValue + isNostalgic*300 +(1-isNostalgic)*100
  return(finalValue)
}

cameraBid &lt;- data.frame(bidderA = sapply(1:1000, generateBid), bidderB = sapply(1:1000, generateBid), bidderC = sapply(1:1000, generateBid))


VickreyAuctionProfit&lt;- apply(cameraBid, 1, function(x){
  indexSecond &lt;- rank(x)
  return(x[which(indexSecond ==2)])

})

mean(VickreyAuctionProfit)


Also, looking at the mean, it seems that the expected revenue of the auction should be less than 115?
Optimal allocation refers to whom the seller awards the item, in order to maximize revenue. In a Vickrey auction, it is a Nash equilibrium for everyone to bid their valuations. This is stronger than a Bayesian Nash equilibrium, which is the solution concept in Bayesian games (which include auctions). The Bayesian Nash equilibrium is the solution concept in which every player seeks to maximize their expected utilities, subject to their respective beliefs about the world. In the Vickrey auction, agents' beliefs about the world do not really matter.

The goal of the Vickrey auction is to illicit truthful responses from the agents. That is, they bid their precise valuations. The first-price auction is revenue-equivalent to the Vickrey auction; however, agents do not truthfully bid their valuations.

In particular, if we have a symmetric $n$-player auction where players' valuations are drawn from a probability distribution $F([0, \omega])$ with density $f$, we have the expected revenue for the seller as:

$$n \cdot \int_{0}^{\omega} (n-1) \cdot y \cdot f(y) \cdot F^{n-2}(y) \cdot (1-F(y)) dy$$

Combinatorially, we select the highest two bidders in $n(n-1)$ ways, since order matters. Suppose the second highest bid is $y$. This occurs with probability $f(y)$. The remaining $n-2$ players bid less than $y$ with probability $F^{n-2}(y)$. The highest bidder has valuation greater than $y$ with probability $1-F(y)$. Each of these selections are independent; so by rule of product, we multiply. As this is an expected value, we include $y$ in each product. By rule of sum, we add up over each possible value of $y$ (hence, the integral).