MGF technique for exponential / Chisquared Let $X$, $U$, $V$, $W$, $Y$ be independent exponential random variables with respective means
$\frac{1}{6}, \frac{1}{4}, \frac{1}{3}, 1, \frac{2}{3}$. Use the variables $X, U, V, W, Y$ to construct a variable having an $F$ distribution with $(3,2)$ degrees of freedom.
The issue here is that no matter what I do, I can't get a Chi-squared with an odd degrees of freedom. For example, $12X$ will be $\chi^2_2$. Same for $4U$. To get an $F_{(3,2)}$, we need a $\chi^2_3$ divided by its df, over a $\chi^2_2$ divided by its df.
Thanks for your help.
 A: Exponential distributions are rescaled $\chi^2(2)$ distributions.  Let's assume the scaling has been reversed (which is done via a constant multiplication) and all means are equal to $2$.
One solution starts by generating a scaled $\chi^2(1)$ variate $A$ from two independent $\chi^2(2)$ variates $U$ and $V$ via
$$A = U\left(\cos(2\pi\exp(-V/2))\right)^2.$$
This is equivalent to the Box-Mueller transform, which is a well-known way of generating a pair of (independent) standard normal variates from two independent uniform variates.  One of those normals, when squared, equals $A$ and therefore has a $\chi^2(1)$ distribution.
The rest is easy given two more independent exponential variates $W$ and $Y$: $W+A$ has a $\chi^2(3)$ distribution and $Y$ independently has a $\chi^2(2)$ distribution, whence (practically from the definition of $F$ as a ratio of scaled $\chi^2$ variables) $$F=\frac{(W+A)/3}{Y/2} = \frac{2}{3}\frac{W+U\cos^2(2\pi e^{-V/2})}{Y}$$ does the trick.
Note that only four of the five exponential variables are needed.

Here is R code comparing $100,000$ realizations of $F$ to corresponding quantiles of the $F(3,2)$ distribution:
n <- 1e5
set.seed(17)
v <- matrix(rgamma(4*n, 1, scale=2), ncol=4)
a <- v[, 1] * cos(2*pi*exp(-v[, 2]/2))^2 
x <- v[, 3] + a
y <- v[, 4]
f <- 2*x/(3*y)

f.q <- qf((1:n - 1/2)/n, 3,2)
plot(f.q, sort(f), log="xy", pch=19, cex=0.5,
     xlab="F quantile", ylab="Data",
     main="F probability plot")
abline(c(0,1), col="Blue", lwd=2)

The probability plot shows a close correspondence:

As a double-check, we can verify that a, y, and x average close to their expectations of $1$, $2$, and $3$ respectively:
> mean(a)
[1] 0.9948789
> mean(x)
[1] 3.003484
> mean(y)
[1] 1.986864

Finally, probability plots confirm that a, y, and x appear to have $\chi^2$ distributions with the desired degrees of freedom (and correct scales):
pp <- function(x, df, ...) {
  x.q <- qchisq((1:n - 1/2)/n, df)
  plot(x.q, sort(x), 
       xlab="Quantile", ylab="Data",
       main=paste("Chi^2(", df, ") probability plot", sep=""), ...)
  abline(c(0,1), col="Red", lwd=2)
}
par(mfrow=c(1,3))
pp(a, 1, pch=19, cex=3/4)
pp(y, 2, pch=19, cex=3/4)
pp(x, 3, pch=19, cex=3/4)


By construction x and y are independent, so there's no need to test this.
