Twitter

Sample Numeric Patterns

Category : Algorithms, Scripts

In this post, I will use a generic model for phone numbers that has a 3-digit prefix and a running width of 7 digits.

To start, I will fix the prefix to be 123, so P1=1 P2=2, P3=3. The 7-digit running numbers will give us 10,000,000 numbers starting from 0,000,000 up to 9,999,999

Again, we will name each digit from the running numbers as n1, n2, .. n7.

Class 1 numbers: Examples of unique patterns

  • Full ascending: (1 instance per 10,000,000)
    • 123-4567890
  • Ascending running: (4 per 10,000,000)
    • 123-012 3456
    • 123-123 4567
    • 123-234 5678
    • 123-345 6789
  • Descending running: (4 per 10,000,000)
    • 123-987 6543
    • 123-876 5432
    • 123-765 4321
    • 123-654 3210
  • Million pattern: (9 per 10,000,000)
    • 123-a0000000 [ a ≠ 0 ]
  • Repeated prefix: (10 per 10,000,000)
    • 123-123 a 123 123
  • Repeated inverted prefix: (10 per 10,000,000)
    • 123-321 a 123 321
  • 7 Repeated digits: (9 per 10,000,000)
    • 123-aaa aa aa [ a ≠ p3 ]
  • 8 Repeated digits: (1 per 10,000,000)
    • 123-333 33 33
  • Named numbers: (counts depend on the name)
    • 123-Mohamed = 123-6642633 (1 per 10,000,000)
    • 123-Ahmed xx = 123-24633 xx (100 per 10,000,000)
    • 123-Mark xxx = 123-6275 xxx (1,000 per 10,000,000)

Class 2 numbers:  Examples for the 2 digits, adjacent sets

  • 6A1B pattern: (18 per 10,000,000), [b ≠ a]
    • 123-aaa aaa b
    • 123-b aaa aaa
  • 5A2B pattern: (162 per 10,000,000, [b ≠ a]
    • 123-aaa aa bb
    • 123-bb aaa aa
  • 4A3B pattern: (1,458 per 10,000,000), [b ≠ a]
    • 123-aaaa bbb
    • 123-bbb aaaa
  • 4A3B alternate pattern: (1,458 per 10,000,000), [b ≠ a]
    • 123-ab ab ab a
    • 123-ba ba ba b
  • Ascending twins: assume z = y+1, y = x+1. (144 per 10,000,000)
    • 123-ax ay az a
    • 123-a ax ay az

Class 3 numbers: Examples of the 2 digits, non adjacent numbers

  • 6A1B split: (45 per 10,000,000), [b ≠ a]
    • 123-ab aaa aa
    • 123-aab aa aa
    • 123-aaa b aaa
    • 123-aa aa baa
    • 123-aaa aa ba
  • 5A2B split:(1,134 per 10,000,000), [b ≠ a]
    • 123-abb aa aa
    • 123-ab ab aaa
    • 123-a baa baa
    • 123-ab aaa ba
    • 123-ab aaa ab
    • 123-aa bb aaa
    • 123-a ab ab aa
    • 123-aab aab a
    • 123-aab aaab
    • 123-aaa bb aa
    • 123-aaa ba ba
    • 123-a aab aab
    • 123-aa aa bba
    • 123-aa a ab ab

As you can see, the more different digits we add, the more variations we can generate. We may also play with relations between numbers by adding one or more relations of the below:

  • Ascending  / descending
  • twins (e.g. aa bb cc …)
  • Multiples (e.g. 15 20 25)

In the next blog post, I will take some samples and start building an Excel generator to generate lists of numbers in a given pattern. this is actually the base of building the integrated dial classification module.

Good bye for now..

1

Anatomy of numbers

Category : Algorithms

A basic structure of numbering system can split any number to 2 basic sections:

  1. Prefix, which is a set of digits or letters identifying the “series” the subject number belongs to
  2. Running or functional part, which contains the numeric unique value

In many cases, there can be some additional parts of the numbers like suffix, parity flag, or error correction codes. But we will assume the simple form of 2-part numbers as described above.

A prefix can be a set of digits or letters or a mix of digits and letter. There are two important notes related to the presence of prefix,

  1. It adds to the length of the number
  2. It can be a part of the number classification.

As an example, a prefix in mobile dial numbers like 012 will add 3 more digits to the length of the running number as well it can help classify dial numbers like 012-34xxxxx as an easy number because it simplifies the way you can recall it (01234 is a straight ascending set of digits).

We will fix a notation for prefix digits as P1, P2, P3

Running numbers also include 2 important factors

  1. The count of digits which indicate maximum possibilities of digit combination (referred to as series length), and this can be easily estimated by the formula

    Series length = 10 to the power n

  2. It indicates the level of complexity to classify the numbers, the longer running code, the more complex classification is

We will fix a notation for running digits as d1, d2, d3, … , dn


Formation of a simple number pattern

Now, let’s start the fun, the following example shows how a classified pattern will look like.

A simple “4 twins number” may look like:

  • P: AABBCCDD
  • P is the full prefix
  • A, B, C, D: unique digits
  • D1 = D2 = A
  • D3 = D4 = B
  • D5 = D6 = C
  • D7 = D8 = D

When applying this “rule” to a series of 8 digit numbers, we can extract a lot of numbers in the 4-twins category like:

  • P: 33 99 22 00, P: 44 99 22 33

Note that a problem will arise for some numbers in this pattern like the number (P: 22 33 44 55) as it will fall between two categories, 4-twins and 4-ascending-twins.

In the next article, I will focus on patterns and the hierarchy of classification so we can understand how to solve such problem.

The basics of number management

Category : Algorithms

During my work in dial management few years ago, I discovered the beauty of relating numbers to each other.

One of the assignments I had to do was to create rules for golden numbers, which are numbers that are easy to say, remember or relate to a well-known numbers (e.g. 247 relates to 24 x 7).

I could build a lot of algorithms to set the standard classification for diamond,  golden, silver and bronze numbers and could run the script and extract these numbers. This is what encourages me now to give some outlines on how numbers are related and how to classify numbers into “easy” and “regular” numbers.

1. Groups of easy numbers

Easy numbers can be grouped in the following groups:

  1. Simple repeats (e.g. 333-55-888)
  2. Sequential / related parts (e.g. 3456-9876, or 13-26-39-52, or 20-50-1000)
  3. Mapping names or dates (e.g. 0800-office)
  4. Easy to tell (e.g. 10-7-11)
  5. Fixed patterns (e.g. any number containing 1792 in sequence)

Each group has its own logical algorithm to “detect” it from within the pool of numbers we are working with.

2. Related numbers

Another important set of algorithms are used to identify or to compose sets of numbers that may look like:

  1. Sets of serial numbers
  2. Sets of serial and easy numbers
  3. Sets of numbers starting with a specific easy number category
  4. Sets of numbers related to company or a name (e.g. IBM-124000 to IBM-124999)
  5. Complementary numbers (e.g. “he & she” phone numbers)

3. Number reservation and recycling

One important aspect of number management is the ability to reserve, free, schedule and recycle the use of the numbers. The management service should be able to manipulate these actions beside its ability to classify and group the usable numbers.

For example in dial number management, all regular dial numbers are available in the market for sales and portions of the easy numbers are reserved, while golden numbers are given as gifts and are sometimes put on a shared reservation database. This makes it somehow difficult  to manage the complete range of dial numbers the operator have in hand.

In the coming blog post I will focus on how to classify the numbers according to its numeric pattern and will provide some examples from the real life.

I appreciate your comments