[Tutor] Math Question

C Smith smichr at hotmail.com
Tue Mar 29 12:17:31 CEST 2005


On Tuesday, Mar 22, 2005, at 15:34 America/Chicago, 
tutor-request at python.org wrote:

> When I adjust coumadin doses I normal have to use whole or half pills
> of the medicien the patient already has.
> Fer Instance, if a pt takes 5mg of coumadin a day, that's 35mg of 
> coumadin week
> and suppose I do a test that says thye are not taking enough coumadin
> and to increase the dose by 10%, ie add another 3.5mg but have it
> split evenly over the week or at least every other day.
> normall, I would say ok
> Take 5mg coumadine everty but on mon and thurs day take 7.5mg
> (Note the patient only has 5mg tabs, which they can split to make dose
> adjust my 2.5)
>
> My question is,
> How would I solve this using math instead of geustimating it.
> What kind of math am I talking about here?
>

I don't know that much about this medication (and I know you just said 
that the patient only has 5 mg pills) but on this page,

http://www.heartpoint.com/coumadin.html

I see that doses come in amounts like 1, 2, 2.5, 5, 7.5, and 10.

With the ability to split pills, you can add 0.5, 1.25 and 3.75 to the 
list of possibilities.

And then I wonder if the "math topic" expands from integer math, as has 
been suggested, to combinatorics which can tell you what combinations 
of pills and half pills that are at your disposal for making dosages.  
There are other factors, however, like keeping the prescription simple 
for patients.  For example, let's say that the patient is not going to 
want to buy more than 2 pill sizes. This will give 4 different dosage 
amounts that one could play with.

Let's say that the patient should never have to take more than 2 pills 
(or pill pieces) each day.  The possible dosages that can be prescribed 
for a given day would be all the pair-wise combinations of the dosages. 
These could be obtained with 2 FOR loops:

###
 >>> dosages = [1, 2, 3] #just an example; different from above notes
 >>> possible = []
 >>> for i,x in enumerate(dosages):
..   for y in dosages[i:]:
..     possible.append((x+y,[x,y]))
..
 >>> for pi in possible:
..   print pi
..
(2, [1, 1])
(3, [1, 2])
(4, [1, 3])
(4, [2, 2])
(5, [2, 3])
(6, [3, 3])
 >>>
###

Just a thought,
/c




More information about the Tutor mailing list