Binomial coefficient



 DEVELOP > c-Plus-Plus > Binomial coefficient

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 24 Aug 2007 04:41:44 AM
Object: Binomial coefficient
Hi
I'm very sorry for maybe posting something which was already posted.
--> How can I compute the binomial coefficient in C++? <--
Is it possible that there is no existing library for that out there
(expect something that big like the gnu scientific library)?
I searched the groups but couldn't find some good answers to this
question except something like "Hey you - why are you posting that? We
already answered this stuff." but without some _usefull_ links.
Of course I can write something on my one - which I actually did - but
then I have to handle with problems like type-overflow and the
largeness of some factorials (which I can actually compute till 12
with datatype long - not big at all).
So if someone out there knows a good solution for this - I would be
very appreciative.
Thanks a lot
- Egg
.

User: "osmium"

Title: Re: Binomial coefficient 24 Aug 2007 08:48:32 AM
<mail@mathiasbader.de> wrote:

I'm very sorry for maybe posting something which was already posted.

--> How can I compute the binomial coefficient in C++? <--

I would start here. On things of this size and complexity, I often have the
feeling that doing it myself might actually be faster. The alternative is
to find the code, get used to the - probably minimal - documentation, try
it, and hope that the guy that wrote it took care of all the corner cases.
I would guess the threshold to have code accepted might not be really,
really high.
I would look at the C stuff first, I don't think the underlying problem
warrants the complexity of C++.
http://www.snippets.org/
.

User: "Victor Bazarov"

Title: Re: Binomial coefficient 24 Aug 2007 07:11:17 AM
wrote:

I'm very sorry for maybe posting something which was already posted.

--> How can I compute the binomial coefficient in C++? <--

You write a program that does that. You fire up your text editor,
type the program up, save it to a file, compile it, work out all the
syntax errors, link, run, test on known cases, then use it to solve
the cases you don't yet have a solution for.

Is it possible that there is no existing library for that out there
(expect something that big like the gnu scientific library)?

Yes, it is possible. Have you tried looking on the Web?

I searched the groups but couldn't find some good answers to this
question except something like "Hey you - why are you posting that? We
already answered this stuff." but without some _usefull_ links.

Oh... We're sorry. Here is the link where I'd start looking:
www.google.com (don't say I didn't provide any links; I bet that
Google has billions of links available for consumption), or, if you
prefer German, try www.google.de

Of course I can write something on my one - which I actually did - but
then I have to handle with problems like type-overflow and the
largeness of some factorials (which I can actually compute till 12
with datatype long - not big at all).

Oh, yeah. I know what you mean. All those problems with program
writing and debugging -- one actually needs to make programs *work*
before they can *work for him*. Been there, done that. Every day
(well almost), as a matter of fact.

So if someone out there knows a good solution for this - I would be
very appreciative.

Try the Google thing, you might actually find it useful, and not just
for this particular case.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.
User: "Ikaro"

Title: Re: Binomial coefficient 24 Aug 2007 09:44:03 AM
On Aug 24, 8:11 am, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:

m...@mathiasbader.de wrote:

I'm very sorry for maybe posting something which was already posted.


--> How can I compute the binomial coefficient in C++? <--


You write a program that does that. You fire up your text editor,
type the program up, save it to a file, compile it, work out all the
syntax errors, link, run, test on known cases, then use it to solve
the cases you don't yet have a solution for.

Is it possible that there is no existing library for that out there
(expect something that big like the gnu scientific library)?


Yes, it is possible. Have you tried looking on the Web?

I searched the groups but couldn't find some good answers to this
question except something like "Hey you - why are you posting that? We
already answered this stuff." but without some _usefull_ links.


Oh... We're sorry. Here is the link where I'd start looking:

www.google.com (don't say I didn't provide any links; I bet that
Google has billions of links available for consumption), or, if you
prefer German, trywww.google.de

Of course I can write something on my one - which I actually did - but
then I have to handle with problems like type-overflow and the
largeness of some factorials (which I can actually compute till 12
with datatype long - not big at all).


Oh, yeah. I know what you mean. All those problems with program
writing and debugging -- one actually needs to make programs *work*
before they can *work for him*. Been there, done that. Every day
(well almost), as a matter of fact.

So if someone out there knows a good solution for this - I would be
very appreciative.


Try the Google thing, you might actually find it useful, and not just
for this particular case.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

I don't understant this bitter attitude, specially in a newsgroup.

From what I can tell the author is asking a valid question and seem to

have done some research.
If you don't want/can't help, at least stay off the topic.
Last time I checked nobody is forced to respond to topics here.
.
User: "Victor Bazarov"

Title: Re: Binomial coefficient 24 Aug 2007 09:54:53 AM
Ikaro wrote:

On Aug 24, 8:11 am, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:

m...@mathiasbader.de wrote:

I'm very sorry for maybe posting something which was already posted.


--> How can I compute the binomial coefficient in C++? <--


You write a program that does that. You fire up your text editor,
type the program up, save it to a file, compile it, work out all the
syntax errors, link, run, test on known cases, then use it to solve
the cases you don't yet have a solution for.

Is it possible that there is no existing library for that out there
(expect something that big like the gnu scientific library)?


Yes, it is possible. Have you tried looking on the Web?

I searched the groups but couldn't find some good answers to this
question except something like "Hey you - why are you posting that?
We already answered this stuff." but without some _usefull_ links.


Oh... We're sorry. Here is the link where I'd start looking:

www.google.com (don't say I didn't provide any links; I bet that
Google has billions of links available for consumption), or, if you
prefer German, trywww.google.de

Of course I can write something on my one - which I actually did -
but then I have to handle with problems like type-overflow and the
largeness of some factorials (which I can actually compute till 12
with datatype long - not big at all).


Oh, yeah. I know what you mean. All those problems with program
writing and debugging -- one actually needs to make programs *work*
before they can *work for him*. Been there, done that. Every day
(well almost), as a matter of fact.

So if someone out there knows a good solution for this - I would be
very appreciative.


Try the Google thing, you might actually find it useful, and not just
for this particular case.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask



I don't understant this bitter attitude, specially in a newsgroup.

"Bitter"?
To all: does this really come across as bitter?

From what I can tell the author is asking a valid question and seem
to have done some research.

Yes. So? Is that an excuse? Does the general validity of the
question or having done "some research" qualify the inquirer for
charitable donation of code? Or what would Your Majesty accept
as a deserving response? And if such response exists, why didn't
Your Majesty provide it yourselves?

If you don't want/can't help, at least stay off the topic.

I think I did help. If you don't want/can't recognize my help here,
at least stay off my back.

Last time I checked nobody is forced to respond to topics here.

Exactly!
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.
User: ""

Title: Re: Binomial coefficient 24 Aug 2007 10:07:34 AM
Hi
First at all thanks to osmium and Icaro. The link is very helpfull,
although I think there doesn't exist something like a library for this
problem - which I am really surprised of, cause I don't think I am the
only one who needs this function ...
Victor? I'm not sure that you know what you are doing here ...
Actually your answer indeed didn't help me anything - apart from
feeling defensive. Don't you have better things to do??
- Egg
.
User: "osmium"

Title: Re: Binomial coefficient 24 Aug 2007 10:36:41 AM
<mail@mathiasbader.de> wrote:

First at all thanks to osmium and Icaro. The link is very helpfull,
although I think there doesn't exist something like a library for this
problem - which I am really surprised of, cause I don't think I am the
only one who needs this function ...

You have to be alert for synonym's and what some people might think are
synonyms.
I did a google search for <"pascal's trinagle" code c> and trhe second hit
(CS1003, which I looked at first) seems to have code for a recursive
Pascal - the language - code. I figure most programmers should be able to
_read_ (but not write) Pascal. And if I were suufficiently driven I could
probably find something better.
.

User: "Victor Bazarov"

Title: Re: Binomial coefficient 24 Aug 2007 10:34:52 AM
wrote:

First at all thanks to osmium and Icaro. The link is very helpfull,
although I think there doesn't exist something like a library for this
problem - which I am really surprised of, cause I don't think I am the
only one who needs this function ...

Victor? I'm not sure that you know what you are doing here ...
Actually your answer indeed didn't help me anything - apart from
feeling defensive. Don't you have better things to do??

Listen, having spent years in this newsgroup, I've seen scores if not
hundreds of individuals like yourself who, for the lack of better word,
seem *incapable* of the simple task of locating something right under
their nose, be it an algorithm, a page from a manual, or some source
code solving a commonly known problem. And all they do is complain
when somebody just points them to a library catalog, a web search
engine, or to a book. "WHAT? Do I have to actually use the index of
the book to locate what I need? Are you kidding me?"
Now, I just went to Google and searched for "calculate binomial
coefficient c++ code" (without the quotes). What do you know, the
very first page of results is *filled* with links to C++ code that
calculates binomial coefficients. I have HARD TIME BELIEVING that
you had done ANY "research".
So, please forgive me if I don't feel any compassion towards people
like you.
And, for the record, I am here to discuss C++ language. And make
people like you realise that their attitude toward the rest of us
is questionable. Please feel free to feel defensive. The more
you do, the less chance there is you'll come back asking to locate
some source code or library for you.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.

User: "red floyd"

Title: Re: Binomial coefficient 24 Aug 2007 10:36:50 AM
wrote:

Hi

First at all thanks to osmium and Icaro. The link is very helpfull,
although I think there doesn't exist something like a library for this
problem - which I am really surprised of, cause I don't think I am the
only one who needs this function ...

Victor? I'm not sure that you know what you are doing here ...
Actually your answer indeed didn't help me anything - apart from
feeling defensive. Don't you have better things to do??

Victor may have been a bit snippy, but the question was off topic here.
When you post, ask yourself, "Would the answer be essentially the same
if it was in another language than C++?" If you reply "yes", then it's
OT here, and probably belongs in comp.programming, comp.graphics,
comp.object, comp.algorithms, etc...
Then ask yourself, "Does this question make sense if I go to another
platform (e.g. Linux instead of Windows)". If the answer is no, then
you're better off asking in a platform-specific newsgroup
(microsoft.public.*, comp.unix.*).
The OP's question fails the first test -- it's not a C++ specific
question, hence it doesn't belong here.
Please see the FAQ (http://www.parashift.com/c++-faq-lite) for this
group, in particular the netiquette section -- section 5
http://www.parashift.com/c++-faq-lite/how-to-post.html
Thanks
--
red floyd
.
User: "Jim Langston"

Title: Re: Binomial coefficient 24 Aug 2007 07:13:01 PM
"red floyd" <no.spam@here.dude> wrote in message
news:mWCzi.47502$Um6.13409@newssvr12.news.prodigy.net...

mail@mathiasbader.de wrote:

Hi

First at all thanks to osmium and Icaro. The link is very helpfull,
although I think there doesn't exist something like a library for this
problem - which I am really surprised of, cause I don't think I am the
only one who needs this function ...

Victor? I'm not sure that you know what you are doing here ...
Actually your answer indeed didn't help me anything - apart from
feeling defensive. Don't you have better things to do??


Victor may have been a bit snippy, but the question was off topic here.

When you post, ask yourself, "Would the answer be essentially the same if
it was in another language than C++?" If you reply "yes", then it's OT
here, and probably belongs in comp.programming, comp.graphics,
comp.object, comp.algorithms, etc...

Then ask yourself, "Does this question make sense if I go to another
platform (e.g. Linux instead of Windows)". If the answer is no, then
you're better off asking in a platform-specific newsgroup
(microsoft.public.*, comp.unix.*).

The OP's question fails the first test -- it's not a C++ specific
question, hence it doesn't belong here.

Please see the FAQ (http://www.parashift.com/c++-faq-lite) for this group,
in particular the netiquette section -- section 5
http://www.parashift.com/c++-faq-lite/how-to-post.html

Also ask yourself, "did I google for the answer first?"
If an answer is easily found by googling it, that's what you'll usually get
from the newsgroup, try www.google.com, which is what you got. If you don't
know how to use google, learn.
.
User: "osmium"

Title: Re: Binomial coefficient 24 Aug 2007 07:25:00 PM
"Jim Langston" wrote:

If an answer is easily found by googling it, that's what you'll usually
get from the newsgroup, try www.google.com, which is what you got. If you
don't know how to use google, learn.

As I understand it from what he said, the OP searched Usenet (google groups)
instead of searching the Web (using the google search engine). That was his
basic mistake and I can sympathize with that; most of us have to learn
things, our instincts aren't as highly developed as most animals. .

.


User: ""

Title: Re: Binomial coefficient 24 Aug 2007 11:05:35 AM
Hi
Thanks for your help. I admit that I'm not a google-groups profi yet.
Sorry for that.
Greetings
- Egg
.
User: "Default User"

Title: Re: Binomial coefficient 24 Aug 2007 01:13:37 PM
wrote:

Hi

Thanks for your help. I admit that I'm not a google-groups profi yet.
Sorry for that.

Read this:
<http://en.wikipedia.org/wiki/Usenet>
In particular the part:
<http://en.wikipedia.org/wiki/Usenet#Google_Groups_.2F_DejaNews>
Brian
.

User: "=?ISO-8859-1?Q?Erik_Wikstr=F6m?="

Title: Re: Binomial coefficient 24 Aug 2007 12:32:35 PM
On 2007-08-24 18:05,
wrote:

Hi

Thanks for your help. I admit that I'm not a google-groups profi yet.
Sorry for that.

Then I'll teach you a bit more. comp.lang.c++ and a lot of other groups
are not Google groups, but newsgroups (or usenet groups). Google groups
is just an interface through which you can access them (an not a very
good one either), and some other Google specific groups.
--
Erik Wikström
.








  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER