# Анализ карточных игр с помощью гипергеометрического распределения

Использование распределения HypergeometricDistribution[5, 13, 52] для анализа покера с пятью картами и распределения HypergeometricDistribution[13, 13, 52] для анализа бриджа.
 In[1]:= Xfgrid[list_, {col1_, col2_}] := TraditionalForm@ Grid[list, Dividers -> All, Spacings -> {{1, 1}, 2}, Alignment -> {Left, Center, {{1, 1} -> {Center}, {1, 2} -> {Center}}}, BaseStyle -> {FontFamily -> "Verdana"}, Background -> {None, {Lighter[ Blend[{col1, col2}], .4], {Lighter[Blend[{col1, col2}], .7], GrayLevel[.9]}}}, FrameStyle -> Directive[Thick, White]]
 In[2]:= XdPlot[dist_, dom_, range_, label_] := DiscretePlot[PDF[dist, k], dom, ExtentSize -> 2/3, PlotRange -> range, AxesOrigin -> {-0.2, 0}, BaseStyle -> {FontFamily -> "Verdana"}, Frame -> {{True, False}, {True, False}}, FrameLabel -> {Style["number of spades", Bold, 12], None}, ImageSize -> 280, PlotLabel -> Framed[Style[Grid[{{label}, {dist}}], 12], RoundingRadius -> 5, Background -> LightOrange]]
 In[3]:= XGrid[{{fgrid[ Join[{{" " , "Probability of"}}, Table[{Row[{"at least ", k, " spades"}], NProbability[x >= k, x \[Distributed] HypergeometricDistribution[5, 13, 52]]}, {k, 1, 5}]], {Red, Red}], " ", dPlot[HypergeometricDistribution[5, 13, 52], {k, 0, 5}, {0, 0.45}, "Five-card poker"]}, {""}, {" "}, {fgrid[ Join[{{" " , "Probability of"}}, Table[{Row[{"at least ", k, " spades"}], NProbability[x >= k, x \[Distributed] HypergeometricDistribution[13, 13, 52]]}, {k, 1, 13}]], {Blue, Green}], " ", dPlot[HypergeometricDistribution[13, 13, 52], {k, 0, 13}, {0, 0.3}, "Bridge"]}}]
 Out[3]=