quote:
Originally posted by John Anderton
sorry that should have been 4 letters .... a,b,c,d and e
a,b,c,d and e are still 5 letters. Make up your mind
quote:
Originally posted by John Anderton
I dunno that formula that u r using .... can u do the same question with permutation and combination .....
perhaps, but that is a very very confusing and long long way to do it.
quote:
Originally posted by John Anderton
1st word aaaaa
2nd aaaab
3 aaaac
4 aaaad
5 aaaba
So now you're saying only
4 letters are possible??? a, b, c, d? In that case:
adbca =
03120
To calculate from a base
4 number to the equivalent base ten number:
=
0 *
4^4 +
3 *
4^3 +
1 *
4^2 +
2 *
4^1 +
0 *
4^0[/b]
= 216
or
217, considering the first position is position 1.
I'm not going to repeat the whole thing again though, see my previous reply in how you calculate this and the simple logic behind it. And follow the method with a piece of paper and create the tables on paper.
The important part is (for 5 possible letters): a, b, c, d, e
dictionary | base 5 number | base 10 number (aka position-1)
aaaaa 00000 0
aaaab 00001 1
aaaac 00002 2
aaaad 00003 3
aaaae 00004 4
aaaba 00010 5
aaabb 00011 6
aaabc 00012 7
aaabd 00013 8
aaabe 00014 9
aaaca 00020 10
(...) (...) (...)
The important part is (for 4 possible letters): a, b, c, d
dictionary | base 4 number | base 10 number (aka position-1)
aaaaa 00000 0
aaaab 00001 1
aaaac 00002 2
aaaad 00003 3
aaaba 00010 4
aaabb 00011 5
aaabc 00012 6
aaabd 00013 7
aaaca 00020 8
(...) (...) (...)
quote:
Originally posted by John Anderton
Ok so 4 changes r possible in the 1st letter (from the right) (like units place in numbers) ....
Wrong... looking at your dictionary you just posted:
1st word aaaaa
=> no change!
2nd aaaab
=> 1st change
3 aaaac
=> 2nd change
4 aaaad
=> 3rd change
5 aaaba
=> 4th change, we go to the next unit
I see only 3 possible changes for the first unit!!! a->b b->c c->d
As I say, don't use the method your using, it is very very long and very very confusing and you bound to make (logic) errors.
Look at "adbca" as a code, a series of numbers, thus convert it to numbers first. Not as some string where you calculate the "changes"...
quote:
Originally posted by John Anderton
5th change (note: this is wrong if there are only 4 possible letters... it's the 4th change!!! see above) will make the 2nd letter from the right change once. So When the 1st letter changes 25 times (5*5) then the 3rd letter from the right will change. When the 1st letter changes 125 times then the 4th letter changes once .....
the 4th letter from the right changes 3 times (a -> b -> c ->d) thus ..... 125*3 = 375
Revise what you just told here and put it in simple maths:
for each unit: "
number of changes" * "
total possible numbers" ^ "
position of unit"
note: in maths we start counting at 0, not 1!! 0 is also a number, the first number.
eg 1:
- total numbers =
5 possible letters: a, b, c, d, e
- number of changes (value of the letter) for
unit 0 in "adbc
a" =
0 =>
0 *
5 ^
0
- number of changes (value of the letter) for
unit 1 in "adb
ca" =
2 =>
2 *
5 ^
1
- number of changes (value of the letter) for
unit 2 in "ad
bca" =
1 =>
1 *
5 ^
2
- number of changes (value of the letter) for
unit 3 in "a
dbca" =
3 =>
3 *
5 ^
3
- number of changes (value of the letter) for
unit 4 in "
adbca" =
0 =>
0 *
5 ^
4
-
0*
5^
4 +
3*
5^
3 +
1*
5^
2 +
2*
5^
1 +
0*
5^
0 =
410
eg 2:
- total numbers =
4 possible letters: a, b, c, d
- number of changes (value of the letter) for
unit 0 in "adbc
a" =
0 =>
0 *
4 ^
0
- number of changes (value of the letter) for
unit 1 in "adb
ca" =
2 =>
2 *
4 ^
1
- number of changes (value of the letter) for
unit 2 in "ad
bca" =
1 =>
1 *
4 ^
2
- number of changes (value of the letter) for
unit 3 in "a
dbca" =
3 =>
3 *
4 ^
3
- number of changes (value of the letter) for
unit 4 in "
adbca" =
0 =>
0 *
4 ^
4
-
0*
4^
4 +
3*
4^
3 +
1*
4^
2 +
2*
4^
1 +
0*
4^
0 =
216
eg 3 ("special" case: 10 possible numbers, in other words, convert from base 10 (=a
decimal number) to base 10 (=a
decimal number), aka there is no change at all):
- total numbers =
10 possible letters: a, b, c, d, e, f, g, h, i, j
- number of changes (value of the letter) for
unit 0 in "adbc
a" =
0 =>
0 *
10 ^
0
- number of changes (value of the letter) for
unit 1 in "adb
ca" =
2 =>
2 *
10 ^
1
- number of changes (value of the letter) for
unit 2 in "ad
bca" =
1 =>
1 *
10 ^
2
- number of changes (value of the letter) for
unit 3 in "a
dbca" =
3 =>
3 *
10 ^
3
- number of changes (value of the letter) for
unit 4 in "
adbca" =
0 =>
0 *
10 ^
4
-
0*
10^
4 +
3*
10^
3 +
1*
10^
2 +
2*
10^
1 +
0*
10^
0 =
3120
eg 4 ("special" case: 2 possible numbers, in other words, convert from base 2 to base 10, aka convert a
binary number to a
decimal number):
- total numbers =
2 possible letters: a, b so lets take the string "
ababa" as an example
- number of changes (value of the letter) for
unit 0 in "abab
a" =
0 =>
0 *
2 ^
0
- number of changes (value of the letter) for
unit 1 in "aba
ba" =
1 =>
1 *
2 ^
1
- number of changes (value of the letter) for
unit 2 in "ab
aba" =
0 =>
0 *
2 ^
2
- number of changes (value of the letter) for
unit 3 in "a
baba" =
1 =>
1 *
2 ^
3
- number of changes (value of the letter) for
unit 4 in "
ababa" =
0 =>
0 *
2 ^
4
-
0*
2^
4 +
1*
2^
3 +
0*
2^
2 +
1*
2^
1 +
0*
2^
0 =
10
=> this last example can easly be done totaly on paper (only 11 rows to be made in the table), so do this to understand the whole thing:
dictionary | base 2 number | base 10 number (aka position-1)
aaaaa 00000 0
aaaab 00001 1
aaaba 00010 2
aaabb 00011 3
aabaa 00100 4
aabab 00101 5
aabba 00110 6
aabbb 00111 7
abaaa 01000 8
abaab 01001 9
ababa 01010 10 < =row/position 11
(...) (...) (...)
quote:
Originally posted by John Anderton
so a total of 410 words have passed and we have reached adbca. So shouldnt that be the answer
Read what you just said
we have
passed 410 words, so we are at position
411...
(provided there are 5 possible letters (a, b, c, d, e)! Which is apparently not what you've showed in your last dictionary in your last post, so make up your mind on the number of possible letters.)