Re: combinations & permutation : how to generate a list of numbers

2011-05-05 Thread fakessh
Le jeudi 5 mai 2011 18:43, Paul Johnson a écrit : > On Thu, May 05, 2011 at 08:20:13AM -0700, eventual wrote: > > Hi, Concerning the game Lotto, how do I generate a list of 6 numbers out > > of 12 numbers,  eg > > > > given the 12 numbers as 1,2,3,4,5,6,7,8,9,10,11,12 > > the list of 6 numbers goes

Re: combinations & permutation : how to generate a list of numbers

2011-05-05 Thread Paul Johnson
On Thu, May 05, 2011 at 08:20:13AM -0700, eventual wrote: > Hi, Concerning the game Lotto, how do I generate a list of 6 numbers out of > 12 > numbers,  eg > > given the 12 numbers as 1,2,3,4,5,6,7,8,9,10,11,12 > the list of 6 numbers goes like this :- > 1,2,3,4,5,6 > 1,2,3,4,5,7 > 1,2,3,4,5,8

Re: combinations

2008-10-07 Thread Jenda Krynicky
From: Ryan <[EMAIL PROTECTED]> > While I agree that it would be a good homework assignment it's not. > What I have is a logic look up table for health records using an EAV > model (in an SQL table): > > rowID - key - value > > From a web form I select some keys and values. When subm

Re: combinations

2008-10-07 Thread Paul Johnson
On Mon, Oct 06, 2008 at 08:32:22PM -0400, Stephen Gallagher wrote: > I can come up with one example where this might be interesting. Imagine you > are a software tester and were tasked with identifying all potential > variable combinations that needed to be covered/tested. Risk mitigation, > don

Re: combinations

2008-10-07 Thread Stephen Gallagher
- Original Message - From: "Jason Trebilcock" <[EMAIL PROTECTED]> To: "Perl Beginners" Sent: Monday, October 6, 2008 7:57:23 PM GMT -05:00 US/Canada Eastern Subject: RE: combinations -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: M

Re: combinations

2008-10-06 Thread Ryan
While I agree that it would be a good homework assignment it's not. What I have is a logic look up table for health records using an EAV model (in an SQL table): rowID - key - value From a web form I select some keys and values. When submitted, I create a new rowID and put in the

RE: combinations

2008-10-06 Thread Jason Trebilcock
-Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 12:37 PM To: Perl Beginners Cc: Randal L. Schwartz; Mr. Shawn H. Corey Subject: Re: combinations What are the real-world problems that are solved using a list of combinations of sets of items

Re: combinations

2008-10-06 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> The homework aroma entices me to respond with another question - Rob> hopefully an educational one. I hadn't thought of watermarking them Rob> though - good idea :) I didn't come up with the watermark idea. Can't remember where I saw it..

Re: combinations

2008-10-06 Thread Rob Dixon
Randal L. Schwartz wrote: >> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: > > Peter> Did you see the smiley? Randal might have been more inclined to give a > Peter> less cute answer if the poster said what he wanted this for, because it > Peter> does sound like homework. > > Precisely.

Re: combinations

2008-10-06 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Mon, 2008-10-06 at 09:02 -0700, Randal L. Schwartz wrote: >> >> As in, my answer started with a joke. Hence the smiley. But I did have a >> puzzling question about this recurring need for "all combinations" and >> always stated rather abstractly, without the real-wo

Re: combinations

2008-10-06 Thread Rob Dixon
Randal L. Schwartz wrote: >> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: > > "Mr> On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote: >>> Eh? My question has *nothing* to do with my solution. My question >>> has to do with the original question. > > "Mr> And my question

Re: combinations

2008-10-06 Thread Mr. Shawn H. Corey
On Mon, 2008-10-06 at 09:02 -0700, Randal L. Schwartz wrote: > As in, my answer started with a joke. Hence the smiley. But I did > have a > puzzling question about this recurring need for "all combinations" and > always > stated rather abstractly, without the real-world need backing it up. > Yo

Re: combinations

2008-10-06 Thread Randal L. Schwartz
> "Peter" == Peter Scott <[EMAIL PROTECTED]> writes: Peter> Did you see the smiley? Randal might have been more inclined to give a Peter> less cute answer if the poster said what he wanted this for, because it Peter> does sound like homework. Precisely. If it smells like homework to me, I t

Re: combinations

2008-10-06 Thread Randal L. Schwartz
> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: "Mr> On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote: >> Eh? My question has *nothing* to do with my solution. My question >> has to do with the original question. "Mr> And my question is why isn't these abilities of glob

Re: combinations

2008-10-06 Thread Peter Scott
On Sun, 05 Oct 2008 19:06:35 -0400, Mr. Shawn H. Corey wrote: > On Sun, 2008-10-05 at 15:11 -0700, Randal L. Schwartz wrote: >> my @result = map [split /-/], glob "{a}-{b,c}-{d,e,f}-{a}"; >> >> :-) >> >> But seriously, why does this come up often? > > Because your solution relies on knowledge of

Re: combinations

2008-10-06 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote: >> >> Eh? My question has *nothing* to do with my solution. My question >> has to do with the original question. > > And my question is why isn't these abilities of glob described in > perldoc? They are des

Re: combinations

2008-10-06 Thread Mr. Shawn H. Corey
On Sun, 2008-10-05 at 21:30 -0700, Randal L. Schwartz wrote: > Eh? My question has *nothing* to do with my solution. My question > has to do with the original question. And my question is why isn't these abilities of glob described in perldoc? -- Just my 0.0002 million dollars worth, Sh

Re: combinations

2008-10-05 Thread Randal L. Schwartz
> "Shawn" == Shawn H Corey <[EMAIL PROTECTED]> writes: Shawn> Because your solution relies on knowledge of bash which many Windows Shawn> users do not have. Eh? My question has *nothing* to do with my solution. My question has to do with the original question. -- Randal L. Schwartz - Ston

Re: combinations

2008-10-05 Thread Mr. Shawn H. Corey
On Sun, 2008-10-05 at 15:11 -0700, Randal L. Schwartz wrote: > my @result = map [split /-/], glob "{a}-{b,c}-{d,e,f}-{a}"; > > :-) > > But seriously, why does this come up often? Because your solution relies on knowledge of bash which many Windows users do not have. Also this ability of glob is

Re: combinations

2008-10-05 Thread Randal L. Schwartz
> "Ryan" == Ryan <[EMAIL PROTECTED]> writes: Ryan> my %data = ( Ryan> k1 => 'a', Ryan> k2 => ['b', 'c'], Ryan> k3 => ['d', 'e', 'f'] Ryan> k4 => 'a' Ryan> ); Ryan> I want to get all the possible combinations: my @result = map [split /-/], glob "{a}-{b,c}-{d,e,f}-{a}"; :-) But ser

Re: combinations

2008-10-05 Thread Mr. Shawn H. Corey
On Sun, 2008-10-05 at 17:33 -0400, Mr. Shawn H. Corey wrote: > sub combos { > my %data = @_; > my @keys = sort keys %data; > > return _combos( [EMAIL PROTECTED], %data ); > } > First correction: sub combos { my %data = @_; my @keys = keys %data; return _combos( [EMAIL PROTECTED], %

Re: combinations

2008-10-05 Thread Mr. Shawn H. Corey
On Sun, 2008-10-05 at 15:29 -0500, Ryan wrote: > my %data = ( > k1 => 'a', > k2 => ['b', 'c'], > k3 => ['d', 'e', 'f'] > k4 => 'a' > ); > > I want to get all the possible combinations: > > k1 => a > k2 => b > k3 => d > k4 => a > > k1 => a > k2 => c > k3 => d > k4 => a >

Re: combinations

2003-08-14 Thread Rob Dixon
"David Byrne" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am fairly new to Perl and haven't approached a scipt > this complex or computation this intensive. So I > would certainly appreciate any advice. > > I have successfully created a hash of arrays > equivalent to a 122 x 6

Re: combinations

2003-08-14 Thread david
"David Byrne" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am fairly new to Perl and haven't approached a scipt > this complex or computation this intensive. So I > would certainly appreciate any advice. > > I have successfully created a hash of arrays > equivalent to a 122 x 61