0

Given the questions I see here, I'm guessing this will not be too difficult for this crowd - but, I'm math-challenged, so... All help much appreciated!

A) How can I find the total number of permutations of a string of n length, when each element in the string can be just one of 2 single-digit integers?

e.g.,

  • string length = 3
  • possible values = 0 or 1

permutations = 000, 001, 010, 011, 100, 101, 110, 111

So, what would be the formula for finding the above for, say, a string length of 5?

B) Is there a general formula that I could use in a similar way, but for more than 2 possible single-digit integers in each place, in a string of n length?

e.g.,

  • String length = 3
  • each place can be 0, 1, or 2

permutations = 000, 001, 002, 010, 011, 012, 020, 021, 022, 100, 101, 102, 110, 111, 112, 200, 201, 202, 210, 211, 212, 220, 221, 222

Thanks for any advice!

2 Answers2

2

Two big hints.

First, do lots of experiments. Write out and count all the sequences of length 1, 2, 3 and 4 first with two digits, then with three. If you arrange things in numerical order (which you did in your examples) you won't miss any . You should be able to see patterns emerge.

You can probably do this - and be proud of yourself - even though you think of yourself as math challenged. I do this problem with ordinary third graders.

Second, and a little subtler. What would the answer to your problem be for strings of various lengths if you allowed yourself all the digits from $0$ to $9$? Then think about writing numbers in binary (base $2$), ternary (base $3$) or any other base.

(I do this part of the exercise with fourth and fifth graders.)

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
  • I hope noone posts "better" hints that make it easier. This is just enough. Your answer is gold, friend :D –  Mar 17 '18 at 00:27
  • Thanks for sharing your advice and hints... guess I wasn't paying attention in grade school... gulp! – CatharusGuttatus Mar 17 '18 at 00:29
  • 1
    @CatharusGuttatus don't feel bad! You're at least trying and thinking about these things. Being motivated especially in maths seems rare, and due to bad education systems, most people end up hating it. I praise you for persisting and trying anyways! –  Mar 17 '18 at 00:30
  • @CatharusGuttatus I'm sure this wasn't in your third grade curriculum (it wasn't in mine). It's not really in the curriculum now. I'm a retired mathematician who plays these kinds of games with kids in various K-6 grades. – Ethan Bolker Mar 17 '18 at 00:38
  • Thanks to you both for your comments... I hope to figure it out... :-) – CatharusGuttatus Mar 17 '18 at 00:47
  • I hope you can too. When you do you can post an answer to your own question, in your own words. Spoiler alert: don't read the other answer. – Ethan Bolker Mar 17 '18 at 00:52
  • Sorry to say that I saw the "spoiler", but, I will say that I had been writing out by hand the permutations for shorter strings - and had thought that it might be some kind of exponential progression, but, I'd made a manual error in my writing-out; missed one of the groups ... so was flummoxed by a sequence that seemed to go 4, 8, 16, and then... 28 not 32!?! so that threw me for a loop. I can see that progression now, I think... on your second hint about using the digits from 0-9, I wrote out a 2-number string, yielding 00-99, e,g, 100 permutations, e.g. 10 to the power of 2. Thanks again! – CatharusGuttatus Mar 17 '18 at 04:02
  • Congratulations. One last word. These aren't "permutations" since those use each digit just once. You could call them strings of digits. or words in an alphabet (of digits). – Ethan Bolker Mar 17 '18 at 12:51
0

If you allow say $$1,2,3$$ and the length is $4$, then your total number is $3^4=81$

That is because you have $4$ spots to fill in and each spot has three choices

that makes it $ 3\times 3\times 3 \times 3 =81$

Thus the formula is $$n^{l }$$

Where $ n$ is the number of choices and $l$ is the length of the string.