%\documentclass[a4paper]{scrartcl}
\documentclass[a4paper]{article}
%\documentclass[11pt,oneside,a4paper]{article}
%\usepackage[margin=2cm]{geometry}
%\usepackage{fancyhdr}
%\usepackage{amsmath,amsthm,amssymb}
%\usepackage{graphicx}
\usepackage{hyperref}
%\usepackage{mathtext}
%\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage[english]{babel}
%\usepackage[english,bulgarian]{babel}
%\usepackage{setspace}
%\usepackage{color}
\usepackage{verbatim}
\usepackage{latexsym}

%\usepackage{array}
%\usepackage[chapter]{algorithm}
%\usepackage[noend]{algpseudocode}
%\usepackage{float}
%\floatname{algorithm}{Алгоритъм}

%\usepackage{myalg}
\usepackage{grbbridge}

%\usepackage{tikz}
%\usepackage{pgfplots}
%\usetikzlibrary{shapes,arrows}
%\pgfplotsset{compat=1.11}

%\setlength{\parindent}{10pt} 
%\setlength{\parskip}{1ex}

%\newtheorem{lema}{Лема}

%\setkomafont{disposition}{\normalfont\bfseries}

\newenvironment{dedication}
 {\begin{quotation}
  \begin{em}
  \raggedleft
 }
 {\par
  \end{em}
  \end{quotation}
 }
% {\vspace{6ex}\begin{quotation}\begin{em}\raggedleft}
% {\par\end{em}\end{quotation}}

\begin{document}

%\begin{frontmatter}

\title{Coding the distributions in contract bridge}
%\subtitle{Силни едно в цвят}
\author{Georgi Georgiev (Skeleta) \and Vladimir Babev}
%\author{Vladimir Babev}
%\address{Faculty of Mathematics and Informatics, Sofia University, Sofia, Bulgaria}
%\ead{skeleta@gmail.com}

\maketitle

\newcommand{\Addresses}{{% additional braces for segregating \footnotesize
  \bigskip
  \footnotesize

  G.~Georgiev, 
  \textsc{Faculty of Mathematics and Informatics, 
          Sofia University, Sofia, Bulgaria}\par\nopagebreak
  \textit{E-mail:} 
  \texttt{skelet@fmi.uni-sofia.bg, skeleta@gmail.com}

  \medskip

  V.~Babev, 
  \textsc{Faculty of Mathematics and Informatics, 
          Sofia University, Sofia, Bulgaria}\par\nopagebreak
  \textit{E-mail:} 
  \texttt{babev@fmi.uni-sofia.bg, babev58@gmail.com}

}}


%\begin{dedication}
%На дългогодишните ми партньори --\\
%Владимир Бабев и съпругата ми Генка.
%\vspace{10pt}
%\end{dedication}

\begin{abstract}
This paper describes a simple compression scheme for hand distributions in contract bridge.
The scheme simplifies the convention rules and decreases the complexity of the bidding systems.
%В представената система откривания 1$\clubsuit$ и 1$\diamondsuit$ показват само сила,
%а при останалите откриващият описва разпределението си.
%При шансове за манш или шлем се провежда серия от релета по единна схема, 
%основана на кодиране и декодиране на разпределенията. 
\end{abstract}

%\begin{keyword}
%спортен бридж \sep анонсиране \sep кодиране
%\end{keyword}

%\end{frontmatter}

%\tableofcontents

%\newpage

%\paragraph{} 
%Повечето идеи в настоящата работа са взаимствани от базпасова
%система, която разработихме през 1978-1980г. с Владимир Бабев. 

Most ideas in this work are taken from the strong pass
system, developed by authors in years 1978-1983.

%Тези идеи включват кодиране и декодиране на разпределенията, 
%обединяване на фиктивните разпределения в групи и  
%правилата за провеждане на разпитванията. 

These ideas include encoding and decoding distributions,
merging fictive distributions in groups,
and rules for conducting the relays.

\paragraph{Notation:} \mbox{}

We use records like 4-4-3-2 to denote distributions with two 4-card colors, 
one 3-card, and 1 doubleton.
The colors are not specified and the numbers are sorted in descending order.

%\paragraph{} 
The record 3-4-2-4 denotes a distribution with 3 cards in $\clubsuit$, 
4 in $\diamondsuit$, doubleton $\heartsuit$ and 4 cards in $\spadesuit$.
Note that the numbers in this case are unsorted and we use natural order of bridge colors
$\clubsuit$-$\diamondsuit$-$\heartsuit$-$\spadesuit$.

In case the colors are specified and colors length descends from $\clubsuit$ to $\spadesuit$,
the upper two notations contradict.
More often we get the proper meaning from the context.
When this is impossible, we use records like 5=4=2=2 for specified colors and 5-4-2-2 for the common case. 


\section{Encoding scheme} %\mbox{}

\subsection{Real and fictive distributions} \mbox{}

We denote any hand distribution as \emph{real distribution} or simply \emph{distribution}.

The first step in the scheme is to define 4 to 1 encoding to \emph{fictive} distributions.

\paragraph{}\mbox{}
Note that precisely one of the following holds:
\begin{itemize}\itemsep0pt
\item 
Here is exactly one color of odd length.
We obtain \emph{fictive} distribution in this case by decreasing the odd color.
\item Here is exactly one color of even length.
In this case we increase the even color.
\end{itemize}

%We \emph{encode} 4 real distributions to 1 fictive in this way: 
%in case of one odd length, decrease it by one;
%in case of one even length, increase it by one;

We obtain the following fictive distributions:

Odd: 5-3-3-3, 5-5-3-1, 7-3-3-1, 7-5-1-1, 9-3-1-1, 11-1-1-1

Even: 4-4-2-2, 4-4-4-0, 6-2-2-2, 6-4-2-0, 6-6-0-0, 8-2-2-0, 8-4-0-0, 10-2-0-0, 12-0-0-0

It is obvious that this coding step is optimal from a mathematical point of view --
each fictive distribution approximates exactly 4 real and distance between real 
and corresponding fictive is exactly 1.  

\subsection{Groups of fictive distributions} \mbox{}

Some fictive distributions are similar in structure and quality.
We unite them in \emph{groups}:

Mono color 6-x-x-x: 6-2-2-2, 7-3-3-1 %, 8-2-2-0, 9-3-1-1, $\ldots$

Strong mono 8-x-x-x: 8-2-2-0, 9-3-1-1

Super mono 10-x-x-x: 10-2-0-0, 11-1-1-1, 12-0-0-0

Flat bicolor 4-4-x-x: 4-4-2-2, 5-5-3-1

Skew bicolor 6-4-x-x: 6-4-2-0, 7-5-1-1, 8-4-0-0

\paragraph{}\mbox{}
Few fictive distributions are unique and remains alone:

Weak mono: 5-3-3-3

Three colors: 4-4-4-0

Strong bicolor: 6-6-0-0

\paragraph{}\mbox{}
This is the second encoding step. 
Merging fictive distributions into groups, we partition the set 
of all real distributions into a relatively small number of subsets, 
each containing similar elements.

There are 4 groups in each of mono color types, 6 flat and 12 skew bicolor groups.
This gives in summary 30 possible groups altogether.
 
8 mono groups are rarely used in preemptive bidding (8-x-x-x, 10-x-x-x), 
so the count of often used groups is 22.

Alone fictive distributions are 14 (4 weak, 4 three colors and 6 strong bicolors).

\section{Relay bidding, based on the scheme} \mbox{}

We can use the set of 22 often used groups and 14 alone fictive  distributions
to define the constructive openings of the bidding system.

Assuming our system has 6 constructive opening bid on the average, 
each of these bids contains 3 or 4 groups and 2 or 3 fictive distributions.

%We can use the set of 22 often used groups and 14 alone fictives 
%to define the constructive openings of the bidding system.

%Assuming our system has 6 constructive open bids on the average, 
%each of these bids contains 3 or 4 groups and 2 or 3 fictives. 

\paragraph{} \mbox{}
In such system, the relay sequence has those simple phases:

(A) Determine the strength of the teller.

(B) Determine the set of possible distribution of the teller
Depending on the system, both phases (A) and (B) uses 1 or 2 rounds.

(B$_1$) Determine the distribution group (or alone fictive). 

(B$_2$) Determine the fictive distribution of the teller (1 round).

(B$_3$) Determine the real distribution (1 round).

(C) Determine the top honors (as much as possible).

\paragraph{} \mbox{}
In real system design the phases A, B and B$_1$ may interfere.

\section{Decoding}

\subsection{Decoding fictive distributions}

\paragraph{} \mbox{}
We decode even fictive distributions in one relay step 
by adding the missing card from shortest to longest color.
In case of equal length we use natural order 
%Четните фиктивни разпределения декодираме, 
%като добавяме липсващата карта от къс към дълъг цвят.
%При еднакво дълги цветове ползваме естествения ред 
$\clubsuit$-$\diamondsuit$-$\heartsuit$-$\spadesuit$.

\emph{Example:} We decode fictive distribution 2-4-4-2 to real one with answers:

level 1 -- 3-4-4-2 (short club and spade, club is lower)

level 2 -- 2-4-4-3
 
level 3 -- 2-5-4-2 (5 cards in diamond, it is lower color)
 
level 4 -- 2-4-5-2
 
\paragraph{} \mbox{}
We decode odd fictive distributions 
by subtracting the redundant card from longest to shortest color.

%Нечетните фиктивни разпределения декодираме, 
%като изваждаме излишната карта от дълъг към къс цвят.
%При еднакво дълги цветове ползваме естествения ред 
%$\clubsuit$-$\diamondsuit$-$\heartsuit$-$\spadesuit$.

\emph{Example:} We decode fictive 3-7-1-3 (long  $\diamondsuit$, short $\heartsuit$) with answers:

level 1 -- 3-6-1-3 (redundancy in longest color)

level 2 -- 2-7-1-3 (redundancy in clubs, spade is higher)
 
level 3 -- 3-7-1-2
 
level 4 -- 3-7-0-3 (redundancy in shortest color)

\paragraph{} \mbox{}
%Описаната схема на декодиране позволява в по-често срещаните 
%случаи да ползваме по-малко нива.
Proposed relay step is simple and effective -- 
at a lower level, we explain the weak and frequent distribution,
while higher level answer determines the strongest and most rare case.

\subsection{Decoding groups}

\paragraph{} \mbox{}
Let the distribution group of the teller is determined. Then he decodes the group to fictive distribution, using the table:

\input{table_b.tex}

\emph{Example:} We decode group x-4-6-x (6+ $\heartsuit$, 4+  $\diamondsuit$) with answers:

level 1 -- 2-4-6-0 (2+ $\clubsuit$)

level 2 -- 0-4-6-2 (2+ $\spadesuit$)
 
level 3 -- 1-5-7-1 
 
level 4 -- 0-4-8-0 (8+ $\heartsuit$)


\subsection{Decoding honors}
 
\paragraph{} \mbox{}
This phase of the relay sequence begins with a step for aces, 
followed by step for kings, then followed by step for queens etc.

Number of iterations depends on the remaining bidding space.

\input{table_d.tex}

\section{Example}

%spellten,leadingspace,betweencards
\setboolean{leadingspace}{true}
%\setboolean{betweencards}{true}
%\setboolean{spellten}{true}

\begin{handdiagram}
\boardnum{1}
\north{JT98,7,AJ983,QJ5}
\south{AK,AKJT83,KQ64,4}
\east{Q763,Q64,72,K832}
\west{542,952,T5,AT976}
\end{handdiagram}

\paragraph{} \mbox{}
N-S uses the system sNT,
% (Strong NT for mathematicians),
details are published at \href{http://skelet.ludost.net/bidding/sNT_en.pdf}
{Strong NoTrump for mathematicians}.
N adds 2 points for the singleton in \he{}, E-W passed all the time: 

N: \di{1} -- 11-20 corrected points, 4+ \di{}, possible 0-3 \he{}, 4+ \sp{} or \cl{}

S: \he{1} -- 10+, forcing

N: \sp{1} -- 4+ \sp{}, 11-20 points, distribution groups x-4-x-4, 4-4-0-4

S: 1NT -- relay, the teller will answer with levels as follows:

$\quad \quad$ level 1 -- 11-14 points, x-4-x-4

$\quad \quad$ level 2 -- 11-14 points, 4-4-0-4

$\quad \quad$ level 3 -- 15-20 points, x-4-x-4

$\quad \quad$ level 4 -- 15-20 points, 4-4-0-4

N: \cl{2} -- level 1, 11-14 points, x-4-x-4

S: \di{2} -- relay, question for fictive distribution

N: \sp{2} -- fictive distribution 3-5-1-5, level 2 from table 1.

S: 2NT -- relay, question for exact distribution

N: \di{3} -- exact distribution 3-5-1-4

S: \he{3} -- question for aces

N: \cl{4} -- A\di{}

S: \di{6} -- final contract


\paragraph{} \mbox{}
The same board, N-S uses SDI (Strong minors for mathematicians):

N: 1NT -- 11-14 corrected points, 4+ \di{}, 0-3 \cl{}, possible 4+ \sp{} or 0-4-4-4

S: \cl{2} -- 13+, forcing

N: \sp{2} -- 4+ \sp{}, distribution group x-4-x-4

S: 2NT -- relay, question for fictive distribution

N: \di{3} -- fictive distribution 3-5-1-5

S: \he{3} -- relay, question for exact distribution

N: 3NT -- exact distribution 3-5-1-4

S: \cl{4} -- question for aces

N: \sp{4} -- A\di{}

S: \di{6} -- final contract

\begin{comment}

\paragraph{} \mbox{}

\begin{handdiagram}
\boardnum{13}
\north{J9,2,AJT952,K943}
\south{D3,AJ75,KD87,AD7}
\east{A842,D986,63,J65}
\west{KT765,KT43,4,T82}
\end{handdiagram}

\paragraph{} \mbox{}
N-S uses the system sNT (Strong NT for mathematicians), 
N adds 3 points for the singleton in \he{} and the doubleton in \sp{}, E-W passed all the time: 

N: \di{2} -- 11-14 corrected points, 6+ \di{}, 0-3 cards in \he{}

S: \he{2} -- 13+ points, forcing

N: \cl{3} -- 4-6-x-x

S: \he{3} -- relay (\di{3} is a proposal for a score)

N: 3NT -- fictive distribution 4-6-0-2

S: \di{5} -- final bid, no bidding space for details

\paragraph{} \mbox{}
The same board, N-S uses SDI (Strong minors for mathematicians):

N: \di{2} -- 11-14 corrected points, 6+ \di{}, 4+ \cl{} or \he{}

S: \he{2} -- 13+ points, forcing

N: \sp{2} -- 4-6-x-x

S: 2NT -- relay, question for fictive distribution

N: \di{3} -- fictive distribution 4-6-0-2

S: \he{3} -- question for exact distribution

N: \sp{3} -- 4-6-1-2

S: \cl{4} -- question for aces. The higher answer \cl{5} (for A\sp{}) will block

$\quad \quad$  final bid \di{5}, but in this case slam \di{6} has good chances.

N: \sp{4} -- 1 ace in longer color -- A\di{}

S: \di{5} -- final bid


\paragraph{}

\begin{handdiagram}
\boardnum{29}
\north{KDxx,DTxx,KJTx,x}
\south{Axxxx,,ADxx,AKDx}
\east{x,xxxxx,xx,Jxxxx}
\west{Jxx,AKJx,xxx,xxx}
\end{handdiagram}

\paragraph{} \mbox{}
N-S uses the system SDI (Strong minors for mathematicians), 
N adds 2 points for the singleton $\clubsuit$, E-W passed all the time: 

%\paragraph{} \mbox{}
N: 1NT -- 11-14 corrected points, 4+ \di{}, 0-3 \cl{}, possible 4+ \sp{} or 0-4-4-4

S: \cl{2} -- 12+, forcing

N: 2NT -- fictive distribution 0-4-4-4 (\sp{4} is safe contract at this point)

S: \cl{3} -- question for exact distribution

N: \di{3} -- 1-4-4-4 (missing card is in the shortest color)

S: \he{3} -- relay for aces, S evaluates 9-12 HCP for N

N: 3NT -- 0 or 4 aces

S: 4$\clubsuit$ -- relay for kings

N: 4$\diamondsuit$ -- 2 kings

S: 4$\heartsuit$ -- where are your kings?

N: 5$\clubsuit$ -- in $\clubsuit$-$\heartsuit$ or $\diamondsuit$-$\spadesuit$

S: 5$\diamondsuit$ -- relay for queens (6$\spadesuit$ is safe contract now)

N: 5$\heartsuit$ -- 2 queens

S: 7$\spadesuit$ -- final bid

\end{comment}

\Addresses

\end{document}

\begin{comment}
\section{System design}

\paragraph{\cl{1}} -- 11+, 4+ \he{} and 0-3 \di{} %\mbox{}

\di{1} -- 10+, forcing

$\quad$ \he{1} -- 15+, 6+ \he{}

$\quad$ \sp{1} -- 11-14, x-x-4-4, 4-0-4-4

$\quad$ 1NT -- 11-14, 3-3-5-3

$\quad$ \cl{2} -- 11-14, 4-x-x-4

$\quad$ \di{2} -- 15+, 3-3-5-3

$\quad$ \he{2} -- 15+, 4-x-x-4

$\quad$ \sp{2} -- 11-14, x-x-6-4

$\quad$ 2NT -- 15+, x-x-4-4

$\quad$ \cl{3} -- 15+, 4-0-4-4

$\quad$ \di{3} -- 15+, 8-x-x-x

$\quad$ \he{3} -- 15+, 6-0-6-0

$\quad$ \sp{3} -- 15+, 0-0-6-6


\paragraph{\he{2}} -- 11-14, (x-x-6-x, 4-x-6-x, x-x-6-4, 6-0-6-0, 0-0-6-6)

\end{document}
\end{comment}


