Upgraded shuffling of the deck

Post Reply
User avatar
Jonas
Illuminated One
Illuminated One
Posts: 4895
Joined: Mon Nov 25, 2002 3:46 pm
Contact:

Upgraded shuffling of the deck

Post by Jonas » Tue Oct 04, 2011 3:58 pm

Today we upgraded our Random Number generator for the shuffling of the decks in online games.

In theory you shouldn't notice any difference, but who knows ;)

User avatar
Sailing_Away
Guide
Posts: 871
Joined: Fri Feb 08, 2008 10:44 am
Location: Perth, ON

Re: Upgraded shuffling of the deck

Post by Sailing_Away » Thu Oct 06, 2011 1:44 pm

With the nature of random number generators, 49% of the people will say the cards are much better in being randomly distributed, 49% will say it's worse, and 2% won't have an opinion. Perfect results of a number random generator! :-)
-Brian

"Come Sail Away with me...."

pro_zak
Active Poster
Posts: 38
Joined: Fri Dec 10, 2010 4:08 am

Re: Upgraded shuffling of the deck

Post by pro_zak » Fri Nov 25, 2011 7:52 pm

Well its been way over a month since this upgrade. I see no difference except its worse. YOU get good cards or bad cards for a period of time so the times you get the bad ones you just use a lower nic and play to work on your skills. When I get two bids and hands with one spade or two spades and a lone queen of another suit consistently there is no way to win so I just practice on my skill for when the cards change. And yes have beat the other team with all the cards because of skill . When you get a game with cards distributed so either side can win its much more fun but its never gonna change so will just keep on keeping on. Have quit playing pass or suicide pass tournaments because of the spade distribution its just to frustrating. There are positives about the site such as the guides cleaning up the lobby . I cant get used to the new version have tried it three times. If I go into lobby in smoots in new version I cant see what games are open or who is playing in them so its frustrating to me unless I am not hitting some button right. Yes I got offtrack. Ohhhhhhhhhhhhh it would be nice if the old version could send coffee to pard I would be willing to pay for it .

pro_zak
Active Poster
Posts: 38
Joined: Fri Dec 10, 2010 4:08 am

Re: Upgraded shuffling of the deck

Post by pro_zak » Tue Dec 06, 2011 12:04 am

Well into another month with the crap dealers still at it. Tonite two games in a row the other team had four nils with the one game last hand 8 bid. It did no good to set them or bag them they just were gifted back nils . What the heck is going on that these cards are distributed so uneven. How can it be fun or competitive to play with this kind of cards? Something is very wrong here. ugh ugh ugh ugh

Spadesomniac
Active Poster
Posts: 58
Joined: Mon Jan 07, 2008 12:05 am
Location: Boston

Re: Upgraded shuffling of the deck

Post by Spadesomniac » Mon Jul 30, 2012 1:00 pm

Random distribution by its nature involves massive unfairness at times.

I haven't programmed anything since Fortran was a hot new language. So just out of curiosity can someone please explain how a computer is programmed to randomly pick one card from a deck of 52, then the next etc.?

It sounded trivial to me until I actually thought about how I would do it and then I realized I had no idea how to do this.

User avatar
Sailing_Away
Guide
Posts: 871
Joined: Fri Feb 08, 2008 10:44 am
Location: Perth, ON

Re: Upgraded shuffling of the deck

Post by Sailing_Away » Tue Jul 31, 2012 10:04 am

I'm a database administrator with a background in programming. Back in college, I not only took classes in programming but also stats and discrete math.

A complete pre-requisite is a randomizing function where you provide the number of possible choices (n), and this function has been thoroughly tested so you know over a very large sample, every possible result has a 1:n chance of being selected.

For the game's deck (could be 52 cards for hearts or spades or a smaller for euchre as appropriate), I would build an array representing every card (order unimportant - just you need to define one). I'll assume this is a 52 card deck for this explanation, and say I define hearts A, 2, 3..., J, Q, K, then diamonds, then clubs, then spades all the same order.

For the shuffling, I would pass n=52 into the function and it gives me a random number 1-52 (all with equal chance of being selected). The card that represents is card #1 in the shuffled deck, and I pop that one out of the array and move the higher array values down 1. Now I have 1 card in my shuffled deck and 51 cards in my array.

Now I repeat, passing n=51 into the function, and it gives me a random number from 1-51 where every possible response has a 1 in 51 chance of being selected. I pop that card out into the 2nd position of my shuffled deck, move the higher array occurrences down, and repeat until n=1 when I move the last card into the last position of my shuffled deck.

I agree with the comment that sometimes you will have the condition where you cannot believe the randomness was very random, but if you allow true randomization, you allow for all possible combinations and permutations including those that blow your socks off.
-Brian

"Come Sail Away with me...."

Spadesomniac
Active Poster
Posts: 58
Joined: Mon Jan 07, 2008 12:05 am
Location: Boston

Re: Upgraded shuffling of the deck

Post by Spadesomniac » Thu Aug 02, 2012 8:57 am

Thank you Brian!

Yes, I remember the array part but it was the randomizing function part I wouldn't know how to do.

But in any case, presuming you do have an accurate randomizer, this method sounds completely foolproof. I'm unclear as to why people are continually saying the deals aren't fair. I'm presuming HW did something like you post above, so it should be completely random and if you were to play a very large number of games you should get an average distribution of cards.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests