Re: Permutations

From: osmium (r124c4u102_at_comcast.net)
Date: 12/24/03


Date: Wed, 24 Dec 2003 08:24:39 -0800

Ed Neukirch writes:

> I would like to determine nPr -- that is, the permutation of 'n' items
> taken 'r' at a time preferably using the prev_permutation and
> next_permutation functions of the STL. I 'googled' but could find nothing
> useful.
>
> I would appreciate any guidance or direction toward either algorithms or
> source code.

That's an interesting problem and one that is more and more likely to come
up as time goes by. npr has been kidnapped by a very popular acronym,
National Public Radio and the noise overwhelms the signal. I too was
unsuccessful in finding what you want to know via google. One of the
problems is people posting "my favorite links" pages and these people know
what you want but they also have NPR on their links. As a matter of fact I
have npr in *my* list of links; but so far I have been too shy to think that
anyone else would find my set of links interesting or useful. I am
fascinated by the potential and problems in using Google, which accounts for
this rather long post.

My favorite alternative solution is to look at a book. Your text may have a
section on probabilities and such like. I would avoid using the STL in my
solution unless I had definite contrary advice, from someone with authority,
in my program.

It's kind of cheating google, since I already had, going in, a list of math
pages. But you might try starting here.

http://mathworld.wolfram.com/topics/ProbabilityandStatistics.html



Relevant Pages

  • Re: How to read Unicode(Big-Endian) text file(s) in Non-MFC
    ... Google is your friend here. ... The difference is that method atdoes a bounds-checking on index. ... So, using atis more secure, but more slow; ... There is a lot more, like using iterators (a very powerful STL concept, ...
    (microsoft.public.vc.language)
  • google "top coder" contest = stacked against C++ coders
    ... I recently tried out the Google "top coder" contest, ... I noticed immediately that they expected me to know STL. ...
    (alt.comp.lang.learn.c-cpp)
  • google "top coder" contest = stacked against C++ coders
    ... I recently tried out the Google "top coder" contest, ... I noticed immediately that they expected me to know STL. ...
    (comp.lang.cpp)
  • Re: multiset segfault
    ... > page and on Google for my STL information. ... some sections on STL containers, and it is anyway worth reading the ... if you google for "STL tutorial" you'll find many more ...
    (comp.lang.cpp)
  • Re: New Pain MRI!!
    ... Just googled for NPR and then searched for MRI on the NPR page and ... Actually, there were a lot of articles on MRI when I searched for it, ... I searched google and couldnt come up with an ...
    (alt.support.chronic-pain)