Solve 7 Digit Phone Number Combination Puzzle

  • Context: Undergrad 
  • Thread starter Thread starter dipole
  • Start date Start date
  • Tags Tags
    Combinatorics
Click For Summary

Discussion Overview

The discussion revolves around a combinatorial problem involving a seven-digit phone number where two digits have been mistakenly interchanged. Participants explore how to determine the number of possible combinations that need to be tested to find the correct number, considering the constraints of only two digits being swapped.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that the brute force method would involve trying every permutation (7!), but this includes many incorrect combinations, as only two digits are swapped.
  • Another participant calculates the number of combinations as 21, using the formula for combinations of 7 taken 2 at a time (7!/(2!)(5!)).
  • A participant proposes a method for generating the list of possibilities by systematically exchanging each digit with every other digit.
  • One participant notes that if digits are repeated, some swaps will yield the original number, reducing the total number of valid combinations.
  • A mathematical observation is made regarding the difference between the original and swapped numbers, indicating that this difference is divisible by 9.
  • Another participant acknowledges that while the count is 21 for all different digits, the number decreases with repeated digits, leading to a discussion about partition numbers for various cases.

Areas of Agreement / Disagreement

Participants generally agree on the calculation of combinations when all digits are different, but there is recognition that the presence of repeated digits complicates the situation, leading to multiple competing views on how to account for those cases.

Contextual Notes

Participants mention that the problem can be broken down into various cases based on the uniqueness of the digits, which introduces complexity in determining the total number of combinations.

dipole
Messages
553
Reaction score
149
Suppose you have written down a seven digit phone number, but you realize you made a mistake and two of the digits are interchanged. For example, suppose the correct number is 345-6789, but you have on accident written down 348-6759.

Sticking to the general case though, where you have seven digits in a specific order, and only two of them are out of place - how many possible combinations must you try in order to find the correct number?

The brute force way would be to just try every permutation, 7! but that includes a huge number of combinations which are impossible to be correct - the correct combination must only switch two digits from the original set.

Any ideas how to solve this, or how to construct a procedure to actually generate the list of possibilities?
 
Mathematics news on Phys.org
if you know it is only 2 numbers that are switched, then you have 7 things taken 2 at a time or 7!/(2!)(5!) or 21, 2 number combinations to switch.
 
or how to construct a procedure to actually generate the list of possibilities?
Exchange digit 1 with 2, 1 with 3, ..., 1 with 7, 2 with 3, 2 with 4, ..., 2 with 7, ..., ..., 6 with 7.

For phone numbers where digits appear multiple times, some of those switches give the original number and reduce the number of possible phone numbers.
 
One trick that may be helpful:

When a number x in decimal notation has exactly two digits swapped,with the swapped

number being x', then 9 divides the difference x-x'. In your case:

3486759-3456789=29970.

Basically, x-x'= an10n+ak10k- [ ak10n+ an10k]=

ak(10n-10k)+an(10k -10n)
 
Last edited:
mfb said:
Exchange digit 1 with 2, 1 with 3, ..., 1 with 7, 2 with 3, 2 with 4, ..., 2 with 7, ..., ..., 6 with 7.

For phone numbers where digits appear multiple times, some of those switches give the original number and reduce the number of possible phone numbers.

Ah duh, this makes the problem easy. There are six possible pairs for each starting digit, and seven different digits giving 42 different swaps, but each swap is doubly degenerate, reducing the number by halve to give what coolul007 posted, which is 21.

For some reason I am just terrible at combinatorial stuff, but this is actually an easy question.

Bacle2 said:
One trick that may be helpful:

When a number x in decimal notation has exactly two digits swapped,with the swapped

number being x', then 9 divides the difference x-x'. In your case:

3486759-3456789=29970.

Basically, x-x'= an10n+ak10k- [ ak10n+ an10k]=

ak(10n-10k)+an(10k -10n)

That's a neat fact, thanks.
 
Yes, 21 if the digits are all different, but fewer if there are repeated digits. So in general it breaks down into lots of cases: all different, 1 pair the same, 2 pairs the same, 3 the same, ... The number of cases is a partition number.
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K