Skip to content

Instantly share code, notes, and snippets.

@chendo
Created May 2, 2011 10:32
Show Gist options
  • Select an option

  • Save chendo/951418 to your computer and use it in GitHub Desktop.

Select an option

Save chendo/951418 to your computer and use it in GitHub Desktop.
A prescription calls for 50 g of a 10 % ointment. The pharmacist only
has a 5 % ointment and the pure ingredient available. How much of
the 5 % ointment and the pure ingredient are needed to compound
the prescription?
Let x be the amount of 5% ointment
Let y be the amount of 100% ointment
x * 5% ointment + y * 100% ointment = 50g of 10% ointment
Given that the maximum amount of ointment is 50g
Let y = 50 - x
x * 5% ointment + (50 - x) * 100% ointment = 50g 10% ointment
x * 0.05 + (50 - x) * 1.00 = 50 * 0.10
0.05x + (50 - x) = 5
0.05x + 50 - x = 5
50 - 0.95x = 5
45 - 0.95x = 0
45 = 0.95x
x = 45 / 0.95
x = 47.368~
Solve for y:
y = 50 - x
y = 50 - 47.368~
y = 2.632~
Solution: It takes 47.368g of 5% ointment, 2.632g of 100% ointment to make 50g of 10% ointment.
Also I'm a huge nerd.
@525c1e21-bd67-4735-ac99-b4b0e5262290

Copy link
Copy Markdown

@chendo

chendo commented May 2, 2011

Copy link
Copy Markdown
Author

Yeah, but I wanted to show working. And the EULA of it forbids any Asians from using it because they don't want a huge deluge of math related bug reports. Which are actually bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment