(* Constants and Functions *)

Suits = 4;
CardsPerHand = 5;
CardsPerSuit[Cards_] := (Cards/Suits);
TotalHands[Cards_] := 
        Binomial[Cards, CardsPerHand];
LastCard[Cards_] := 
        15 - CardsPerSuit[Cards];
RoyalStraightFlush[Cards_] := Suits;
StraightFlush[Cards_] := 
        Suits (CardsPerSuit[Cards] - 
                3    ) - 
          RoyalStraightFlush[Cards];
FourOfAKind[Cards_] := 
        CardsPerSuit[Cards] (Cards - 4) 
          Binomial[4, 4];
FullHouse[Cards_] := 
        CardsPerSuit[Cards] (CardsPerSuit[Cards] - 1) Binomial[4, 3] 
          Binomial[4, 2];
Flush[Cards_] := 
        4  Binomial[CardsPerSuit "," CardsPerHand] - 
          StraightFlush[Cards] - 
          RoyalStraightFlush[Cards];
Straight[
          Cards_] := (CardsPerSuit[Cards] - 
                3    ) (4^5) - 
          StraightFlush[Cards] - 
          RoyalStraightFlush[Cards];
ThreeOfAKind[Cards_] := 
        CardsPerSuit[Cards] 
          (Suits^2) Binomial[CardsPerSuit[Cards] - 1, 2] Binomial[4, 
            3];
TwoPairs[Cards_] := 
        CardsPerSuit[Cards] (CardsPerSuit[Cards] - 1) Binomial[4, 2] 
          Binomial[4, 2] (Cards - 8)/2;
OnePair[Cards_] := 
        CardsPerSuit[Cards] Binomial[4, 2] 
          Binomial[CardsPerSuit[Cards] - 1, 3] 
          (4^3);
Nothing[Cards_] := 
        TotalHands[Cards] - RoyalStraightFlush[Cards] - 
          StraightFlush[Cards] - FourOfAKind[Cards] - FullHouse[Cards] - 
          Flush[Cards] - Straight[Cards] - ThreeOfAKind[Cards] - 
          TwoPairs[Cards] - OnePair[Cards];

(* Tables *)

Result = 
        Table[{Cards, 
            TotalHands "," RoyalStraightFlush "," 
              StraightFlush "," FourOfAKind "," FullHouse "," 
              Flush "," Straight "," ThreeOfAKind "," 
              TwoPairs "," OnePair "," Nothing[Cards]}, {Cards, 52, 
            24, -4}];
ResultPerc = 
        Table[{N[RoyalStraightFlush[Cards]/TotalHands[Cards]], 
            N[StraightFlush[Cards]/TotalHands[Cards]], 
            N[FourOfAKind[Cards]/TotalHands[Cards]], 
            N[FullHouse[Cards]/TotalHands[Cards]], 
            N[Flush[Cards]/TotalHands[Cards]], 
            N[Straight[Cards]/TotalHands[Cards]], 
            N[ThreeOfAKind[Cards]/TotalHands[Cards]], 
            N[TwoPairs[Cards]/TotalHands[Cards]], 
            N[OnePair[Cards]/TotalHands[Cards]], 
            N[Nothing[Cards]/TotalHands[Cards]]}, {Cards, 52, 
            24, -4}];
ResultLogPerc = Log[ResultPerc];

(* Number of Hands *)

\(TableForm[
      Transpose[
        Join[{{"Cards", "TotalHands", "RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, Result]], TableAlignments -> Right]\)

(* Frequency of Hands *)

\(TableForm[
      Transpose[
        Join[{{"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, 
          ResultPerc]], TableAlignments -> Left]\)

(* Log of Frequancy of Hands *)

\(TableForm[
      Transpose[
        Join[{{"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, 
          ResultLogPerc]], TableAlignments -> Left]\)

<< Graphics`

(* Chart of Log of Frequancy of Hands*)

\(\(MultipleListPlot[Transpose[ResultLogPerc], PlotJoined -> True, 
        PlotLegend -> {"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}, 
        PlotStyle -> {{RGBColor[0, 1, 0], 
              AbsoluteThickness[0.5]}, {RGBColor[0.75, 0.25, 0], 
              AbsoluteThickness[1]}, {RGBColor[0.5, 0.5, 0], 
              AbsoluteThickness[0.4]}, {RGBColor[0.25, 0.5, 0.25], 
              AbsoluteThickness[2]}, {RGBColor[1, 0, 0], 
              AbsoluteThickness[2]}, {RGBColor[0.5, 0, 0.5], 
              AbsoluteThickness[0.4]}, {RGBColor[0.25, 0, 0.75], 
              AbsoluteThickness[2]}, {RGBColor[0, 0, 0], 
              AbsoluteThickness[1.2]}, {RGBColor[0, 0.5, 0.5], 
              AbsoluteThickness[0.4]}, {RGBColor[0, 0, 1], 
              AbsoluteThickness[2]}}, LegendSize -> {1.0, 1.0}, 
        Frame -> True, 
        FrameTicks -> {Range[8], Automatic, None, None}, 
        Axes -> None, PlotRange -> All];\)\)

(* Number of Hands as a function of the Number of Cards *)

FuncNCards[
        n_] := {TotalHands[n], RoyalStraightFlush[n], StraightFlush[n], 
          FourOfAKind[n], FullHouse[n], Flush[n], Straight[n], 
          ThreeOfAKind[n], TwoPairs[n], OnePair[n], Nothing[n]} // 
        Expand

\(TableForm[
      Transpose[
        Join[{{"TotalHands", "RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, {FuncNCards[n]}]], TableAlignments -> Left]\)

(* Frequency of Hands as a function of the Number of Cards *)

\(TableForm[
      Transpose[
        Join[{{"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, {Rest[
                FuncNCards[n]]/TotalHands[n]}]], 
      TableAlignments -> Left]\)

DerFuncNCards[n_] := 
        D[Rest[FuncNCards[n]]/TotalHands[n], n] // FullSimplify;

\(TableForm[
      Transpose[
        Join[{{"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, {DerFuncNCards[n]}]], TableAlignments -> Left]\)

\(TableForm[
      Transpose[
        Join[{{"RoyalStraightFlush", "StraightFlush", "FourOfAKind", "FullHouse", "Flush", "Straight", "ThreeOfAKind", "TwoPairs", "OnePair", "Nothing"}}, {N[\((DerFuncNCards[n] //. n -> 52)\)]}]], 
      TableAlignments -> Left]\)