[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TIMTOWTDI letter permutation

Peter Fitzgibbons

4/28/2005 2:31:00 PM

> Endy Tjahjono <endy_c@deadspam.com> wrote:
> ...
>
> Notice how the first 6 start with 'a', the next 6 with 'b', etc.
Within each block of 6, you have 2 permutations starting with each of
the remaining letters. You can generalise this pattern to directly
calculate the ith permutation of n letters, given n and i. Your
generator then becomes
>
> 1..upto(n.factorial) {|i| puts permutation(n, i)}
>
> with no recursion at all.
>
> martin

What's the practical applicatin of being able to pick-off the i.th
permutation of an array?

Peter J. Fitzgibbons
Applications Manager
Lakewood Homes - "The American Dream Builder"(r)
Peter.Fitzgibbons@Lakewoodhomes.net
(847) 884-8800







4 Answers

Martin DeMello

4/28/2005 6:40:00 PM

0

Peter Fitzgibbons <Peter.Fitzgibbons@lakewoodhomes.net> wrote:
>
> What's the practical applicatin of being able to pick-off the i.th
> permutation of an array?

One I can think of offhand is an easy way to generate uniformly distributed
shuffles without repeats.

martin

marika

7/11/2008 1:08:00 AM

0


"Kadaitcha Man" <nospam.nospam.nospam@gmail.com> wrote in message
news:y5ydnVyJwIYQAejVnZ2dnUVZ_jOdnZ2d@posted.toastnet...

>
> No pussy, I am afraid it will smell like a dead
> fish.....Heehee......Donchaknow?
>
>

salt and bleach are both preservatives

you think you'd never heard of lutfiske


mk5000

perhaps in very particular circumstances emotional truth can shine only
through the curtain of farce"---"serve the people" yan lianke

Kadaitcha Man

7/11/2008 5:04:00 AM

0


"marika" <marika5000@gmail.com> wrote in message
news:itednbDqUuHrL-vVnZ2dnUVZ_jydnZ2d@rcn.net...
>
> "Kadaitcha Man" <nospam.nospam.nospam@gmail.com> wrote in
> message
> news:y5ydnVyJwIYQAejVnZ2dnUVZ_jOdnZ2d@posted.toastnet...
>
>>
>> No pussy, I am afraid it will smell like a dead
>> fish.....Heehee......Donchaknow?
>
> salt and bleach are both preservatives
> you think you'd never heard of lutfiske
> mk5000


HEY Pussy, we're talking about Electrolysis, putting salt ON IT
is deadly as fish. We're not talking about preserving foods, OK
smelly pussy?


marika

7/12/2008 1:34:00 AM

0


"Kadaitcha Man" <nospam.nospam.nospam@gmail.com> wrote in message
news:iZGdndkTA5IydOvVnZ2dnUVZ_h7inZ2d@posted.toastnet...
>
>>
>> salt and bleach are both preservatives
>> you think you'd never heard of lutfiske
>> mk5000
>
>
> HEY Pussy, we're talking about Electrolysis, putting salt ON IT
> is deadly as fish. We're not talking about preserving foods, OK
> smelly pussy?
>


the herring they use in lutefisk has these really fine bones that are like
hair, do you think your electrolysis process will work to help remove them
before we eat the LF?

doncha know heee heeee
Jest thought you would like this shocking joke!

o but the way, there's no "we're" except me and you.

O sure you keep reposting the same lame hydrogen generator troll bait post
in seh, and keep trying to recrosspost it to a bunch of groups hoping for
bites, but there's no "we're talking" when it's just you pumping out the
same post over and over and over.

how's the brain tumor btw? recover from it recently? or are you still dead?

mk5000

http://www.pmsimon.com/archives/2006_02.h...