The Free Poker Room

 
 - Forums - Sign Up - Reply - Search - Statistics -
Poker The Free Poker Room Forum / Poker /

Question about the "deck"

 
Author SirLosealot
Forums Member
#1 - Posted: 29 Jul 2010 17:56
Does anyone know the algorithm behind how the cards are dealt? My main question is whether the program must deal every card in a deck, (presumably at random) and then can proceed with the next deck. Or if it does the above with, say, two (or more) decks at once. Or if it simply deals completely random cards.

For example, if the algorithm must deal from one deck at a time, then the card you've just seen is unlikely to show up again for a while. But if every card is random, then you're as likely to see that card show up as any other card.

Thanks!

GO
Author GreatestPIayer
Forums Member
#2 - Posted: 29 Jul 2010 18:33
i think you'll have to wait for batankyu to answer you.
Author dungaree
Forums Member
#3 - Posted: 29 Jul 2010 18:42 - Edited by: dungaree
It appears that its a shuffled deck or that a no real card situation applies and that its as if you log on for every hand. However u do get a sequential run of luck on a certain avatar, before switching that luck to others and vice verse. But who knows what happens in real terms, I am guessing.
Author batankyu2
Forums Member
#4 - Posted: 29 Jul 2010 18:46 - Edited by: batankyu2
SirLosealot:
Does anyone know the algorithm behind how the cards are dealt?

For the Poker table, a single deck is shuffled at each hand
prolly using an implementation of the Fisher-Yates method
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

It prolly starts from an sorted fresh new deck at each hand too
instead of getting back the cards of the previous hand in some defined way.

i have no idea if the soft feels the need or not
to burn 3 virtual cards before flop, turn and river...

The soft has known bugs regarding shuffling and/or dealing:
there was a time the Omaha tourney was dealing two deuces to every player
and flopped two deuces for every first hand of a tourney.
Author batankyu2
Forums Member
#5 - Posted: 29 Jul 2010 19:42 - Edited by: batankyu2
batankyu2:
It prolly starts from an sorted fresh new deck at each hand too

As far as sorted fresh decks are concerned,
we can fairly assume that the decks are sorted according to
the encoding of the cards, each card being encoded by an integer in the range 0..51.

The encoding of a deck at poker tables differs from the encoding of a deck at blackjack tables:

-- Poker tables use the following encoding:
2c=00, 3c=01, 4c=02, ..., Qc=10, Kc=11, Ac=12 (clubs)
2d=13, 3d=14, 4d=15, ..., Qd=23, Kd=24, Ad=25 (diams)
2h=26, 3h=27, 4h=28, ..., Qh=36, Kh=37, Ah=38 (hearts)
2s=39, 3s=40, 4s=41, ..., Qs=49, Ks=50, As=51 (spades)
... that is, clubs first, then diams, then hearts, and finally spades, from deuce to ace.

-- Blackjack tables use the following (orthogonal) encoding:
2c=00, 3c=04, 4c=08, ..., Qc=40, Kc=44, Ac=48 (clubs)
2d=01, 3d=05, 4d=09, ..., Qd=41, Kd=45, Ad=49 (diams)
2h=02, 3h=06, 4h=10, ..., Qh=42, Kh=46, Ah=50 (hearts)
2s=03, 3s=07, 4s=11, ..., Qs=43, Ks=47, As=51 (spades)
... that is, deuces first, then treys, ..., then Kings, and finally Aces, from clubs to spades.

A fresh sorted deck is just the sequence of codes:
00, 01, 02, 03, ..., 48 , 49, 50, 51.

Therefore, a fresh poker deck is sorted by suits first: 2c..Ac,2d..Ad,2h..Ah,2s..As.
while a fresh blackjack deck is sorted by ranks first: 2c,2d,2h,2s,....,Ac,Ad,Ah,As.
Then, Fisher-Yates is applied to shuffle them.
Author SirLosealot
Forums Member
#6 - Posted: 29 Jul 2010 23:21
Thanks batankyu!

GO
Author ronvisser
Forums Member
#7 - Posted: 30 Jul 2010 01:18
batankyu2:
-- Poker tables use the following encoding:
2c=00, 3c=01, 4c=02, ..., Qc=10, Kc=11, Ac=12 (clubs)
2d=13, 3d=14, 4d=15, ..., Qd=23, Kd=24, Ad=25 (diams)
2h=26, 3h=27, 4h=28, ..., Qh=36, Kh=37, Ah=38 (hearts)
2s=39, 3s=40, 4s=41, ..., Qs=49, Ks=50, As=51 (spades)
... that is, clubs first, then diams, then hearts, and finally spades, from deuce to ace.

-- Blackjack tables use the following (orthogonal) encoding:
2c=00, 3c=04, 4c=08, ..., Qc=40, Kc=44, Ac=48 (clubs)
2d=01, 3d=05, 4d=09, ..., Qd=41, Kd=45, Ad=49 (diams)
2h=02, 3h=06, 4h=10, ..., Qh=42, Kh=46, Ah=50 (hearts)
2s=03, 3s=07, 4s=11, ..., Qs=43, Ks=47, As=51 (spades)
... that is, deuces first, then treys, ..., then Kings, and finally Aces, from clubs to spades.

A fresh sorted deck is just the sequence of codes:
00, 01, 02, 03, ..., 48 , 49, 50, 51.

Bat you know that I now complete understand........:-))))
Author batankyu2
Forums Member
#8 - Posted: 30 Jul 2010 01:28
Author Johno59
Forums Member
#9 - Posted: 30 Jul 2010 02:10
Thanks Bat thats a lot clearer now. Its just like looking into my fish pond,Lol.

Way above me, but thanks for your interlectual approach your very clever.
Author batankyu2
Forums Member
#10 - Posted: 30 Jul 2010 04:32
Johno59:
Thanks Bat thats a lot clearer now. Its just like looking into my fish pond,Lol.

Probe it, you might find Ron at the bottom...
Author flyingfinn1
Moderator
#11 - Posted: 30 Jul 2010 07:42
batankyu2:
you might find Ron at the bottom

Confession?
Author LonoWouth
Forums Member
#12 - Posted: 30 Jul 2010 10:13
******

edit swampy (spam)
 
Poker The Free Poker Room Forum / Poker / Question about the "deck" Top
Your Reply Click this icon to move up to the quoted message

» Username  » Password 
Only registered users are allowed to post here. Please enter your login/password details upon posting a message, or sign up first.
 
  The Free Poker Room Forum Powered by Bulletin Board Script miniBB ®