Kaprekar's Constant

This topic is locked from further discussion.

Avatar image for Vax45
Vax45

4834

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1 Vax45
Member since 2005 • 4834 Posts

My professor showed us this in class today:

1. Take any 4 digit number with at least two different digits:

2. Arrange the numbers in ascending and descending order and subtract them

3. Use step two on the subtracted number

Within 7 times, you'll come up with the number 6174 and it will stop there.

For example, I'll pick 5218

8521 - 1258 = 7263

7632 - 2367 = 5265

6552 - 2556 = 3996

9963 - 3699 = 6264

6642 - 2466 = 4176

7641 - 1467 = 6174

I tried this on at least ten different numbers and they all turned out to 6174 in at least 7 steps.

Can anyone find a theorem or explanation for how it turns out to be 6174?

Avatar image for entropyecho
entropyecho

22053

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#2 entropyecho
Member since 2005 • 22053 Posts

Sounds like hw ;)

Avatar image for Vax45
Vax45

4834

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#3 Vax45
Member since 2005 • 4834 Posts

Sounds like hw ;)

entropyecho
I assure you, this isn't homework, just thought it was cool :P Besides, why would I go to Gamespot of all places if I wanted help on my math homework?
Avatar image for Big_Bad_Sad
Big_Bad_Sad

18243

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#4 Big_Bad_Sad
Member since 2005 • 18243 Posts

I ended up with 900 on the fourth go :?

Avatar image for Bluestorm-Kalas
Bluestorm-Kalas

13073

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#5 Bluestorm-Kalas
Member since 2006 • 13073 Posts

9889 - 9889 = 0000

:(

EDIT: Ohh..I read the instruction wrong. Yeah I heard of this constant too, there are tons of cool formulas out there though.

Avatar image for cjek
cjek

14327

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#7 cjek
Member since 2003 • 14327 Posts

I ended up with 900 on the fourth go :?

Big_Bad_Sad
You sir, have broken mathematics.
Avatar image for entropyecho
entropyecho

22053

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#8 entropyecho
Member since 2005 • 22053 Posts

In that case, consider this:

The digits of any four digit number can be arranged into a maximum number by putting the digits in descending order, and a minimum number by putting them in ascending order. So for four digits a,b,c,d where,

9 ≥ a ≥ b ≥ c ≥ d ≥ 0

and a, b, c, d are not all the same digit, the maximum number is abcd and the minimum is dcba.

We can calculate the result of Kaprekar's operation using the standard method of subtraction applied to each column of this problem, i.e.

abcd-dcba = ABCD (write it vertically, align the columns)

which gives the relations,

D = 10 + d - a (as a >d)

C = 10 + c - 1 - b = 9 + c - b (as b >c - 1)

B = b - 1 - c (as b >c)

A = a - d

for those numbers where a>b>c>d.

A number will be repeated under Kaprekar's operation if the resulting number ABCD can be written using the initial four digits a,b,c and d. So we can find the kernels of Kaprekar's operation by considering all the possible combinations of {a,b,c,d} and checking if they satisfy the relations above. Each of the 4! = 24 combinations gives a system of four simultaneous equations with four unknowns, so we should be able to solve this system for a, b, c and d.

It turns out that only one of these combinations has integer solutions that satisfy 9 ≥ a ≥ b ≥ c ≥ d ≥ 0. That combination is ABCD = bdac, and the solution to the simultaneous equations is a=7, b=6, c=4 and d=1. That is ABCD = 6174. There are no valid solutions to the simultaneous equations resulting from some of the digits in {a,b,c,d} being equal.

Edit: Damn html

Avatar image for cjek
cjek

14327

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#9 cjek
Member since 2003 • 14327 Posts

In that case, consider this:

The digits of any four digit number can be arranged into a maximum number by putting the digits in descending order, and a minimum number by putting them in ascending order. So for four digits a,b,c,d where,

9 ≥ a ≥ b ≥ c ≥ d ≥ 0

and a, b, c, d are not all the same digit, the maximum number is abcd and the minimum is dcba.

We can calculate the result of Kaprekar's operation using the standard method of subtraction applied to each column of this problem, i.e.


abcd -dcba



ABCD

which gives the relations

D = 10 + d - a (as a >d) C = 10 + c - 1 - b = 9 + c - b (as b >c - 1) B = b - 1 - c (as b >c) A = a - d

for those numbers where a>b>c>d.

A number will be repeated under Kaprekar's operation if the resulting number ABCD can be written using the initial four digits a,b,c and d. So we can find the kernels of Kaprekar's operation by considering all the possible combinations of {a,b,c,d} and checking if they satisfy the relations above. Each of the 4! = 24 combinations gives a system of four simultaneous equations with four unknowns, so we should be able to solve this system for a, b, c and d.

It turns out that only one of these combinations has integer solutions that satisfy 9 ≥ a ≥ b ≥ c ≥ d ≥ 0. That combination is ABCD = bdac, and the solution to the simultaneous equations is a=7, b=6, c=4 and d=1. That is ABCD = 6174. There are no valid solutions to the simultaneous equations resulting from some of the digits in {a,b,c,d} being equal.

entropyecho

Well that clears things up.

Avatar image for allnamestaken
allnamestaken

6618

Forum Posts

0

Wiki Points

0

Followers

Reviews: 10

User Lists: 0

#10 allnamestaken
Member since 2003 • 6618 Posts

[QUOTE="entropyecho"]

In that case, consider this:

The digits of any four digit number can be arranged into a maximum number by putting the digits in descending order, and a minimum number by putting them in ascending order. So for four digits a,b,c,d where,

9 ≥ a ≥ b ≥ c ≥ d ≥ 0

and a, b, c, d are not all the same digit, the maximum number is abcd and the minimum is dcba.

We can calculate the result of Kaprekar's operation using the standard method of subtraction applied to each column of this problem, i.e.


abcd -dcba



ABCD

which gives the relations

D = 10 + d - a (as a >d) C = 10 + c - 1 - b = 9 + c - b (as b >c - 1) B = b - 1 - c (as b >c) A = a - d

for those numbers where a>b>c>d.

A number will be repeated under Kaprekar's operation if the resulting number ABCD can be written using the initial four digits a,b,c and d. So we can find the kernels of Kaprekar's operation by considering all the possible combinations of {a,b,c,d} and checking if they satisfy the relations above. Each of the 4! = 24 combinations gives a system of four simultaneous equations with four unknowns, so we should be able to solve this system for a, b, c and d.

It turns out that only one of these combinations has integer solutions that satisfy 9 ≥ a ≥ b ≥ c ≥ d ≥ 0. That combination is ABCD = bdac, and the solution to the simultaneous equations is a=7, b=6, c=4 and d=1. That is ABCD = 6174. There are no valid solutions to the simultaneous equations resulting from some of the digits in {a,b,c,d} being equal.

cjek

Well that clears things up.

I don't 'get' British humour.