MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: INFORMATIONS

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17409] Re: [mg17292] INFORMATIONS
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Thu, 6 May 1999 02:44:20 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Francesco Paolone [lwpao at tin.it] wrote:

> I am a new "Mathematica" user.
> I'm not a mathematician but interested in "Mathematica"
> possibilities about
> combinatory calculations.
> I've read the about Help file but I haven't understood how in
> practice I can
> do it.  How to order the computer to do for example this:
> input:  3 5 15 22 52 90
> output: show me all the possible combinations for those numbers.
> Can you teach me about, showing me step by step what I can do?
> My "Mathematica" version is 3.0 and my operative system is Mac OS 8.5
>
> I'd like also informations about Italian sites for "Mathematica" and about
> combinatorica related to Lottos and Lotteries (also in english).

Francesco:

There is no shortcut to learn about the possibilities of Mathematica: you
must devote some time to read The Book or some of the excellent books on the
subject. If you take a look at Add-ons in the Help browser, you'll find a
standard package called DiscreteMath`Combinatorica`, which will provide you
with functions such as Permutations or KSubsets (i.e., combinations), etc.

Thus:

In[1]:=
<<DiscreteMath`Combinatorica`
In[2]:=
listA={3,5,15,22,52,90};
In[3]:=Permutations[listA];
In[4]:=
KSubsets[listA,3]
Out[4]=
{{3,5,15},{3,5,22},{3,5,52},{3,5,90},{3,15,22},{3,15,52},{3,15,90},{3,22,52}
,{
    3,22,90},{3,52,90},{5,15,22},{5,15,52},{5,15,90},{5,22,52},{5,22,90},{5,
    52,90},{15,22,52},{15,22,90},{15,52,90},{22,52,90}}
In[5]:=
KSubsets[listA,4]
Out[5]=
{{3,5,15,22},{3,5,15,52},{3,5,15,90},{3,5,22,52},{3,5,22,90},{3,5,52,90},{3,
    15,22,52},{3,15,22,90},{3,15,52,90},{3,22,52,90},{5,15,22,52},{5,15,22,
    90},{5,15,52,90},{5,22,52,90},{15,22,52,90}}

I omitted the output of the Permutations, but you may take a glance at the
6! lists.

Good luck,

Tomas Garza
Mexico City



  • Prev by Date: RE: Groebner bases
  • Next by Date: compile NIntegrate
  • Previous by thread: Re: INFORMATIONS
  • Next by thread: Re: INFORMATIONS