COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### cards

• Email
• Follow

```Let's say you want to iterate through all of the possible combinations
that occur when you choose 7 cards from a fifty two card deck.  Anyone
know the best way to do this?

Thanks.

```
 0
Reply bob136 (434) 10/4/2005 5:51:14 PM

See related articles to this posting

```bob@coolgroups.com wrote:
) Let's say you want to iterate through all of the possible combinations
) that occur when you choose 7 cards from a fifty two card deck.  Anyone
) know the best way to do this?

What the best way is depends on why you would want to iterate through all
possible combinations, how you want to represent those combinations, and
probably a lot of other factors as well.

I can probably come up with some code for this, but I doubt it will be
the 'best way' in every way.

SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
```
 0
Reply willem (1478) 10/4/2005 5:59:48 PM

```<bob@coolgroups.com> wrote in message
> Let's say you want to iterate through all of the possible combinations
> that occur when you choose 7 cards from a fifty two card deck.  Anyone
> know the best way to do this?

Are the same cards, but in a different order, a different combination?

--
Roger

```
 0
Reply rkww (343) 10/4/2005 6:52:55 PM

```I'm trying to analyze the Texas Holdem probabilities.

Roger Willcocks wrote:
> <bob@coolgroups.com> wrote in message
> > Let's say you want to iterate through all of the possible combinations
> > that occur when you choose 7 cards from a fifty two card deck.  Anyone
> > know the best way to do this?
>
> Are the same cards, but in a different order, a different combination?
>
> --
> Roger

```
 0
Reply bob136 (434) 10/4/2005 9:26:15 PM

```bob@coolgroups.com wrote:
) Roger Willcocks wrote:
)> <bob@coolgroups.com> wrote in message
)> > Let's say you want to iterate through all of the possible combinations
)> > that occur when you choose 7 cards from a fifty two card deck.  Anyone
)> > know the best way to do this?
)>
)> Are the same cards, but in a different order, a different combination?
)
) I'm trying to analyze the Texas Holdem probabilities.

So order doesn't matter, I guess ?

Well then it's real easy:

for (c1 = 0;    c1 < 52-6; c1++)
for (c2 = c1+1; c2 < 52-5; c2++)
for (c3 = c2+1; c3 < 52-4; c3++)
for (c4 = c3+1; c4 < 52-3; c4++)
for (c5 = c4+1; c5 < 52-2; c5++)
for (c6 = c5+1; c6 < 52-1; c6++)
for (c7 = c6+1; c7 < 52-0; c7++)
do_something(c1,c2,c3,c4,c5,c6,c7);

If you want a more general routine that can handle different numbers of
cards, that's not much more complex, but quite a bit harder to think of.

SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
```
 0
Reply willem (1478) 10/4/2005 9:44:02 PM

```"Willem" <willem@stack.nl> wrote in message
> bob@coolgroups.com wrote:
> ) Roger Willcocks wrote:
> )> <bob@coolgroups.com> wrote in message
> )> > Let's say you want to iterate through all of the possible
> combinations
> )> > that occur when you choose 7 cards from a fifty two card deck.
> Anyone
> )> > know the best way to do this?
> )>
> )> Are the same cards, but in a different order, a different combination?
> )
> ) I'm trying to analyze the Texas Holdem probabilities.
>
> So order doesn't matter, I guess ?

According to
http://www.learn-texas-holdem.com/how-texas-holdem-is-played.htm (now
there's an apposite url, even if I say so myself), each player is dealt two
cards and has to select a poker hand from those two cards and five
separately dealt pool cards usable by all players.

Betting occurs after the player receives two cards, and after the pool gets
three, four then five cards.

So it looks like order does matter.

--
Roger

```
 0
Reply rkww (343) 10/4/2005 11:04:00 PM

```why does it look to you like order matters?

```
 0
Reply bob136 (434) 10/5/2005 11:21:50 AM

```bob@coolgroups.com wrote:
> why does it look to you like order matters?
>

In the loops solution (seven nested loops), the last variable never
takes the first value. Translating to cards, it means that you're
assuming that the last card on the table can never be the ace of spades.

This assumption would change the probabilities considerably (and is
definitely wrong for a game of poker).

So if you want a call/fold/raise winning probabilities after each card,
you can't just go through all possible 7-card sets, you have to look at
the order of the cards in each set as well.
```
 0
Reply spammer16 (12) 10/5/2005 11:54:41 AM

```In article <di0eaa\$pf\$1@reader-00.news.insnet.cw.net>,
Omri Barel  <spammer@b2z.com> wrote:
...
>In the loops solution (seven nested loops), the last variable never
>takes the first value. Translating to cards, it means that you're
>assuming that the last card on the table can never be the ace of spades.
>
>This assumption would change the probabilities considerably (and is
>definitely wrong for a game of poker).
>
>So if you want a call/fold/raise winning probabilities after each card,
>you can't just go through all possible 7-card sets, you have to look at
>the order of the cards in each set as well.

I'm not sure it's quite that bad. Each player starts out with 2 private
cards, and then five public cards are made available in three groups: the
flop (the first 3 cards), the turn (the fourth card), and the river (the
last card). So, the set of 7 cards is made of 4 subsets:

Size    Name
=====   =====
2       Private (This is unique to each player)
3       Flop
1       Turn
1       River

Within the Private and Flop sets, ordering doesn't matter. This reduces
the search space by a factor of 12.

One complication in all this is that the value of a given set of 7 cards
is strongly influenced by the potential value of the public cards by
themselves. That is, if I'm holding a pair of 2's, they aren't worth
as much if the public cards look like 4,4,3,3,3 or 4,5,6,7,10. I would
expect considerations like those to have a big role in deciding the
overall worth of a hand.

-Mike
--
http://www.mschaef.com
```
 0
Reply mschaef3 (136) 10/5/2005 1:24:07 PM

```Roger Willcocks said:

> <bob@coolgroups.com> wrote in message
>> Let's say you want to iterate through all of the possible combinations
>> that occur when you choose 7 cards from a fifty two card deck.  Anyone
>> know the best way to do this?
>
> Are the same cards, but in a different order, a different combination?

No. They are a different permutation, but he specifically asked for
combinations, not permutations.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/2005
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
```
 0
Reply invalid171 (7013) 10/5/2005 11:10:55 PM

9 Replies
47 Views

Similar Articles

12/5/2013 9:52:15 PM
[PageSpeed]

Similar Artilces:

Video cards for dual monitors
and it seems to me that the video card may be more important than the monitor -- assuming I get a quality monitor. Is that correct? So, who makes the best video cards that support LCDs and dual monitors? One primary concern is reliable drivers. I have had some terrible experiences with video drivers. Tom's Hardware seems to like Nvidia. Price is not a major concern. I am willing to spend a few bucks more for quality. All suggestions appreciated. -- For email, use Usenet-20031220 at spamex.com On Sun, 01 Aug 2004 16:37:56 -0700, Top Spin <ToppSpin@hotmail.com> wrote: >I will not be playing games or doing super high-resolution graphics -- >mostly text editing, spreadsheets, and the like, plus some medium >resolution graphics such as (personal) digital photographs and web >surfing. >So, who makes the best video cards that support LCDs and dual >monitors? For strictly 2D use, I'd suggest a Matrox card. Something like a G550 Dual DVI should do the job (you use an adapter for DVI to VGA for the old CRT display). The advantage of Matrox over ATI and Nvidia is better multi-monitor tools. It will also give the opportunity for a future upgrade to two

List installed cards on a pc
Is it possible for a VI to check if a card is installed or not?

Two cards or one?
Hi, I have two Adaptec SCSI cards. One ASC-29160 and one ASC-19160. I have two Seagate Cheetah X15-36LP ST318452LW Ultra160 SCSI 15000rpm drives. My Mobo is a Tyan tiger dual cpu Tyan Tiger MPX S2466N-4M Motherboard. Would it be a faster setup to run each drive on separate cards, or run both drives on the same card? I want to put my operating system on one drive, and my applications on the other. "Gruntgrunt" <gruntgrunt2000@yahoo.com.au> wrote in message news:1104976394.837805.183580@f14g2000cwb.googlegroups.com > Hi, > > I have two Adaptec SCSI cards. One ASC-29160 and one ASC-19160. I have > two Seagate Cheetah X15-36LP ST318452LW Ultra160 SCSI 15000rpm drives. > My Mobo is a Tyan tiger dual cpu Tyan Tiger MPX S2466N-4M Motherboard. > > Would it be a faster setup to run each drive on separate cards, Nope. > or run both drives on the same card? Should be fine. Check that disconnect/reconnect is enabled in BIOS setup. > I want to put my operating system on one > drive, and my applications on the other.

Access for Company Identification Cards
Thank you in advance for any and all assistance. I recently purchased an Ink Dye Sublimation printer and I'm looking to do something with Access for my employee ID Cards. I know I shouldn't store images for bloating purposes, but how do I get an image into a report, say for printing ID cards, if I don't store it in the program? Michael Store the pics in a directory and then link to them. Don On 19 Apr 2004 12:50:40 GMT, lumpierbritches@aol.com (Lumpierbritches) wrote: >Thank you in advance for any and all assistance. I recently purchased an Ink >Dye Sublimation printer and I'm looking to do something with Access for my >employee ID Cards. I know I shouldn't store images for bloating purposes, but >how do I get an image into a report, say for printing ID cards, if I don't >store it in the program? > >Michael "Lumpierbritches" wrote > I recently purchased an Ink Dye Sub... > printer . . . Access for my employee ID > Cards. I know I shouldn't store images > for bloating purposes, That's not necessarily so -- see the article in the referenced download. > but how do I get an image

multiple identical pcmcia cards
Hello together, I have problem configuring multiple identical pcmcia wireless network cards with different drivers. for example, I want to bind one Card to the orinoc_cs and the other to host_ap. The only differenc is the initial hardware-address or socket number. any suggestions ��������Norbi

Free Rx Cards
Here is another site by American Consultants Rx that really helped me and my family deal with the high cost of prescription drugs at http://www.americanconsultantsrx.com .It may help.

Wireless LAN cards and SGI
hi there, any chance for working... ? Thanks In article <ci4asp\$kir\$1@atlantis.news.tpi.pl>, nicte <nicte@wp.pl> wrote: :any chance for working... ? That would depend upon which hardware you were using. The O2 was the first SGI desktop to have any PCI slots at all. If you did happen to have an SGI machine with a PCI slot, then finding a driver would not be easy. You might be able to adapt one from Linux, but I would tend to think you would pretty much end up re-implimenting rather than just tweaking a bit of code here and there. If you need wireless but you don't want t

Sound cards making a difference?
Will updating my sound card from a SoundBlaster Live Value make a noticeable difference in frame rate on a 9800pro, Athlon64 3200+ rig? I'm really not into 3D sound at all. I see no use for it and doesn't do a thing for me. But if frame rates can be boosted, that may be worth buying a new sound card for. Destroy <ask@please.com> wrote in message news:<V7y2c.51219\$LD5.18291@twister.rdc-kc.rr.com>... > Will updating my sound card from a SoundBlaster Live Value make a > noticeable difference in frame rate on a 9800pro, Athlon64 3200+ rig? > > I'm really