Main     Article 7Z73 by Richard Pavlicek

# Dealprints and Matrices

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.

TopMain

## Specific Dealprints

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

4531-3244-4306-2362

Argh. Looks just like a credit-card number. Hopefully, I won’t compromise somebody’s credit card in this article; but just in case, I’ll protect my ass with a disclaimer: The numbers in this file are not related to credit cards. [Knock at the 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 belongs. 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; then with those paired, which East shapes would fit — no further step was needed because, once three hands fit, whatever is left must represent the fourth hand. 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, although all 37,478,624 were calculated. (To receive the full table, 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
20971530355-3721-5125-5242867262910614016716800
41943050652-4504-3154-6133281057424736023936000
73400331255-3343-2614-72314818127281188981760000
94371851534-5710-6025-11746883038973127116800
104857611723-2164-9121-143557358658109392640000
11534337201A-6151-2542-37301147173162187852800
125829132164-3703-4072-450414339664527348160000
146800652443-0193-4702-7105682841167968960000
167772172902-6061-2326-31546691843446095808000
188743693253-2452-2326-641225295168226242154240000
209715213550-4324-1318-5251361359546089173632000
230686734144-1714-3460-5125301132955074311360000
251658254441-4234-3352-241652698267138004488000000
262144014720-2317-5134-2272147493692281295360000
283115535305-0364-4234-4540351321780920029920000
314572816232-5242-1723-12463613595460891736320000
335544337132-5224-1480-0607614557051172064000
356515858221-3514-0058-2650645284903730667200
37478624D000-0D00-00D0-000D1
Total for 37478624 entries: 53644737765488792839237440000

For convenience in writing dealprints, I use hexadecimal for the numbers above nine. A = 10, B = 11, C = 12, D = 13.

TopMain

## 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 14^9 = 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 must be 13 or less.
2. Sum of each column must be 13 or less.
3. Sum of all digits must be 26 to 39, inclusive.

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.

TopMain

## 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 of the 1’s (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 in order of frequency is available on the Bridge Utilities page.

TopMain

## 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 many 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
42915714940426049602237500000002.9294
532972158325121097136100913080076840.2336
6328732264212234865424117278791987242.2075
784837678298459911795721813285785612.6443
81019249819759545115552182320925041.8305
984844792985621431487251130506000.1478
105287335322387858569858791979520.0065
1124319781220618206241475525120.0001
1272696852862420936469486640.0000
1393213516495684170192720.0000
Total39319753644737765488792839237440000100.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-2344961124229698944095744000000000.2096
4432-4333-3334-2344961124229698944095744000000000.2096
5332-2434-3334-334396899383759155276595200000000.1677
5332-3433-2344-333496899383759155276595200000000.1677
5332-3433-3334-234496899383759155276595200000000.1677
5332-3334-2434-334396899383759155276595200000000.1677
5332-2434-3343-333496899383759155276595200000000.1677
5332-3334-3433-234496899383759155276595200000000.1677
4432-4333-3244-243496843172274208071808000000000.1571
4432-4234-3433-234496843172274208071808000000000.1571
4432-4234-2443-333496843172274208071808000000000.1571
4432-4333-2434-324496843172274208071808000000000.1571
4432-4324-3343-234496843172274208071808000000000.1571
4432-4243-3334-243496843172274208071808000000000.1571
4432-4234-3343-243496843172274208071808000000000.1571
4432-3343-3334-333448749486465962730496000000000.1397
4432-3334-3334-334348749486465962730496000000000.1397
4432-3334-3343-333448749486465962730496000000000.1397
5332-3433-3343-233596719507007324221276160000000.1341
5332-2434-3433-324496674537819366457446400000000.1257
5332-3433-2434-324496674537819366457446400000000.1257
5332-2434-3244-343396674537819366457446400000000.1257
5422-3343-3334-234496674537819366457446400000000.1257
5332-3424-2344-334396674537819366457446400000000.1257
5332-3424-3343-234496674537819366457446400000000.1257
5332-2434-2344-433396674537819366457446400000000.1257
5332-2434-4333-234496674537819366457446400000000.1257
5332-3433-3244-243496674537819366457446400000000.1257
5332-4333-2434-234496674537819366457446400000000.1257
5422-2344-3343-333496674537819366457446400000000.1257
5422-3343-2344-333496674537819366457446400000000.1257
4432-4324-2443-324496632379205656053856000000000.1178
4432-4333-2344-333448562114849472047872000000000.1047
4432-3334-3244-343348562114849472047872000000000.1047
5332-3334-2533-324496539630255493165957120000000.1005
5422-3343-3343-233596539630255493165957120000000.1005
5332-2533-3244-333496539630255493165957120000000.1005
5332-3424-3334-235396539630255493165957120000000.1005
5422-2353-3334-333496539630255493165957120000000.1005
5422-3343-2335-334396539630255493165957120000000.1005
5332-3334-3424-235396539630255493165957120000000.1005
5332-3433-2443-323596539630255493165957120000000.1005
5332-3433-3235-244396539630255493165957120000000.1005

TopMain