0

How can I work out the amount of possible combinations contained within the string 'cheese > beer'. This includes all letters in the English alphabet, spaces, uppercase and lowercase letters, numbers, and all the symbols found on a standard QWERT keyboard.

This is to understand how many attempts it would take a program to 'brute force' this phrase, starting at 'a', then trying every single possible combination of letters, spaces, numbers, symbols, until it finds the phrase 'cheese < beer'.

levaa
  • 3
  • Are you asking that if we use every character usable, how many 13 letter strings can we form?, or are we just limited to those within 'cheese>beer'? – Christopher Marley Apr 24 '18 at 05:06
  • Are the two spaces on sides of $>$ considered as "letters"? [then there would be 13 letters] – coffeemath Apr 24 '18 at 05:17
  • @coffeemath Yes they are. – levaa Apr 24 '18 at 05:18
  • @ChristopherMarley I'm asking how many possible combinations it would have taken to get to 'cheese > beer', by a program that brute forces with every character listed at the question until it gets to the phrase, 'cheese > beer' – levaa Apr 24 '18 at 05:20
  • When you say "contained within 'cheese > beer' do you mean to include only the 4 e's, the c, the h, the s, the b, the r and the two spaces? Also is it required to use each "letter" that same number of times, or can one e.g. use 6 e's? – coffeemath Apr 24 '18 at 05:21
  • @coffeemath I mean the entire english alphabet. Sorry, should have explained that better. – levaa Apr 24 '18 at 05:24

1 Answers1

0

If the total number of allowed "letters" is $n$ there are then $13^n$ strings in all, and only $13!/(5!2!)$ are same as 'cheese > beer'.

Edit: It should be $n^{13}$ total strings, not $13^n.$

coffeemath
  • 7,403