
Algebra PreAlgebra and Basic Algebra Math Forum 
 LinkBack  Thread Tools  Display Modes 
May 17th, 2010, 07:21 PM  #1 
Newbie Joined: May 2010 Posts: 2 Thanks: 0  find unique n number combination in total n number
Hi all, I have a math question related to my programming problem. It is best to describe in scenario: find all possible x digit number in range(1 to y) (norepeat) find all possible 1 digit number in 16 (norepeat) answer = 1,2,3,4,5,6 find all possible 2 digit number in 16 (no repeat) (eg. 12, and 21 are the same) answer = 12,13,14,15,16 = 23,24,25,26 = 34,35,36 = 45,46 = 56 find all possible 3 digit number in 16 (no repeat) (eg, 123 and 321 are the same) answer = 123, 234, ... and so on I'm stuck in these, I need to come out with a formula as the x and y can be plug in Any help will be much appreciated! Thanks in advance 
May 17th, 2010, 08:26 PM  #2 
Global Moderator Joined: Nov 2009 From: Northwest Arkansas Posts: 2,766 Thanks: 4  Re: find unique n number combination in total n number
The number is the binomial coefficient. (http://en.wikipedia.org/wiki/Binomial_coefficient) To find all of the possible xdigit numbers would (obviously) require an algorithm. What have you tried? 
May 18th, 2010, 05:39 AM  #3  
Newbie Joined: May 2010 Posts: 2 Thanks: 0  Re: find unique n number combination in total n number Quote:
http://www.sonyjose.in/blog/?p=62  
May 18th, 2010, 06:01 PM  #4 
Member Joined: Apr 2010 Posts: 65 Thanks: 0  Re: find unique n number combination in total n number
PARI/GP Code: f(c,z,b,n,k)={ if(z<b, print1(c" "); if(n, f(c+1, z , b*k \n, n1, k1 )); , /* else */ if(n, f(c+1, zb, b*(nk)\n, n1, k )); ); } comb(n,k)={ for (i=0,binomial(n,k)1, print1(i") "); f(1,i,binomial(n1,k1),n1,k1); print1("\n"); ); } comb(6,2)
binomial(6,2)=6/1*5/2 binomial(6,3)=6/1*5/2*3/3 

Tags 
combination, find, number, total, unique 
Search tags for this page 
Click on a term to search for related topics.

Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Total number of combinations  crone  Advanced Statistics  5  July 26th, 2013 02:01 PM 
What is the total number of string in ?*  muhammadmasood  Computer Science  7  September 14th, 2012 02:03 PM 
Number of unique after n samples  BigBugBuzz  Advanced Statistics  3  December 15th, 2010 02:25 PM 
The total number of pairs of integers?  Kenzo  Algebra  14  August 13th, 2009 01:29 PM 
Find minimum number of possible combination  shalinisharma512  Number Theory  3  April 4th, 2009 01:56 PM 