[math-fun] The chance that N statistical tests fail simultaneously
Perhaps this nicely typeset page will help you understand the problem: http://rangevoting.org/CombinedTestFail.html The answer is NOT a*b*c*...* despite the tests being independent. This is a trap too many fall into. Indeed, if there were N uniform(0,1) independent randoms, and somebody told you "there exists an ordering such that x_j<j/N for each j=1,2,3,...,N" you do NOT want to be an idiot and conclude "my god, that is an amazingly exponentially improbable miracle." Actually, it is quite likely even for N=100. Eh? So hopefully I've piqued your interest now. -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
Let's say that we're testing a coin to see if it's unfairly biased towards heads. The null hypothesis is that it's a fair coin. Test 1 consists of flipping the coin twice and seeing if both times it comes up heads; p = 0.25. Test 2 consists of flipping it once and seeing if it comes up heads; p = 0.5. The chance that a fair coin would fail both tests is 1/8 for a p-value of 0.125. Your formula gives 1/4 * (2*1/2 - 1/4) = 3/16 = 0.1875. Am I missing something? Charles Greathouse Analyst/Programmer Case Western Reserve University On Tue, Nov 11, 2014 at 12:09 PM, Warren D Smith <warren.wds@gmail.com> wrote:
Perhaps this nicely typeset page will help you understand the problem:
http://rangevoting.org/CombinedTestFail.html
The answer is NOT a*b*c*...* despite the tests being independent. This is a trap too many fall into. Indeed, if there were N uniform(0,1) independent randoms, and somebody told you "there exists an ordering such that x_j<j/N for each j=1,2,3,...,N" you do NOT want to be an idiot and conclude "my god, that is an amazingly exponentially improbable miracle." Actually, it is quite likely even for N=100. Eh? So hopefully I've piqued your interest now.
-- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
To Ch.Greathouse: your two tests were dependent. -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
I don't know what you mean when you say that my tests are dependent -- I'm not reusing coin flips. Would it be better if I tested two different coins with the null hypothesis being "both coins are fair"? The numbers remain the same, of course. Charles Greathouse Analyst/Programmer Case Western Reserve University On Tue, Nov 11, 2014 at 1:24 PM, Warren D Smith <warren.wds@gmail.com> wrote:
To Ch.Greathouse: your two tests were dependent.
-- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
I do not understand Warren's example. Specifically, I do not know what he has in mind as the independent events whose conjunction is being considered. Note that the event "there exists an ordering such that x_j<j/N for each j=1,2,3,...,N" is not the conjunction of the N events "there exists an ordering such that x_1<1/N", "there exists an ordering such that x_2<2/N", ..., "there exists an ordering such that x_N<N/N". I figured someone else would point this out, but nobody else has, so maybe other people see what Warren had in mind and I'm missing something? Jim Propp On Tue, Nov 11, 2014 at 12:09 PM, Warren D Smith <warren.wds@gmail.com> wrote:
Perhaps this nicely typeset page will help you understand the problem:
http://rangevoting.org/CombinedTestFail.html
The answer is NOT a*b*c*...* despite the tests being independent. This is a trap too many fall into. Indeed, if there were N uniform(0,1) independent randoms, and somebody told you "there exists an ordering such that x_j<j/N for each j=1,2,3,...,N" you do NOT want to be an idiot and conclude "my god, that is an amazingly exponentially improbable miracle." Actually, it is quite likely even for N=100. Eh? So hopefully I've piqued your interest now.
-- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it. I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted. (The key is having the command "Paint pixel (K,L) the color (R,G,B).") Can someone please tell me how to do this on my iMac ? ( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms. Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. ) Thanks, Dan
If you like GL, how about programming in WebGL, and letting your platform be the browser instead of the OS? (Needless to say, I'm answering a different question only because I don't actually know the answer to the question you asked...) --Michael On Tue, Nov 11, 2014 at 3:24 PM, Dan Asimov <dasimov@earthlink.net> wrote:
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it.
I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).")
Can someone please tell me how to do this on my iMac ?
( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. )
Thanks,
Dan _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Forewarned is worth an octopus in the bush.
Dan, How about using PostScript? It can do what you want and lots more. A quick google search seems to find interpreters that run on a Mac. --ms On 2014-11-11 15:24, Dan Asimov wrote:
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it.
I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).")
Can someone please tell me how to do this on my iMac ?
( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. )
Thanks,
Dan _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
I use Java for most graphics. Getting a program of any size to compile from scratch is painful; it's better to search the web first for the source of some working program that does something approximating what you have in mind, then hack it incrementally. The result should be portable across any platform you might have in mind for the foreseeable future. There are built-in 2-D and 3-D extensions which promise improved performance; but I've never used them since I couldn't make sense of the documentation, which is uniformly diabolical. Deitel & Deitel's manual is pretty reliable, with lots of hack-worthy examples. WFL On 11/11/14, Mike Speciner <ms@alum.mit.edu> wrote:
Dan, How about using PostScript? It can do what you want and lots more. A quick google search seems to find interpreters that run on a Mac.
--ms
On 2014-11-11 15:24, Dan Asimov wrote:
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it.
I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).")
Can someone please tell me how to do this on my iMac ?
( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. )
Thanks,
Dan _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
On Nov 11, 2014, at 12:24 PM, Dan Asimov <dasimov@earthlink.net> wrote: I have a nice iMac...
What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that.
No, it isn't necessary. No, there's no Linux on the iMac. What's on the iMac is Mac OS X, which is Unix. Officially certified (see here <http://www.opengroup.org/openbrand/register/apple.htm>). Anything that works on a real Unix should work on the Mac. Of course if you want it to run using the Mac's regular user interface, which has nothing to do with Unix, then you'll need to program all sorts of stuff for that. Or use something compatible. But if you're clear about what you want there are good places to ask for help. Of course as of now the only "nice iMac" is this <http://store.apple.com/us/buy-mac/imac-retina>, which is truly awesome. Regards, Jon
The easiest way to do this might be Processing.js (http://processingjs.org/) in a web browser. Khan Academy uses it for their programming tutorials. http://www.khanacademy.org/cs On Tue, Nov 11, 2014 at 12:24 PM, Dan Asimov <dasimov@earthlink.net> wrote:
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it.
I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).")
Can someone please tell me how to do this on my iMac ?
( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. )
Thanks,
Dan _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com
Actually, Processing makes things pretty easy, but the underlying canvas api isn't much harder: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_u... On Tue, Nov 11, 2014 at 1:49 PM, Mike Stay <metaweta@gmail.com> wrote:
The easiest way to do this might be Processing.js (http://processingjs.org/) in a web browser. Khan Academy uses it for their programming tutorials. http://www.khanacademy.org/cs
On Tue, Nov 11, 2014 at 12:24 PM, Dan Asimov <dasimov@earthlink.net> wrote:
I have a nice iMac but other than the terminally buggy and limited app "Grapher" I don't have a way to draw arbitrary pictures on it.
I used to have GL (what gave rise to openGL) under Unix, and could just write a program to do pretty much anything I wanted.
(The key is having the command "Paint pixel (K,L) the color (R,G,B).")
Can someone please tell me how to do this on my iMac ?
( What I've read about computer graphics on my iMac in Apple documentation sounds w-a-a-a-a-a-a-y more complicated than it used to be, with all manner of platforms upon platforms.
Is that really necessary? After all, there's a form of Linux on the iMac and I'd be happy to program with that. )
Thanks,
Dan _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com
-- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com
participants (9)
-
Charles Greathouse -
Dan Asimov -
Fred Lunnon -
James Propp -
Jon Ziegler -
Michael Kleber -
Mike Speciner -
Mike Stay -
Warren D Smith