Article 7Z73 Main

Dealprints and Matrices

by Richard Pavlicek

Footprints in the sand can identify people and animals, so why not have “dealprints” to identify bridge deals? In my bridge database I have a search function that locates deals by generic dealprint; that is, according to suit distribution but irrespective of specific suits and specific hands. Besides locating duplicate deals, this conveniently finds all similar deals.

Specific Dealprints

Before considering generic dealprints, it is helpful to classify all deals by their specific dealprint. For example, suppose West is 4=5=3=1 (four spades, five hearts, three diamonds and one club), North is 3=2=4=4, East 4=3=0=6 and South 2=3=6=2. This specific dealprint could be shown as:

4531-3244-4306-2362

Argh. Looks like a credit card! Hopefully, I won’t compromise somebody’s number in this article; but just in case, I’ll protect my ass with a disclaimer: Numbers in this file are not related to credit cards. [Knock at my door] Police officer: “Are you Richard Pavlicek? Then you have the right to remain silent…”

The ordering of a specific dealprint is arbitrary. My practice is to start with West, if only to keep West on the left where it should be. The other three hands follow in clockwise order: North, East and South. For suits in each hand, almost everyone is accustomed to the order by rank: spades, hearts, diamonds and clubs.

How many specific dealprints exist? To determine this, I found all the ways the 560* hand patterns could be packed into a deal. For each specific West shape, I found which North shapes would fit, and with those paired, which East shapes would fit. No further step is needed, because once three hands are decided, the fourth hand must get the rest. The total number of specific dealprints is exactly:

37,478,624

*Most people know that there are 39 generic hand patterns, but each of these can be permuted in 4, 12 or 24 ways to create 560 specific patterns. For example, the most common generic shape is 4-4-3-2, which comprises 12 specific shapes: 4=4=3=2, 4=4=2=3, 4=3=4=2, 4=3=2=4, 4=2=4=3, 4=2=3=4, 3=4=4=2, 3=4=2=4, 3=2=4=4, 2=4=4=3, 2=4=3=4 and 2=3=4=4.

The following table lists all the specific dealprints — well, not really, as most of them are missing. I only listed the first and last, and some random selections in between, but all 37,478,624 were calculated. (To receive the complete list, please send me a stamped, self-addressed envelope — on second thought, better send a cargo ship to Port Everglades.)

The “Combinations” column shows the number of actual deals that can be created from each dealprint. To verify the accuracy of the table, I totaled the combinations and was pleased to see it agreed with the total number of bridge deals — 52!/(13!)4.

No.Specific DealprintCombinations
1000D-00D0-0D00-D0001
2,097,1530355-3721-5125-5242867,262,910,614,016,716,800
4,194,3050652-4504-3154-6133281,057,424,736,023,936,000
7,340,0331255-3343-2614-72314,818,127,281,188,981,760,000
9,437,1851534-5710-6025-11746,883,038,973,127,116,800
10,485,7611723-2164-9121-143557,358,658,109,392,640,000
11,534,337201A-6151-2542-37301,147,173,162,187,852,800
12,582,9132164-3703-4072-450414,339,664,527,348,160,000
14,680,0652443-0193-4702-7105682,841,167,968,960,000
16,777,2172902-6061-2326-31546,691,843,446,095,808,000
18,874,3693253-2452-2326-641225,295,168,226,242,154,240,000
20,971,5213550-4324-1318-5251361,359,546,089,173,632,000
23,068,6734144-1714-3460-5125301,132,955,074,311,360,000
25,165,8254441-4234-3352-241652,698,267,138,004,488,000,000
26,214,4014720-2317-5134-2272147,493,692,281,295,360,000
28,311,5535305-0364-4234-4540351,321,780,920,029,920,000
31,457,2816232-5242-1723-12463,613,595,460,891,736,320,000
33,554,4337132-5224-1480-0607614,557,051,172,064,000
35,651,5858221-3514-0058-2650645,284,903,730,667,200
37,478,624D000-0D00-00D0-000D1
Total for 37478624 entries: 53,644,737,765,488,792,839,237,440,000

For convenience in writing dealprints, numbers above nine are in hexadecimal: A = 10, B = 11, C = 12, D = 13.

 Article 7Z73 Main Top Dealprints and Matrices

Matrix Representation

A dealprint contains redundant information. Once you know the West, North and East shapes, there is only one possible South shape to complete the deal. Similarly, once you know the pattern of the spade, heart and diamond suits, there is only one possible club layout. Consider this dealprint:

3253-2452-2326-6412

The last group (6412) represents the South hand, which is forced by the first three groups. Therefore, the South hand can be omitted, and the same dealprint is reduced to 3253-2452-2326. Similarly, the club suit in each hand is fixed by the other three suits, so it also can be eliminated. This reduces the dealprint to only nine significant numbers, 325-245-232, which can be thought of as a 3×3 matrix with the rows representing West, North and East, and the columns representing spades, hearts and diamonds.

 3 2 5 2 4 5 2 3 2

Does every 3×3 matrix represent a specific dealprint? No. There are 149 = 20,661,046,784 possible 3×3 matrices where each digit can be from 0 to 13, inclusive. In order to represent a valid dealprint, the matrix must pass three tests:

 1. Sum of each row 13 or less 2. Sum of each column 13 or less 3. Sum of all digits 26 to 39

If the above conditions are true, the matrix represents one, and only one, specific dealprint. To verify this, I tested each of the 20+ billion possible matrices, and exactly 37,478,624 passed. This is the same number that I found by my previous method of counting dealprints, so it must be right. Either that, or I’m so far lost that I’ve come full circle.

 Article 7Z73 Main Top Dealprints and Matrices

Generic Dealprints

The 37+ million specific dealprints treat each hand and each suit as unique. If a deal is rotated, or if suits are swapped, the dealprint becomes different. For most purposes it is more useful to consider “generic dealprints” that are not specific to direction and suits.

In order to implement this I needed to devise a scheme to transform a specific dealprint to its generic equivalent. I decided that each generic dealprint should start with the hand containing the longest suit (rather than always West) with its suits arranged in descending order of length, i.e., the first hand would always be one of the 39 generic hand patterns. I will call this the dominant hand.

Another consideration was whether to allow the four hands to be permuted (like the suits), but I decided that keeping the order was important. This is especially significant when you consider the play rotation of the cards. If two hands are swapped, say North and East, the deal becomes quite different and should not be of the same generic type. Therefore, I only allow the hands to be rotated, which essentially changes nothing. By this method, the total number of generic dealprints is relatively small:

393,197

In my article “Patterns and Freakness” I used a different scheme to define generic shapes and found 412,666. The difference arises when two suits have identical patterns — the previous way did not account for this so they were considered unique.

To illustrate the transformation, consider this specific dealprint:

6232-5242-1723-1246

The dominant hand is East because it has the longest suit (seven hearts), so the hands are rotated to make East first. Note that the order of hands does not change as it becomes:

1723-1246-6232-5242

The next step is to arrange the suits of the first hand so its lengths are in order, longest to shortest. Since hearts is East’s longest suit, that suit will appear first, followed by clubs (next longest), diamonds and spades (shortest). Each change made in the first hand is replicated in the other three hands so the suit patterns around the table are unchanged. The final generic dealprint becomes:

7321-2641-2236-2245

The above example was easy, but what about ties? What if two or more hands have equally long suits? The dominant hand is then decided by the second longest suit, and if that still ties, the third longest suit. For example, 6421 wins against 6331, and 5431 wins against 5422. If two or more hands have identical dominant patterns, the tie is broken by the number of cards in its longest suit held by the next hand (clockwise), and if this ties, the next hand. If a tie still remains, it goes to the number of cards in its second longest suit held by the next hand, etc. If the tie cannot be broken, the dealprint is symmetrical, and it doesn’t matter.

Once the dominant hand is selected, if it has two (or three) identical suit lengths (e.g. 5332 or 7222), these are ordered by the length of the suit in the next hand (clockwise), or the next hand, etc. Here also, if a tie cannot be broken, it doesn’t matter. Below is a specific dealprint to illustrate tiebreaking:

6043-1741-1417-5242

Note that North and East tie for the dominant shape (7411). North wins because its seven hearts are followed by four hearts in East, while East’s seven clubs are followed by only two clubs in South. Rotating North to the front becomes temporarily:

1741-1417-5242-6043

Now there is another tie to break. Obviously, the suit order of the first hand will be 7411, but which “1” (spades or clubs) should be first? (This matters because the two patterns are different around the table.) Since the next hand has longer clubs than spades, the club suit wins the tie, and the final generic pattern becomes:

7411-4171-2425-0436

Generic dealprints also contain redundant information and can be fully represented in a 3×3 matrix. The only difference (compared to specific dealprints) is that the top row represents the dominant hand (rather than West) and the suits are ordered by length in the dominant hand (rather than by rank). The above generic dealprint becomes:

 7 4 1 4 1 7 2 4 2

A file with all 393,197 generic dealprints is available on the Bridge Utilities page.

 Article 7Z73 Main Top Dealprints and Matrices

Relative Frequency

The following table shows the number of generic dealprints according to the longest suit held. Note that the number of dealprints for each suit length is not proportional to the number of deals produced, nor even close. This is because balanced patterns offer more combinations for distributing cards than wild patterns. For example, the 29 generic dealprints with four-card suits produce more deals than all 101924 dealprints with eight-card suits. Deals with the longest suit six cards are the most common (42 percent) followed closely by five-card suits (40 percent).

SuitDealprintsNumber of DealsPercent
4291,571,494,042,604,960,223,750,000,0002.9294
5329721,583,251,210,971,361,009,130,800,76840.2336
632,87322,642,122,348,654,241,172,787,919,87242.2075
784,8376,782,984,599,117,957,218,132,857,85612.6443
8101,924981,975,954,511,555,218,232,092,5041.8305
984,84479,298,562,143,148,725,113,050,6000.1478
1052,8733,532,238,785,856,985,879,197,9520.0065
1124,31978,122,061,820,624,147,552,5120.0001
127269685,286,242,093,646,948,6640.0000
139321,351,649,568,417,019,2720.0000
Totals393,19753,644,737,765,488,792,839,237,440,000100.0000

The next table lists the most common generic dealprints (all that occur more than 0.1 percent of the time). The “P” column shows the number of distinct permutations that exist to form specific dealprints. This number is usually 96 (387,681 cases), occasionally 48 (5371 cases), rarely 24 (140 cases) and even more rarely 16 (5 cases). The total number of deals is shown, followed by the percent occurrence. Two patterns share the top spot at just over 0.2 percent.

Generic DealprintPNumber of DealsPercent
4432-3334-4333-234496112,422,969,894,409,574,400,000,0000.2096
4432-4333-3334-234496112,422,969,894,409,574,400,000,0000.2096
5332-2434-3334-33439689,938,375,915,527,659,520,000,0000.1677
5332-3433-2344-33349689,938,375,915,527,659,520,000,0000.1677
5332-3433-3334-23449689,938,375,915,527,659,520,000,0000.1677
5332-3334-2434-33439689,938,375,915,527,659,520,000,0000.1677
5332-2434-3343-33349689,938,375,915,527,659,520,000,0000.1677
5332-3334-3433-23449689,938,375,915,527,659,520,000,0000.1677
4432-4333-3244-24349684,317,227,420,807,180,800,000,0000.1571
4432-4234-3433-23449684,317,227,420,807,180,800,000,0000.1571
4432-4234-2443-33349684,317,227,420,807,180,800,000,0000.1571
4432-4333-2434-32449684,317,227,420,807,180,800,000,0000.1571
4432-4324-3343-23449684,317,227,420,807,180,800,000,0000.1571
4432-4243-3334-24349684,317,227,420,807,180,800,000,0000.1571
4432-4234-3343-24349684,317,227,420,807,180,800,000,0000.1571
4432-3343-3334-33344874,948,646,596,273,049,600,000,0000.1397
4432-3334-3334-33434874,948,646,596,273,049,600,000,0000.1397
4432-3334-3343-33344874,948,646,596,273,049,600,000,0000.1397
5332-3433-3343-23359671,950,700,732,422,127,616,000,0000.1341
5332-2434-3433-32449667,453,781,936,645,744,640,000,0000.1257
5332-3433-2434-32449667,453,781,936,645,744,640,000,0000.1257
5332-2434-3244-34339667,453,781,936,645,744,640,000,0000.1257
5422-3343-3334-23449667,453,781,936,645,744,640,000,0000.1257
5332-3424-2344-33439667,453,781,936,645,744,640,000,0000.1257
5332-3424-3343-23449667,453,781,936,645,744,640,000,0000.1257
5332-2434-2344-43339667,453,781,936,645,744,640,000,0000.1257
5332-2434-4333-23449667,453,781,936,645,744,640,000,0000.1257
5332-3433-3244-24349667,453,781,936,645,744,640,000,0000.1257
5332-4333-2434-23449667,453,781,936,645,744,640,000,0000.1257
5422-2344-3343-33349667,453,781,936,645,744,640,000,0000.1257
5422-3343-2344-33349667,453,781,936,645,744,640,000,0000.1257
4432-4324-2443-32449663,237,920,565,605,385,600,000,0000.1178
4432-4333-2344-33344856,211,484,947,204,787,200,000,0000.1047
4432-3334-3244-34334856,211,484,947,204,787,200,000,0000.1047
5332-3334-2533-32449653,963,025,549,316,595,712,000,0000.1005
5422-3343-3343-23359653,963,025,549,316,595,712,000,0000.1005
5332-2533-3244-33349653,963,025,549,316,595,712,000,0000.1005
5332-3424-3334-23539653,963,025,549,316,595,712,000,0000.1005
5422-2353-3334-33349653,963,025,549,316,595,712,000,0000.1005
5422-3343-2335-33439653,963,025,549,316,595,712,000,0000.1005
5332-3334-3424-23539653,963,025,549,316,595,712,000,0000.1005
5332-3433-2443-32359653,963,025,549,316,595,712,000,0000.1005
5332-3433-3235-24439653,963,025,549,316,595,712,000,0000.1005

 Article 7Z73 Main Top Dealprints and Matrices