Call w the unknwon price of the walnuts, then:
total cost of walnuts = 1oz * w
Total cost of peanuts = 4 oz * $4/oz = $16
Total cost of nuts = 5oz * $5 /oz = $25
=> 1oz*w + $16 = $25 => w = ($25 - $16) /1oz = $9/oz
Verfify:
1oz * $9/oz + 4oz * $4/oz = $9 + $16 = $25, which is equal to 5oz * $5/oz.
Answer: $9 per oz.