wolframscience.com

A New Kind of Science: The NKS Forum : Powered by vBulletin version 2.3.0 A New Kind of Science: The NKS Forum > Applied NKS > Help Please i need all possible conbinations
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
Romeo


Registered: Nov 2005
Posts: 2

Help Please i need all possible conbinations

Hi please i would need someone to help me out on this: ( I have two teams in each game( team A and team B) with three possibilities that is a win(1) , a draw(x) or a loss(2).
There are twelve games in total. What are the various combinations possible. while predicting the outcome in all the games and geting them right at thesame time.

I do know that it is a lot of combinations so please if anyone can help me out i would be very greatful please do email it to rummyigho@yahoo.com

Example of combinations required:

If team A Wins in all the twelve matches then one conbination will be 111111111111, another possibility is if team A wins in two matches and Draws in three matches and team b wins in seven matches then then the conbination will be 11XXX2222222.

Please i would be most greatful to anyone that will be able to comeup with all possible combinations. please do email me with your with the conbinations as soon as possible my email address is rummyigho@yahoo.com thanks.

Report this post to a moderator | IP: Logged

Old Post 11-18-2005 10:33 AM
Romeo is offline Click Here to See the Profile for Romeo Click here to Send Romeo a Private Message Click Here to Email Romeo Edit/Delete Message Reply w/Quote
Jason Cawley
Wolfram Science Group
Phoenix, AZ USA

Registered: Aug 2003
Posts: 712

In Mathematica, you could just type -

Tuples[{0,1,2},12]

You'd get a list of 531441 lists each 12 long, with each element out of the alphabet 0, 1, 2. The total number comes out that way because that is 3^12.

But it is somewhat easier in a simple case like this to just treat each combination as a 12 digit number in base 3. You are just counting through them, from

{0,0,0,0,0,0,0,0,0,0,0} to
{0,0,0,0,0,0,0,0,0,0,1} to
{0,0,0,0,0,0,0,0,0,0,2} to
{0,0,0,0,0,0,0,0,0,1,0} to
{0,0,0,0,0,0,0,0,0,1,1} ...

So you can get any portion of them and uniquely name each one, as -

IntegerDigits[x-1,3,12]

With x running from 1 to 531441. (Or to start at the "zeroth" and go to 531440, just remove that -1).

So, say I wanted the first 100. I'd Map that over Range[100] (which just gives a list from 1 to 100), like this -

IntegerDigits[#-1, 3, 12]&/@Range[100]

When I want the next batch I'd just ask for -

IntegerDigits[#-1, 3, 12]&/@Range[101,200]

You can get the whole lot in one go with Tuples, or with a big Range or a Table. But since that is rather large and unwieldy, for most purposes it will be more useful to get each from its integer "name", as above.

Report this post to a moderator | IP: Logged

Old Post 11-18-2005 11:39 AM
Jason Cawley is offline Click Here to See the Profile for Jason Cawley Click here to Send Jason Cawley a Private Message Edit/Delete Message Reply w/Quote
Romeo


Registered: Nov 2005
Posts: 2

Thanks but still need help

Thanks for your effort i do appreciate it, but i must tell you i am not good in mathematics and wouldnt know how to go about calculating it.

If you can help me to come up with them (531441 combinations) and please do send them to my email address i will appreciate it i wouldnt mind showing my appreciation by paying a fee.

I will try out the fomular u sent and see how far i can go . my email address is rummyigho@yahoo.com

Report this post to a moderator | IP: Logged

Old Post 11-21-2005 06:17 AM
Romeo is offline Click Here to See the Profile for Romeo Click here to Send Romeo a Private Message Click Here to Email Romeo Edit/Delete Message Reply w/Quote
Jason Cawley
Wolfram Science Group
Phoenix, AZ USA

Registered: Aug 2003
Posts: 712

Sent, as a 1.3 meg zip of a 20 meg text file.

For those with Mathematica, to send output this large it is a good idea to bypass the front end and not bother displaying the output. So I sent the evaluated form of Tuples to a text file with "Put", like this -


Tuples[{0,1,2},12]>>"combinations.txt"


I hope it is useful.

Report this post to a moderator | IP: Logged

Old Post 11-21-2005 01:01 PM
Jason Cawley is offline Click Here to See the Profile for Jason Cawley Click here to Send Jason Cawley a Private Message Edit/Delete Message Reply w/Quote
Alex001


Registered: Aug 2012
Posts: 5

re

Hello all, I have been hoping to solve a problem involving all possible combinations for a set of integers.

Report this post to a moderator | IP: Logged

Old Post 02-16-2013 10:15 AM
Alex001 is offline Click Here to See the Profile for Alex001 Edit/Delete Message Reply w/Quote
Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread


 

wolframscience.com  |  wolfram atlas  |  NKS online  |  web resources  |  contact us

Forum Sponsored by Wolfram Research

© 2004-13 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. | Disclaimer | Archives