[Python-Dev] [OT] Denormalized fractions [was Re: PEP 3144 review.] (original) (raw)
Steven D'Aprano steve at pearwood.info
Tue Sep 29 13:20:03 CEST 2009
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] [OT] Denormalized fractions [was Re: PEP 3144 review.]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 29 Sep 2009 01🔞43 pm Guido van Rossum wrote:
I've never heard of someone who had a use case for denormalized fractions
Off-topic, but for what it's worth, I have one -- there's a mathematical operator called the mediant:
mediant(a/b, c/d) = (a+c)/(b+d)
It has a few uses, including Farey fractions. Clearly the result you get from normalized fractions will be different from denormalized (compare mediant(1/2, 3/4) with mediant(5/10, 3/4)). This leads to Simpson's Paradox, which is of importance in medical research:
http://en.wikipedia.org/wiki/Simpson's_paradox
Brief summary: consider two medical studies comparing two different treatments for an illness, treatment A and B. According to the first study, treatment A is better; according to the second study, treatment A is also better. But combining the results of the two studies into a single comparison paradoxically shows that treatment B is better!
The mediant is fascinating (to maths geeks at least) and important, and you need denormalized fractions.
-- Steven D'Aprano
- Previous message: [Python-Dev] PEP 3144 review.
- Next message: [Python-Dev] [OT] Denormalized fractions [was Re: PEP 3144 review.]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]