Wednesday, October 1, 2008

xth root

I would like to know how I can solve for x in the following equivalent expressions:

a) .9^x = .5
b) the xth root of .5 = .9

The answer is a number very near 6.6 by guess-and-check, but guess-and-check is not what I want to do. I would like to know how, using a TI-83 or similar calculator, I can tell the calculator to do certain operations to .9 relative to .5 to get 6.6. I have figured out that I can type in 6.6 and then tell the TI-83 "Ans x-root .5" and get out .9. But again, that's cheating -- that's a manipulation of .5 using 6.6 to get .9, which is not what I asked for. I asked for a way to manipulate .9 using .5, or .5 using .9, to obtain a final answer of ~6.6. (And don't be cheeky -- I mean relative to the pertinent mathematical expressions written above in a) and b), okay?)

I don't know why I can't remember how to do this or if we ever learned how, but it has been driving me crazy ever since yesterday afternoon when I had to explain to a professor a statistics problem on his homework set: he asked us, "if the odds that somebody in the population is a Sickle Cell carrier are .1, on average how many people must we screen in order to find a carrier?" What he meant to write was a question such that the answer was 10; what he wrote, however, does not ask for that, and the answer to the question being asked is (of course) .9 (1 minus .1) taken to the power of x (our variable) such that it equals .5 (50%, i.e. "on average"). In translation:

if I have 9 black marbles and one white marble in a bag, and I return the marbles to the bag after each individual draw, on average how many marbles must I draw before I finally draw the white marble?

The answer is around 6 to 7. 50% of the time, you'll draw the white marble within 7 tries. 50% of the time, you won't. The answer is not 10, which is what the teacher was trying to say. If you don't believe me, try it out:

1. Put 9 black marbles and 1 white marble in a bag.
2. Tally how many draws it takes before you hit white.
3. Each time you hit white, start all over. (i.e. drawing white signals the end of the cycle)
4. Alternatively, if you reach 7 draws and all are black, start over.

You'll see that roughly 50% of the time you're quitting thanks to #3, and 50% of the time you're quitting thanks to #4.

7 comments:

Mack Ramer said...

You're going to want to slap yourself when I tell you this, because it's child's play and we learned it probably junior year of high school, but I had to re-learn it myself a couple months ago.

.9^x=5
x(ln .9) = ln .5
x = (ln .5)/(ln .9)

This is not, however, the answer to the problem posed, nor is your 4-step process an answer. The answer is like this:

Let C = "person is a carrier"; P(C) = .1, P(~C) = .9. Now when you are looking for the probability on average, you're looking for an expected value. So assign the values of 0 to ~C and 1 to C (i.e. boolean values to set up a probability mass funciton). Now we solve for n in the following equation:

E(n) = sum(n * p(n))

We can use this formula because we are talking about discrete random variables that are independent events with a probability mass function (set up by us). We solve for E(n) = 1 since we are looking for an expected value of 1, which would indicate that one person has been found who is a carrier (because if you sum a bunch of zeroes and then add 1, you get... 1). Solving for n we get:

1 = (n * 0 * .9) + (n * 1 * .1)
1 = .1n
n=10

And your prof was correct.

Mack Ramer said...

Of course that first part should read:

.9^x=.5
x(ln .9) = ln .5
x = (ln .5)/(ln .9)

Mack Ramer said...

I was thinking about what question your answer is correct for and I came up with this:

"X people are picked randomly from the population and put in a room. The probability that everyone in the room is NOT a carrier is .5; determine X."

SuiginChou said...

Let's say we have a discrete number of people (e.g. 10 people), and we want to know what are the odds of different permutations amongst them, i.e.:

0 C, 10 ~C
1 C, 9 ~C
...
10 C, 0 ~C

When you sum these up, it must equal 1, because 1 must equal the individual odds of all possible scenarios summed together. So. Let us establish some actual chances to work with here. Let's say p(C) = 0.1 and p(~C) = 0.9. We can say, for example, then that:

the odds of there being 4 C and 6 C out of a group of 10 people is equal to (.1)^4 * (.9)^6 = 0.00005314, or 5.3 x 10^-5.

So, now we take one step closer to the actual problem being asked. Because now we introduce this question: what are the odds that none of the 10 people are a carrier? This is simply (.1)^0 * (.9)^10 or 0.3486, or ~35%. The odds are 35% that a room of 10 people will contain zero carriers.

So now we reach the question: for what value of 'n' people in the room would we have a 50% chance of having no carriers? This is in fact the question I wrote, Matt, because by definition:
- you either find a carrier in the group of n people ...
- or you don't;
- and when the odds of that happening are equal to 50%, then that means "this is the average room size you'd need to find one person" :
- it means 50% of the time, a room with this many people will have at least one, if not more, carriers ...
- and 50% of the time it will have zero carriers

So the mathematical expression of this is:

0.5 = (0.9)^n
n = 6.578...
n ~ 7 people

50% of the time, a room with 7 people will contain at least one carrier.

50% of the time, a room with 7 people will contain zero carriers.

Therefore, on average, 7 people is the minimum number of people you would need to screen before you would see a carrier. Screen 6 or fewer, the odds support not seeing a carrier. Screen 8 or more, the odds support seeing a carrier.

To put it one final way, let's approach this as a series instead of as a group-in-a-room problem. As a series:
- a patient walks into your office. What are the odds that he's not a carrier? 90%
- next guy? 90%. Composite? 81%
- next guy? 90%. Composite? 73%
- it's when the 7th guy walks into your door who is still not a carrier that we reach (or surpass) 50% odds against it happening. "On average, we would expect 7 straight non-carriers as much as we would 1+ carriers and 6- non-carriers."

Thus, on average, if I screen 7 people at a time, 50% of the time I'll find one or more carriers and 50% of the time I'll find 0.

If you screen 10 carriers at a time then, on average, you're going to find at least one carrier more often than not. Which is contrary to the concept of "average minimum."

I see your point. But your point isn't answering the question as it was worded. (If it is, then I don't see and welcome any continued attempts to correct me. I would like to understand this regardless of the outcome to ego or "who was right".)

Really, it was a poorly-worded question to begin with. The teacher himself could not justify an answer of 10 beyond "if p(C) = .1, then if I screen 10 people I'll find at least one carrier." Which he then retracted for the obvious reason of statistical independence of events (i.e. 10 heads is equally likely to 9 heads and 1 tail).

Mack Ramer said...

Everything you said is correct...

But the question isn't asking you to make it so that the odds are better than 50% of there being someone present who is a carrier. That's completely unrelated to the concept of "average value" used in probability. That concept is the expected value -- go to the link for this above. As it says, expected value "represents the average amount one 'expects' as the outcome of the random trial when identical odds are repeated many times".

I'll try to explain this...

What you've found is the case where finding one carrier or not finding one carrier are equally likely.

What you're asked to find is: say a doctor sits an infinite number of days, and each day he waits until a patient comes in who is a carrier, and then he leaves. If you take an average of the patients he sees per day over this infinite number of days, what will that average number of patients be? The answer is given by expected value.

Put another way: Pretend this doctor lets people who are not carriers have a free visit, but he charges people who are carriers $1. Over his whole career, he wants to make $1 per day (no more, no less). How many patients will he see per day, on average, over his whole career (assuming he is immortal)? This is the same problem, and makes it a bit easier to see why expected value is appropriate.

Is this clear?

SuiginChou said...

No, it is not clear. (CORRECTION: it is clear now, I realized my error as I wrote the reply. Read on!) But first, I want to address a complaint:

In your scenarios, it has become clear to me that the "expected value" will always be equal in a bimodal system to 1 over the the overall chance of whichever variable (be it 0 or 1) we are examining, i.e.

the expected value for heads on a coin flip is always going to be 2 flips, because p(heads) = 0.5

the expected value for me catching the bus is 3 attempts, because p(I ride the bus) = 0.333333

But even in Wiki's example of the die (a 6-modal system with EV = 3.5), I see no cause for celebration. 1 + 6 is 7, average is 3.5. 2 + 5, same. 3 + 4, same. All faces covered. Always the same end result. Or put another way, 1 + 2 + 3 + 4 + 5 + 6 / 6 = surprise surprise, 3.5. (Who cares that 3.5 is not available on the die? This by no means suggests that the odds are "in one's favor" to roll higher numbers, if that is what Wiki's editor was attempting to imply. -.- You remain as likely to roll a 1, 2, or 3 as you do a 4, 5, or 6. Now talk to me about the fun we have with two dice and then I'll be all means agree that "Lucky 7's" really aren't so uncommon after all.)

To me, this renders the term "expected value" rather trite. There is nothing at all valuable about it: it is simply the inverse of p.

===============================

Anyway, on to the only other point (Point #2) in my confused reply:

Your scenarios make it clear that we are discussing two different things:
- in my scenario, the question is "for what value of n do 50% of cases fall on the left and 50% of cases fall on the right?" Because 7 is a small integer, this distribution (if graphed) would be grossly skewed right, i.e. there would be a huge mountain on the left end of the graph and a tiny, tiny, long, long tail stretching out past 12 and on towards Infinity. In effect, I am actually searching for the median, and thus perhaps I am really not answering the question after all. Perhaps the median is 7 while the mean is 10. Anyway, onwards.

- in your scenarios, the question is instead "how many patients will the doctor see, on average, before he encounters a carrier?" Because you do not stop once n (which we now know to be ~6.6) has been reached, you are suspect to the skewing effects of rare but large numebrs. Indeed, while over 50% of the time the doctor will see 7, 6, 5, 4, 3, 2, or even only 1 patient (inclusive) before seeing a carrier, 50% of the time he will see 12, or 689, or 786543034939393 patients. Granted, these numbers are not likely, but because these are non-zero odds we're talking about here -- however small! -- and because there are an infinite number of values between 7 and ... well, infinity!, we have the problem that your answer will forever and always reduce back down to 1 over the overall probability of finding a carrier (in this case 1/.1, or 10).

Rephrased:

Your answer fits the question, "How many patients is the doctor likely to see on average before he finds Carrier #1?"

My answer fits the question, "What finite number of patients must the doctor see to ensure an at least 50%, and therefore 'average or more than average', chance of finding a carrier?"

Neither of our answers fits what I think the genetics professor misunderstood Statistics to be arming him with, which is the answer to the question "What is the magic number of patients a physician should see in order to guarantee that he'll find at least one carrier?" For which, I think we agree, there is no magic answer - on any given day, you may find the carrier in Patient #1 or in Patient #1,000,000. We can only advise the professor, and others, that the median is 7 and the mean is 10.

Conclusion, I realize now the juvenile observation (sigh) that "half the time, I saw 7 or fewer and half of the time I saw 7 or more" is an assessment of median, not of mean.

Ben Lamb said...

I don't remember much math, but I do remember this:

http://www.hulu.com/watch/20337/saturday-night-live-snl-digital-short-the-japanese-office#s-p1-st-i3