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.4k
- Engineering Mathematics 5.9k
- Digital Logic 2.3k
- Programming & DS 4.3k
- Algorithms 3.7k
- Theory of Computation 4.6k
- Compiler Design 1.7k
- Databases 3.4k
- CO & Architecture 2.9k
- Computer Networks 3.4k
- Non GATE 1.2k
- Others 1.3k
- Admissions 506
- Exam Queries 482
- Tier 1 Placement Questions 22
- Job Queries 64
- Projects 15

40,903 questions

47,560 answers

146,294 comments

62,306 users