Question: 1. Play poker with Sage. (a) Construct a standard deck of 52 cards. sage: Ranks = Set([2, 3, 4, 5, 6, T, 8, 9, 10,

1. Play poker with Sage. (a) Construct a standard deck of 52 cards. sage: Ranks = Set([2, 3, 4, 5, 6, T, 8, 9, 10, 'Jack', 'Queen', 'King', 'Aoe']) sage: Suits = Set(['I-learts', 'Diamonds', 'Spades', 'Clubs'n sage: Cards = cartesian.product([Ranks, Suits\" Use Cards.cardinality() to check if the deck is dened correctly. (b) Dene the set of all possible hands of ve (this is the sample space). sage: Hands = Subsets(Cards, 5) Run both Hands.cardinality() and binomial(52.5). (c) Deal yourself a hand. sage: Me = Hands.random_element(); Me ((1) Deal a hand for Sage. sage: Hands.random.element() (e) Who has a better hand? (i) Dene the set \"Fluehes\" of all ushes (5 cards of the same suit). Then compute the probability of a ush by sage: Flushes.cardinality()/Hands.cardinality() 2. Find the number of solutions of the equation I + y + z + w = 15 (a) in non-negative integers, (b) in positive integers, (c) in integers satisfying a: > 2, y > -2, z > 0, w > -3. 3. Find the number of non-negative integer solutions of 1:1 + $2 + 2:3 + I4 5 (i. 4. Show that more than half of the selections of 6 from 49 in the UK Lottery have no two consecutive numbers. 5. Find the number of ways of placing 4 marbles in 10 distinguishable boxes if (a) the marbles are distinguishable, and no box can hold more than one marble; b) the marbles are indistinguishable, and no box can hold more than one; ( (c) the marbles are distinguishable, and each box can hold any number of them; (d) the marbles are indistinguishable, and each box can hold any number of them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
