Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

4 digit integer, 1-6 possible. How many combinations?

10 REPLIES 10
Reply
Message 1 of 11
mdhutchinson
15925 Views, 10 Replies

4 digit integer, 1-6 possible. How many combinations?

Given a 4 digit integer.
each digit can be 1 through 6.
No two digits the same.

How can I calculate the number of possible?

4234
1426
5146
2513
...
etc, etc.
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: mdhutchinson

6 possible characters for the first one, 5 for the second, 4 for the third, 3 left available for the
fourth.

6 x 5 x 4 x 3 = 360 possible combinations.
--
Kent Cooper


wrote...
Given a 4 digit integer.
each digit can be 1 through 6.
No two digits the same.

How can I calculate the number of possible?

4234
1426
5146
2513
...
etc, etc.
Message 3 of 11
Anonymous
in reply to: mdhutchinson

if "No two digits the same." does 4234 qualify? Message was edited by: SEANT
Message 4 of 11
Anonymous
in reply to: mdhutchinson

Or, to put it more generically for any integer of n digits, when each digit can be any of m choices,
without repeats within the integer, the number of possible integers is:

m! / (m-n)!

In your sample case, n = 4, m = 6:

6! / (6-4)! = 720 / 2 = 360

--
Kent Cooper


"Kent Cooper" wrote...
6 possible characters for the first one, 5 for the second, 4 for the third, 3 left available for the
fourth.

6 x 5 x 4 x 3 = 360 possible combinations.
--
Kent Cooper


wrote...
Given a 4 digit integer.
each digit can be 1 through 6.
No two digits the same.

How can I calculate the number of possible?

4234
1426
5146
2513
...
etc, etc.
Message 5 of 11
Anonymous
in reply to: mdhutchinson

Good catch -- I didn't look carefully enough to notice that....

If the limitation is only that no two *adjacent* digits can be the same, then it's

6 x 5 x 5 x 5 = 750 possible combinations.

Or, in my generic terminology where m is the number of characters to choose from for an integer of n
digits,

m x [(m-1)^(n-1)]

or in the example case

6 x 5^3 = 750

--
Kent Cooper


wrote...
if "No two digits the same." does 4234 qualify?

Message was edited by: SEANT
Message 6 of 11
Anonymous
in reply to: mdhutchinson

The "4234" may have been a typo. None the less, Kent, you've got that Permutation Theory covered. ;^)
Message 7 of 11
mdhutchinson
in reply to: mdhutchinson

yeh... good catch... the 4234 was a typo.

thanks all!
Message 8 of 11
mdhutchinson
in reply to: mdhutchinson

... but one question.

Does your solution cover the following combinations ...

6241
4612

these are the same numbers used... but in a different order.
Message 9 of 11
Anonymous
in reply to: mdhutchinson

Yes. My approach includes all possible orders of any combination of the same four numbers among the
possible integers. (If you don't want it that way, it's a lot more complicated, because a given
number would need to have limits imposed not only from within itself, but also in relation to some
other number, however you would establish that relationship.)
--
Kent Cooper


wrote...
... but one question.

Does your solution cover the following combinations ...

6241
4612

these are the same numbers used... but in a different order.
Message 10 of 11
Anonymous
in reply to: mdhutchinson

I'd like to say that I am seeing this because I am trying to unlock a code.

If you can please send me an gmial of all them combinations.

Thank you for much for your time...

Message 11 of 11
Sea-Haven
in reply to: mdhutchinson

1 2 3 4... 6999 is the answer wore out 2 biros getting to the answers and a couple of sheets of paper. Praticed on my bike combo lock. Dont forget the lawyer fee for "unlock a code".

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report