Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #14536 > unrolled thread
| Started by | pete <pfiland@mindspring.com> |
|---|---|
| First post | 2011-12-12 19:29 -0500 |
| Last post | 2011-12-13 21:52 -0500 |
| Articles | 1 on this page of 41 — 15 participants |
Back to article view | Back to comp.lang.c
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Toughest Probability Question pete <pfiland@mindspring.com> - 2011-12-12 19:29 -0500
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-13 04:46 +0000
Re: Toughest Probability Question Geoff <geoff@invalid.invalid> - 2011-12-12 22:19 -0800
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-13 09:19 +0000
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-13 13:43 +0000
Re: Toughest Probability Question Keith Thompson <kst-u@mib.org> - 2011-12-13 10:27 -0800
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-13 19:52 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-13 20:06 +0000
Re: Toughest Probability Question Keith Thompson <kst-u@mib.org> - 2011-12-13 12:14 -0800
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-13 23:34 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-14 00:24 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-13 19:27 +0000
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-13 23:56 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-14 00:24 +0000
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-14 12:12 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-14 17:47 +0000
Re: Toughest Probability Question gordonb.qunma@burditt.org (Gordon Burditt) - 2011-12-15 08:22 -0600
Re: Toughest Probability Question Robert Wessel <robertwessel2@yahoo.com> - 2011-12-15 14:41 -0600
Re: Toughest Probability Question superpollo <superpollo@tznvy.pbz> - 2011-12-15 19:14 +0100
Re: Toughest Probability Question Keith Thompson <kst-u@mib.org> - 2011-12-14 13:12 -0800
Re: Toughest Probability Question Willem <willem@toad.stack.nl> - 2011-12-14 21:53 +0000
Re: Toughest Probability Question "BartC" <bc@freeuk.com> - 2011-12-14 22:35 +0000
Re: Toughest Probability Question Willem <willem@toad.stack.nl> - 2011-12-15 09:07 +0000
Re: Toughest Probability Question Geoff <geoff@invalid.invalid> - 2011-12-15 02:07 -0800
Re: Toughest Probability Question Keith Thompson <kst-u@mib.org> - 2011-12-15 12:13 -0800
Re: Toughest Probability Question Geoff <geoff@invalid.invalid> - 2011-12-15 13:03 -0800
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-15 21:36 +0000
Re: Toughest Probability Question Geoff <geoff@invalid.invalid> - 2011-12-13 16:35 -0800
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-14 01:20 +0000
Re: Toughest Probability Question Keith Thompson <kst-u@mib.org> - 2011-12-13 16:44 -0800
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-14 01:20 +0000
Re: Toughest Probability Question James Dow Allen <jdallen2000@yahoo.com> - 2011-12-15 02:33 -0800
Re: Toughest Probability Question gwowen <gwowen@gmail.com> - 2011-12-15 05:38 -0800
Re: Toughest Probability Question Thad Smith <ThadSmith@acm.org> - 2011-12-18 23:34 -0700
Re: Toughest Probability Question Bill Reid <hormelfree@gmail.com> - 2011-12-14 07:07 -0800
Re: Toughest Probability Question Kaz Kylheku <kaz@kylheku.com> - 2011-12-13 06:55 +0000
Re: Toughest Probability Question Seebs <usenet-nospam@seebs.net> - 2011-12-13 09:19 +0000
Re: Toughest Probability Question pete <pfiland@mindspring.com> - 2011-12-13 12:15 -0500
Re: Toughest Probability Question pete <pfiland@mindspring.com> - 2011-12-13 13:20 -0500
Re: Toughest Probability Question Peter Nilsson <airia@acay.com.au> - 2011-12-13 18:15 -0800
Re: Toughest Probability Question pete <pfiland@mindspring.com> - 2011-12-13 21:52 -0500
Page 3 of 3 — ← Prev page 1 2 [3]
| From | pete <pfiland@mindspring.com> |
|---|---|
| Date | 2011-12-13 21:52 -0500 |
| Message-ID | <4EE80F5B.6116@mindspring.com> |
| In reply to | #14594 |
Peter Nilsson wrote:
>
> > pete wrote:
> > I had it right the first time,
> > but I rewrote the whole thing anyway.
> > ...
> > #define YEAR 365 /* 366 */
>
> To nitpick, this is limiting people to those only born in non
> leap years, or those only born in leap years. The general figure
> is somewhere in between...
>
> #include <stdio.h>
>
> double P2(int f29, int oth, int n)
> {
> double p = 0;
> if (n == 0) return 1;
> if (oth < 365)
> p += (303. / 400 + 97. / 400 * 365 / 366)
> * (365 - oth) / 365 * P2(f29, oth + 1, n - 1);
> if (f29 < 1)
> p += 97. / 400 * 1 / 366 * P2(f29 + 1, oth, n - 1);
> return p;
> }
>
> double P(int n) { return P2(0, 0, n); }
>
> int main(void)
> {
> int n = 0;
> double p;
>
> do {
> p = P(++n);
> printf("%3d: %7.3f%%\n", n, 100 * (1 - p));
> } while (1 - p < .5);
>
> return 0;
> }
I was wondering about how to deal with that.
--
pete
[toc] | [prev] | [standalone]
Page 3 of 3 — ← Prev page 1 2 [3]
Back to top | Article view | comp.lang.c
csiph-web