Register to reply

Creating a random combination

by reldridge
Tags: combination, creating, random
Share this thread:
reldridge
#1
Dec3-12, 02:10 PM
P: 5
I am creating a random combination(code) for a client. I need to see what the total number of combinations there can be.

Please let me know if I am using the wrong word Combination vs Permutations.

Formula:
2 letters + 2 numbers + 2 letters
example: TR12FR

The random letters are taken from 24 values:
ABCDEFGHJKLMNPQRSTUVWXYZ

The random Numbers are taken from 8 Values:
23456789

Any help would be greatly appreciated.

Thanks
Ryan.
Phys.Org News Partner Mathematics news on Phys.org
'Moral victories' might spare you from losing again
Fair cake cutting gets its own algorithm
Effort to model Facebook yields key to famous math problem (and a prize)
jedishrfu
#2
Dec3-12, 02:18 PM
P: 2,812
combination is right you're selecting letters, numbers and more letters:

Choices for each character of your 6 charcter code:

24 * 24 * 8 * 8 * 24 * 24 = total number of codes possible

Now if these could be rearranged then you'd have to worry about permutations to elimnate repeats in your counts.
reldridge
#3
Dec3-12, 02:22 PM
P: 5
Thank you -

So de-duping these down to create 2.5 million unique codes using this formula will not be an issue, sense there are 21,233,664 possibilities.

jedishrfu
#4
Dec3-12, 02:39 PM
P: 2,812
Creating a random combination

okay what do you mean by de-duping?
reldridge
#5
Dec3-12, 02:46 PM
P: 5
Well sense this is just a random generator out of excel the possibility of it creating a duplicate is there, so i will need to just remove dupes, or nth select down to 2.5 million unique codes.

Just needed to make sure that the 6 digit using that formula could create that many unique codes.
phinds
#6
Dec3-12, 02:51 PM
PF Gold
phinds's Avatar
P: 6,124
Quote Quote by reldridge View Post
Well sense this is just a random generator out of excel the possibility of it creating a duplicate is there ...
So you have a belief that "true" random would not include any dupes?

How would you create 100000 consecutive random numbers from 1 to 100 ?
jedishrfu
#7
Dec3-12, 03:02 PM
P: 2,812
this reminds of how new programmers used to construct a deck of randomly sorted cards.

generate a number from 0-51 check if its present in the crd deck array if so then generate another.

The better approach is to generate a sorted sequence of cards into an array and then to randomly shuffle two cards by selecting two indexes at random and swapping the cards.
reldridge
#8
Dec3-12, 03:22 PM
P: 5
Quote Quote by phinds View Post
So you have a belief that "true" random would not include any dupes?
No belief, was just stating that there could be duplicate codes during the random selection and i would need to remove the duplicates until reaching my goal of 2.5 unique codes...
reldridge
#9
Dec3-12, 03:23 PM
P: 5
Thanks for the help.


Register to reply

Related Discussions
Find the number of ways an odd number of objects can be chosen Precalculus Mathematics Homework 8
Combinations (How many combinations contain specific numbers)? Calculus & Beyond Homework 2
Sum of combinations Precalculus Mathematics Homework 12
AAABBBCCDE Combinations Precalculus Mathematics Homework 2
Combinations of a set Programming & Computer Science 3