Welcome Guest [Log In] [Register]
Home · Active Topics
GoodGamery · Forums - Our friend and ally in these dark times

Add Reply
Playing House; A fun activity for the forum!
Topic Started: Sep 27 2009, 05:03 AM (2,114 Views)
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Ok, we are going to play House. Or rather, we are going to play Doctor. We are going to play Doctor House.

I saw this brainteaser on a blog I read, and I thought it would be neat for Mt. Grobot to take a crack at it. House and his team are presented with a patient. He has symptoms which are, a priori, equally likely to be caused by either fungus or an allergy. The patient starts with 2d6 hitpoints and loses one hitpoint per day he remains untreated. The exact number of these hitpoints are not known to the doctors. All they know is that, if left to his own devices, there is a 1/36 chance he will be dead in two days, a 1/18 chance he will die in three days, a 1/12 chance in four days, and so on. If they don't do something, he will not see another fortnight, guaranteed. :ghost:

Fortunately, Princeton-Plainsboro Teaching Hospital has the necessary supplies to treat either the fungus or the allergy long-term, in the form of convenient once-a-day pills. If the patient has a fungus and takes a fungus pill, he does not lose any hitpoints that day, and mutatis mutandis for the allergy. Unfortunately, the pills have some nasty side-effects if taken unnecessarily: if the patient takes a pill for a condition he does not have, he loses an additional hitpoint that day. So, trying to treat both illnesses would be just as bad as doing nothing, and if you are just giving pills at random you may do more harm than good.

Fortunately, Princeton-Plainsboro Teaching Hospital also has diagnostic equipment! Each day, at the beginning of the day, before the pill regimen is selected, House's team runs a test, to determine the nature of the illness. This test will return either "fungus" or "allergy". Unfortunately, these tests are not perfect. One time in three, the test returns the wrong value, that is, it returns "fungus" when a patient has an allergy, or vice versa. However, it is better than nothing, and it will help to guide House's team in treating the patient.

You take the role of House. You can manipulate the patient into accepting whatever pill regimen you choose. You win if the patient is alive after twelve days (at that point you are guaranteed to know what condition he has, which is what you care most about), you lose if the patient dies. What is your strategy for giving or not giving pills, based on the test results, to maximize your win percentage?

Note that there is a trivial strategy for saving half of the patients: ignore the tests and just treat for fungus every day. Any solution should save more than half the patients. I will post my best solution thus far in spoiler tags below.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
ewie
Member Avatar
If you a dick, get out.
[ *  *  *  *  * ]
break into their house and see if they have any allergens.
I would suggest not wearing a bra, but I fear a lack of support for this notion.
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Spoiler: click to toggle



Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
ewie
Sep 27 2009, 05:32 AM
break into their house and see if they have any allergens.
unfortunately you will be wrong 1/3 of the time!
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
Just thinking out loud here...

Spoiler: click to toggle


Can we do better still?


Edit: My strategy is better than Locus' assuming I did the math right.
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Jew
Sep 27 2009, 05:39 AM
Just thinking out loud here...

Spoiler: click to toggle


Can we do better still?


Edit: My strategy is better than Locus' assuming I did the math right.
Don't deaths due to low hp get more and more common as time progresses?

Well, until you pass the 7 hp barrier, but by that point hopefully you have a cure.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
Right before the patient dies, I'll just talk with Wilson and have an epiphany.
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
I am thinking whatever the optimal strategy is, it does not involve a pill on day 1. The patient won't die before you have a chance to get a second test, unless you yourself kill him.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Fry Guy
Sep 27 2009, 05:53 AM
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
That's guaranteed suboptimal, FWIW. If your test results are FFFFAAAAAAAA, you know by the end of the sixth day of fungus treatment that it's definitely fungus, or he'd be dead, but you switch to allergy treatment and kill him anyway, unless he started with 10 or more hp.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
Locus Cosecant
Sep 27 2009, 05:44 AM
Jew
Sep 27 2009, 05:39 AM
Just thinking out loud here...

Spoiler: click to toggle


Can we do better still?


Edit: My strategy is better than Locus' assuming I did the math right.
Don't deaths due to low hp get more and more common as time progresses?

Well, until you pass the 7 hp barrier, but by that point hopefully you have a cure.
Oh, right.

So...

Spoiler: click to toggle


So it looks very close and I'm doing this on a crappy calculator that can't handle higher precision so I can't actually determine who the winner is.
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
Locus Cosecant
Sep 27 2009, 05:48 AM
I am thinking whatever the optimal strategy is, it does not involve a pill on day 1. The patient won't die before you have a chance to get a second test, unless you yourself kill him.
This might be approachable.
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
Locus Cosecant
Sep 27 2009, 05:58 AM
Fry Guy
Sep 27 2009, 05:53 AM
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
That's guaranteed suboptimal, FWIW. If your test results are FFFFAAAAAAAA, you know by the end of the sixth day of fungus treatment that it's definitely fungus, or he'd be dead, but you switch to allergy treatment and kill him anyway, unless he started with 10 or more hp.
It's definately not worth it because you can get unlucky? Are you trying to lose 0% or something ridiculous?
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
Fry Guy
Sep 27 2009, 05:53 AM
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
This sounds easier to do as a monte-carlo rather than figuring out the math.

Hmm...
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
Oh, wait, you saying the strategy has to include stuff to stop like "Derf derf if he's survived and would have died if we were wrong by now, switch the medicine"?
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
Fry Guy
Sep 27 2009, 06:11 AM
Locus Cosecant
Sep 27 2009, 05:58 AM
Fry Guy
Sep 27 2009, 05:53 AM
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
That's guaranteed suboptimal, FWIW. If your test results are FFFFAAAAAAAA, you know by the end of the sixth day of fungus treatment that it's definitely fungus, or he'd be dead, but you switch to allergy treatment and kill him anyway, unless he started with 10 or more hp.
It's definately not worth it because you can get unlucky? Are you trying to lose 0% or something ridiculous?
You will of course lose some games. However, you should never lose a game where you know what the illness is and your patient is still alive. At the very least you should alter your algorithm with a clause to the effect of "if you give a guy a pill six times and he's still not dead, keep giving him that pill".

EDIT: Yeah, what you said.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Fry Guy
Member Avatar

[ *  *  *  *  *  *  * ]
Locus Cosecant
Sep 27 2009, 06:14 AM
Fry Guy
Sep 27 2009, 06:11 AM
Locus Cosecant
Sep 27 2009, 05:58 AM
Fry Guy
Sep 27 2009, 05:53 AM
Locus Cosecant
Sep 27 2009, 05:52 AM
Fry Guy
Sep 27 2009, 05:50 AM
On a serious note is there anything bad about the math of just giving them the medicine for what the majority of the test results say each day?
Well, for starters, what do you do on day 2 if you have one of each?
Nothing, you have no majority.
That's guaranteed suboptimal, FWIW. If your test results are FFFFAAAAAAAA, you know by the end of the sixth day of fungus treatment that it's definitely fungus, or he'd be dead, but you switch to allergy treatment and kill him anyway, unless he started with 10 or more hp.
It's definately not worth it because you can get unlucky? Are you trying to lose 0% or something ridiculous?
You will of course lose some games. However, you should never lose a game where you know what the illness is and your patient is still alive. At the very least you should alter your algorithm with a clause to the effect of "if you give a guy a pill six times and he's still not dead, keep giving him that pill".
Refer to my next post, plz
Offline Profile Quote Post Goto Top
 
Locus Cosecant
Member Avatar
The King Kong of Ping Pong.
[ *  *  *  *  *  *  * ]
In general though I think you don't have to give him six pills to make it worthwhile to just keep stubbornly going. Most people are not going to have enough hp to survive five days of incorrect treatment, or even four. So if they take four of the same pill and survive, you're probably on the right track.
Learn to recognize me by this sig, because my avatar is subject to change.
Offline Profile Quote Post Goto Top
 
Energizer
Member Avatar
Game Designer
[ *  *  *  *  *  *  * ]
I feel like, just keep the guy alive until tomorrow. I don't know if that's right but that's the approach I'd try first.

Day one you don't treat, because treating might kill him and not treating can't.

Day two, if you got two matches, then no treatment only kills him 1/36 times, and the wrong treatment kills 3/36 (2's and 3's) times 1/9 (odds of two false results). that's less than 1/36, so you should treat him.

If otoh you got two different results, no treatment is still 1/36 stiffs, but the wrong treatment is 3/36 times 1/2. So, no treatment.

Further brute forcing does not sound fun, so so much for that.
Offline Profile Quote Post Goto Top
 
Bugman
Member Avatar
What now for man raised by puffins?
[ *  *  *  *  * ]
It's probably lupus anyway
Offline Profile Quote Post Goto Top
 
phodos
Member Avatar
Forum Elf
[ *  *  *  *  *  *  * ]
is this mafia /in
Energizer: or there's a cock in his mouth, so he can only mumble it desperately before the minute is up; wi woo wory wie
Offline Profile Quote Post Goto Top
 
Bela
Member Avatar
Forum Elf
[ *  *  *  *  *  *  * ]
Treat for fungus because people with allergies are subhuman. This way, you treat 100% of the patients you care about.
How can I explain? I need you here, and not here too.
Offline Profile Quote Post Goto Top
 
Girdles4Turtles
Member Avatar
Where all the fly honeys
[ *  *  *  *  *  *  * ]
What if he's allergic to fungus
Won't someone think of the children?
Offline Profile Quote Post Goto Top
 
Coron
Member Avatar
Cardboard Robot
[ *  *  * ]
I'm going to solve some easier problems and see if it helps anyone out.
if you have n of one and k total tests of the other probability of n is [(2/3)^n*(1/3)^(k-n)]/[(2/3)^n*(1/3)^(k-n)+(2/3)^(k-n)*(1/3)^n]. Of course to simplify things each term in numerator and denom is going to have the same number of /3s and 1 to any power is 1 so... [(2)^n/[2^n*+2^(k-n)]. The other is clearly[(2)^(n-k)/[2^n*+2^(k-n)]
Prob*36 36 35 33 30 26 21 15 10 6 -3 --1 --0 (Probabilty alive)
HP lost ---1--2---3--4--5--6---7--8--9-10 11 12+
If seems like there should be an easy mathmatical formula for this, but I'm not coming up with any continuous functions, you'd get a 2 section 2nd order . Take HP lost for the one you want look at the above Probabilty assign it to Q, take the other HP loss above probability to R. Q/(Q+R) is the probability just given the HP lost for each. R/(Q+R) is the reverse.

Now to Find the probability of Each given both together you multiply the probabilities for the one you are looking for then divide by the sum of the 2 probabilities, so all of the denominators will disappear and we should get (Q*2^n)/[Q*2^n+R*2^(k-n)] As the probability of an illness given the Q= chance alive given the illness*36. R= the chance alive given the other illness*36. n is the number of tests showing the illness and k is the total number of tests.

Let me know if I messed any of this up.

and now to go do circuits.
Edited by Coron, Sep 27 2009, 07:54 PM.
Offline Profile Quote Post Goto Top
 
Coron
Member Avatar
Cardboard Robot
[ *  *  * ]
okay so the forum ate my formatting on the table. So dumb.
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
New strategy: Treat only when given two consecutive identical results.

Simulation shows about 83% survival rate.


Edit: Had a bug in my code, forgot to account for no pill on the first day. Survival drops to 80%.
Attached to this post:
Attachments: two_consecutive.py (996 Bytes)
Edited by Jew, Sep 27 2009, 09:45 PM.
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
Majority of three gives ~ 77% survival rate.

Majority of five gives ~ 79% survival rate.


That doesn't line up with Locus's math earlier in the thread - am I doing something wrong?


Edit: Bug fixed in majority of five algorithm, new results line up with analytical prediction of 72%
Attached to this post:
Attachments: majority_of_three.py (1008 Bytes)
Attachments: majority_of_five.py (1.1 KB)
Edited by Jew, Sep 27 2009, 09:44 PM.
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
Jew
Member Avatar
Team Edward
[ *  *  *  *  *  *  * ]
What if...

If you get the same results on the first two days, you treat for that. Otherwise, you wait until you have three (of five?) results one way or the other.

Turns out that is 75%.
Attached to this post:
Attachments: two_then_five.py (1.13 KB)
look every post here is a poster slapping another poster on the ass

we all have different ass slapping techniques but no matter what you think is happening, you are getting slapped on the ass. if you think you're getting slapped on the face, you are mistaken

because it's the ass that you are getting slapped on
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Free Forums with no limits on posts or members.
Learn More · Sign-up for Free
Go to Next Page
« Previous Topic · Everything · Next Topic »
Add Reply