Noob mathematical question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hegerp
Forum Newbie
Posts: 1
Joined: Wed Dec 07, 2011 12:09 pm

Noob mathematical question

Post by hegerp »

Hi, I'm new here and I know this is a noob question but I'm interested in how to do this. I'm learning php basics. I know how arrays, integers and strings work. I can do if conditions and for or while loops.

My problem is:
I have got 80 numbers (1-80)
And I would like to list all combinations of number-picking if
1. I can choose 10 numbers from the 80 and I can only pick a number once.
2. The same but only with 20 numbers.

I would like to list these two cases. I'm very interested in how to use these. Oh and I would also like to put all these veriations into and array, like... possibilities[0] = "1-2-3-4-5-6-7-8-9-10", possibilities[0] = "1-2-3-4-5-6-7-8-9-11" and so on.

Thank you in advance.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Noob mathematical question

Post by Christopher »

hegerp wrote:And I would like to list all combinations of number-picking if
There are a large number of possible combinations. I am not sure what you are doing, but you would probably be better to limit the combinations by checking for duplicates. What are you trying to do?
(#10850)
Post Reply