# Medium Difficulty Math Problem

I haven't done real math in a couple of years in college. An haven't done true algebra for almost a decade now, but I was just confronted with a real math problem I didn't know how to do. I actually had to read off someone else's code to figure it out and see whats going on. I suspect others have might have this same problem so I decided to brush up on my math skills a bit and expect almost every programmer to do the same.

The problem I had is this:

I know there is a name for this problem, but it escapes me at this moment.

I have k, a static number that never changes is multiplied by 50% to 150 percent on a random basis. The answer will be k multiplied by 50% to 150% randomly and I have to figure out what 'k' is through the answers I get.

k * .50-1.50 = 15000

k * .50-1.50 = 12000

So if I have the equation above, I have to find where 15000/(.5 - 1.5) and 12000/(.5 - 1.5) intersect. The intersection point(s) could be k. I also get the chance to add as many (answers) to the equation as possible so I can define my answer more and more if I would like.

So here is the problem. If I do have the numbers 15000 and 12000, what is k?

Good Luck and tell me in the comments how you did it and the actual answer(s). I will post the answer(s) on Monday.

Have Fun!

5/3/2009 10:01:15 PM #

let min be the minimum sample (in your example: 12000)

let max be the maximum sample (in your example: 15000)

let upper = (min / 0.5)

let lower = (max / 1.5)

then all possible values for k belong to the interval [lower, upper] and all possible choices are equally likely to be correct assuming independence and uniform distribution of your random variables

in this scenario, the greater the spread of your samples, the tighter the bounds on your estimate for k

5/26/2009 12:17:39 PM #

http://www82.wolframalpha.com/input/?i=k+*+.50-1.50+%3D+15000

http://www82.wolframalpha.com/input/?i=k+*+.50-1.50+%3D+12000

5/27/2009 6:06:44 AM #

@notandy, Brilliant! Good thought.

8/6/2010 12:01:41 PM #

Randomly found this while I was avoiding work and nothing happening in Utopia.

I am sure I am missing something, but I took a very simple approach to this.

I took 12000 as 100%.

12000 - 15000 = 3000

3000 / 15000 = .2

1 - .2 = .8

12000 * 1 = 12000

15000 * .8 = 15000

Then by adding more equations you rule out other possibilities.

k * .50-1.50 = 6000

k * .50-1.50 = 18000

by adding those two you effectively create an instance where k can only be 12000 as you have provided an maximum and minimum extremes

Chances are I have missed it, so do correct me.