Normally, we like to get you to do the work in order to learn to think for yourself, so we ask you to show what you've tried:
Welcome to our tutoring boards! :) This page summarizes main points from our posting guidelines. As our name implies, we provide math help (primarily to students with homework). We do not generally post immediate answers or step-by-step solutions. We don't do your homework. We prefer to help...
www.freemathhelp.com
But this sounds like real life, so I'll just answer.
Let's take your first example, and then generalize.
You have 12.5% SH, so x gallons contain 0.125x of SH. You want 50 gallons total, of which 1% (.01*50 = 0.5 gal) is SH. So you want 0.125x = 0.5.
Solving, x = 0.5/0.125 = 4 gallons. The remaining 50 - 4 = 46 gallons will be water.
As a formula, we see that 0.5 was the desired gallons (50) times the desired concentration (1%), and the 0.125 was the provided concentration. So the formula you want is
Gallons to use = Desired gallons*Desired concentration/Provided concentration.
Trying this out on the second example, we get 30*0.06/0.125 = 14.4, so you'd use 14.4 gallons in 30 - 14.4 = 15.6 gallons of water. Checking, you're using 0.125*14.4 = 1.8 gallons of pure SH, and 1.8/30 = 0.06, the correct concentration.