[tex]\bf \begin{array}{lccclll}
&amount&concentration&
\begin{array}{llll}
concentrated\\
amount
\end{array}\\
&-----&-------&-------\\
\textit{5\% alloy}&x&0.05&0.05x\\
\textit{30\% alloy}&y&0.30&0.30y\\
-----&-----&-------&-------\\
mixture&100&0.15&(100)(0.15)
\end{array}[/tex]
so hmm notice, we use the decimal format for the percent, namely 15% is just 15/100 and 5% is just 5/100 and so on
whatever the amounts of "x" and "y" are, they must add up to 100 grams
thus x + y = 100
and whatever the concentrated amounts are, they'll add up to (100)(0.15)
thus [tex]\bf \begin{cases}
x+y=100\implies \boxed{y}=100-x\\
0.05x+0.30y=(100)(0.15)\\
----------\\
0.05x+0.30\left( \boxed{100-x} \right)=(100)(0.15)
\end{cases}[/tex]
solve for "x", to see how much 5% alloy will be needed
what about "y"? well y = 100 -x