This question actually comes from backyard composting. When choosing materials to compost the ideal ratio of Carbon to Nitrogen of the raw materials to make compost is 30:1. There are basically no materials that are 30:1 naturally, so you have to work with what you have. For instance, grass clippings are 20:1 and wood chips are 400:1.
My question is how to you determine the quantity $x_1$ of a material with a $C:N$ ratio $r_1$ as a function of the quantity $x_2$ of a second material with $C:N$ ratio of $r_2$ where the sum of the two materials will be $r_{1+2}$, in this case $30:1$?
If you have $x_2$ with $\frac CN=r_2$, you get $\frac {x_2r_2}{1+r_2}$ of $C$ and $\frac {x_2}{1+r_2}$ of $N$ and similarly with subscripts $1$. The ratio of the mix is then $r_{1+2}=\frac {x_2r_2(1+r_2)+x_1r_1(1+r_1)}{x_2(1+r_2)+{x_1(1+r_1)}}$ Now solve for $x_1$ and you have what you need.