The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+1 vote

A poker hand consists of 5 cards. If the cards have distinct consecutive values and are not all of the same suit, we say that the hand is a straight. For instance, a hand consisting of the five of spades, six of spades, seven of spades, eight of spades, and nine of hearts is a straight. How many ways are there to get a "straight"? Assume that there are totally 52 cards.

+2 votes

Let us assume that (R_{1},R_{2},R_{3},R_{4},R_{5}) are the consecutive ranks of the cards in the poker hand.

Let us assume (R_{1},R_{2},R_{3},R_{4},R_{5}) = (A,2,3,4,5)

Now, I will find the number ways we can have the cards having rank A,2,3,4 and 5 in our poker hand.

Here card of rank A has 4 options it can come from any of the 4 suits

Same goes for the cards of rank 2,3,4 and 5

Thus the number of ways we can have the ranks (A,2,3,4,5) in our poker hand is 4^{5}.

Now, a restriction given in the question is that our poker hand should be straight that is the five cards in our hands will not be of same suit.

So, we have to substract those cards which will form a straight flush that is the five cards in our hands are of same suit.

The number of ways to form a straight flush with the ranks (A,2,3,4,5) is 4

Hence the number of ways we can have the ranks (A,2,3,4,5) such that it forms a straight is 4^{5} - 4.

Now, note that we can have $13$ five tuples of the form (R_{1},R_{2},R_{3},R_{4},R_{5}) which are given below

{ (A,2,3,4,5) , (2,3,4,5,6), (3,4,5,6,7), ........, (J,Q,K,A,2), (Q,K,A,2,3),(K,A,2,3,4) }

So, for each of the above 5 tuples we can have 4^{5} - 4 straight hands.

Hence our required answer is 13 * (4^{5} - 4) straight hands possible in a poker game.

+1 vote

If we assume that the A<2<3<4<5<6<7<8<9<10<J<Q<K, i.e. x (the lowest card can be from A to 9) (or 9 different starting values)

Ans = 9*5!*(4^5-4)

(Note: A straight in poker also allows {10,J,Q,K,A} under some rules, https://en.wikipedia.org/wiki/List_of_poker_hands#Straight; I have not considered this in my answer)

- All categories
- General Aptitude 1.3k
- Engineering Mathematics 5.4k
- Digital Logic 2.1k
- Programming & DS 3.9k
- Algorithms 3.4k
- Theory of Computation 4.2k
- Compiler Design 1.6k
- Databases 3.1k
- CO & Architecture 2.7k
- Computer Networks 3.1k
- Non GATE 1.1k
- Others 1.4k
- Admissions 501
- Exam Queries 448
- Tier 1 Placement Questions 19
- Job Queries 62
- Projects 12

37,964 questions

45,466 answers

131,326 comments

48,379 users