Simple standard deviation question using stocks as example The following table is from page 171 of Fundamentals of Investing (11th edition) by Gitman, Joehnk, Smart. Please consider only the X, Y and XY columns (second, third, fifth).
Portfolio XY comprises assets X and Y in the proportion $2:1$. As you can see, while the average expected (here, "expected" is not used in the statistical sense, but to mean the forecast value) returns of assets X and Y have a standard deviation of $3.16$ and $6.32$ respectively, portfolio XY's expected return has a standard deviation of $0$!

Some further context: The authors are trying to illustrate the power of diversification: by replacing $\frac13$ of the original quantity of X with Y, the expected return of the portfolio is increased, while its risk (the standard deviation of the expected return) is decreased.
But how can the portfolio's risk possibly become nil !? Can someone pinpoint what is amiss?
 A: It's because $X$ and $Y$ are perfectly negatively correlated: $Y = 40 - 2X$. So a mix of $\frac{2X + Y}{3}$  is a constant, which is why its standard deviation is zero.
Edit:
As you mentioned, it seems paradoxical that the risk of a combination of two risky assets can be zero. This is because of the intuitive notion that $\mathrm{risk}(X+Y) = \mathrm{risk}(X)+\mathrm{risk}(Y)$. However, this is only true if $X$ and $Y$ are uncorrelated. The correct way to calculate the variance (more or less the same thing as risk) of the sum of two variables is shown here.
A: There is no paradox. The textbook's conclusion is correct within its own framework. 
Zero standard derivation simply doesn't mean risk-free. In real market, 5-$\sigma$ events occur much more frequently than expected. The risks associated with these events are usually unhedgeable and cannot be measured properly using "standard derivation". People sometimes use other tools like "value at risk" to compensate "standard derivation". The "value at risk" is simply an estimate of the maximum potential lose within 95% level of confidence.
A: Hint:
Let's play a game, where I flip a coin and you can bet any amount on Heads or on Tails.
 For every \$1 you bet on Heads, you get \$0.90 if it lands Heads, and lose the \$1 otherwise.
 For every \$1 you bet on Tails, you get \$0.90 if it lands Tails, and lose the \$1 otherwise.
Assume you bet \$1 on Heads and \$1 on Tails:      


*

*What is the probability of landing on Heads? What is the payoff when it lands on Heads?

*What is the probability of landing on Tails? What is the payoff when it lands on Tails?

*What is the payoff structure look like?

*What is the variance?

*What is the standard deviation?


No matter the outcome of the coin flip, you will get exactly \$0.90 each time. This is completely risk-free! You should play this game with me many many times.
