Questions about the world of GMAT Math from other sources and general math related questions.
MansourehJ243
Forum Guests
 
Posts: 1
Joined: Wed Jul 02, 2014 4:24 am
 

Combinatorics

by MansourehJ243 Wed Jul 02, 2014 11:32 am

I have numbers from 1 to 2500, and I need to number all the possible non-repeated strings of them with length 8. For example:
1,2,3,4,5,6,7,8---index 1
1,2,3,4,5,6,7,9---index 2

I want to develop a code which ask for the index and gives me the related string. For example:
Mycode(1)----> 1,2,3,4,5,6,7,8

Up to now the problem is pretty easy, and I can do it in a couple of lines. The thing which makes the problem very difficult for me is that we have constraints. Each number has problem with some of the numbers. For example, 1 never comes with 2 or 65 or 66. Therefore, I have to remove all the infeasible strings when numbering them.
I developed a recursive code for it, but it took a lot of time for finding each string, and time consumption is pretty important for me.

Thanks in advance and looking forward to hearing back from you.
RonPurewal
Students
 
Posts: 19744
Joined: Tue Aug 14, 2007 8:23 am
 

Re: Combinatorics

by RonPurewal Thu Jul 03, 2014 5:35 am

Hello,
This forum is for GMAT-related problems, not for problems about coding software.

Thanks.