Open Side Menu Go to the Top
Register
Badugi combinations Badugi combinations

07-22-2016 , 03:24 PM
So I'm working on some badugi simulations and I think I'm confusing myself about something...the problem I'm running into is there are so many combos of hands it quickly bogs things down (simple example: there are 24 ways to make a 4 badugi, I would like to reduce / simplify this into one combo to represent any 4 badugi and ignore the suits).

But the problem is when I go to model a range for a player that includes badugis as well as 3 card hands, what is the correct ratio to weight those hands? Let's say a guy draws 1 every street and I want to find my equity vs his range with one draw to go, but I don't know if he will draw 1 on the last draw or stand pat (ignore bluffs for now). His range is (let's assume) any three card 6, and whatever badugis he can improve to after the second draw. Is it as simple as enumerating all possible 3 card sixes and giving them ~80% weight and then the same enumeration but with all 4th card combos that make a badugi at ~20% weight? Won't this give me way way too many badugis relative to 3 card hands in the final range? You can see I'm thinking myself into circles on this.

If a range consists of strictly badugis or strictly 3 card hands I am fine, I can enumerate them and run my sim but it's the mixed range I don't quite understand how to represent.
Badugi combinations Quote
07-22-2016 , 09:57 PM
If I am following your question, it seems like you are seeking the final distribution of the opponent's holding before the final draw. But I don't think you can simply start at the end, so to speak.

I think you need to make assumptions about what three-card hands he could have had before the first draw (drawing one). Then, based upon that, it should be fairly straightforward to derive the distribution of hands he could have before the second draw (drawing one). Finally, based upon that, we can derive the distribution of hands he could have before the third draw.

I believe that the final distribution will be influenced by the initial possibilities, which, I think, may be the kernel of your question.

Maybe give us an example of a range of hands your opponent could have before the first draw. Then we could work through together the steps needed to derive what hands he could wind up with before the third draw (knowing that he drew one on the second draw).

Hope this makes sense.

P.S. How important is to to consider card removal effects (i.e., the cards you see)?
Badugi combinations Quote
07-22-2016 , 11:48 PM
I included that in my post. A reasonable range would be any three card six or better, and whatever badugis he makes after the second draw given that range of 3 cards. Since I am just modeling the last draw we can assume no improvement on first draw but we have to account for the chance he hits the badugi on the second draw since we have to act first.

Re: card removal effects, I posted a question about it in the other thread, but it's not a big difference in equity in my experience.
Badugi combinations Quote
07-23-2016 , 12:32 AM
Ok, I got you now.

Yes, I think your initial post is the correct way to deal with this situation. On opponent's second draw, the prob he improves to a badugi is 10/47 and the prob he still has a three card six or better is 38/47. (Right?)

You need to use these probs as the "weights" for your opponent's holding as you make your decision.

Last edited by whosnext; 07-23-2016 at 12:41 AM.
Badugi combinations Quote
07-23-2016 , 01:13 AM
I think I see what OP's issue is. He wants to list out all the possible holdings for the opponent, but in simplified form. And know their probability. For example:

Ac2d3h-Kc
and
Ac2d3h-Qc

...would both just be a 3-2-A. But there are 39 danglers that complete an Ac2d3h 3-card hand. Whereas there is only 1 combination of say 8-3-2-A badugi that involves Ac2d3h. You need specifically the 8s.

I think OP wants the exact probability that opponent ends up with:

6-4-A
5-3-2
J-4-2-A
9-5-4-3

...and so on. The probabilities of each specific 4-card badugi will be far lower than a 3-card hand because badugi's are not only more difficult to obtain, but they are also more specific.

So I guess the badugi combinations are approx 1/39th as common as the 3-card combinations? Except I guess you're giving the opponent 2 draws, so they will be a bit less rare. Pure estimation might be like 1/30th as common.
Badugi combinations Quote
07-23-2016 , 01:33 AM
Ignoring prior card removal I think this is fairly simple.

Opponent draws to an early badugi 10 in 49 = 0.204
The remaining 0.796 he heads to the final draw with a 3-card hand.

On the final draw he hits a badugi 10 in 48 = 0.208
Therefore 0.1656 he gets late badugi + 0.204 early badugi = 0.3696 ends with badugi

Say opponent had 3-2-A to begin with:
0.6304 he will end with 3-2-A
0.3696 he will end with some X-3-2-A badugi, but there are 10 of these

So the odds of say Q-3-2-A would be 0.03696 versus 0.6304 for 3-2-A

Therefore any three-card hand should be approximately 17 times more likely than any badugi.
Badugi combinations Quote
07-23-2016 , 02:58 PM
I just realized the probability of lower combinations are greater.

If we assume villain starts with 6-2-A just as often as 3-2-A, he will sometimes miss his badugi but draw to a better 3-card hand. The least common 3-card hand to end up with would be 6-5-4, and most likely is 3-2-A

Similarly, starting with 4-3-2, 4-3-A, 4-2-A, and 3-2-A can all draw to 4-3-2-A.
However a hand such as Q-4-3-2 can only be drawn from exactly 4-3-2. This is true for all 7+ high badugis.

Since we are more likely to enter the final draw with 3-2-A compared to 6-5-4, this means opponent ends up with a hand like Q-6-5-4 a bit less often than Q-3-2-A

Last edited by Yoshi63; 07-23-2016 at 03:21 PM.
Badugi combinations Quote
07-24-2016 , 12:30 AM
Quote:
Originally Posted by Yoshi63
I just realized the probability of lower combinations are greater.

If we assume villain starts with 6-2-A just as often as 3-2-A, he will sometimes miss his badugi but draw to a better 3-card hand. The least common 3-card hand to end up with would be 6-5-4, and most likely is 3-2-A

Similarly, starting with 4-3-2, 4-3-A, 4-2-A, and 3-2-A can all draw to 4-3-2-A.
However a hand such as Q-4-3-2 can only be drawn from exactly 4-3-2. This is true for all 7+ high badugis.

Since we are more likely to enter the final draw with 3-2-A compared to 6-5-4, this means opponent ends up with a hand like Q-6-5-4 a bit less often than Q-3-2-A
Yes, you are absolutely right, but I'm thinking of ignoring this aspect because its extraordinarily tedious and shouldn't change the equities too much.

Unless I revise the entire thing and I simulate the three draws and put in "rules" for what cards to keep. Then it will be trivial since if he starts with 6-2-A and catches the 3 suited to the 6 my code will recognize his hand value as 3-2-1 now and just proceed from there. So the higher probability of those events will be built in if I deal out all the cards (this adds a ton of cycles though )

Feels like I can proceed one of two ways: either I make my code simulate a hand actually playing out, actually use the suits, etc and it will be correct, but slow running, or I can make it basically a badugi math estimator, where it will combo count, do the probabilities as you suggest, but have some flaws in the little edge cases that would take forever to account for every single time.
Badugi combinations Quote
07-24-2016 , 12:25 PM
I think the probabilities would be fairly different. After 3 draws you probably end up with 6-5-4 like 25% as often as you end up with 3-2-A. Not sure how it affects your final equity but I'd certainly want to at least attempt to account for this roughly.

Maybe you could calculate the exact probabilities of ending with certain hands, and use logic to fill in the gaps.
Badugi combinations Quote
07-24-2016 , 07:46 PM
I ran a simulation of 1,000,000 deals in which a player starts with a random 3-card six or better and draws one in each of the first two draws. Here is the resulting distribution of his 3-card badugis after his second draw (4-card badugis are excluded):

654 27487
653 31813
652 36309
651 41128
643 36447
642 41420
641 46359
632 46764
631 52024
621 57886
543 41000
542 46829
541 52025
532 51653
531 57839
521 63967
432 57663
431 63935
421 69864
321 77588

---

Here's the results of 10,000,000 deals:

654 273517
653 316720
652 364172
651 411860
643 362982
642 412728
641 464540
632 465541
631 520437
621 575890
543 410799
542 465179
541 520168
532 519819
531 579932
521 640100
432 578182
431 641032
421 704370
321 772032

Last edited by whosnext; 07-24-2016 at 10:52 PM. Reason: upped the sample to 10 million
Badugi combinations Quote
07-24-2016 , 09:08 PM
Nice work. Seems about right intuitively.

I'm curious how you dealt with the suits in your code. Maybe you want to post or PM it?
Badugi combinations Quote
07-24-2016 , 09:37 PM
Here is the code written in R. Note, I am not a computer programmer by any means and sort of cobbled this together. I coded the 52-card deck from A-2 in spades, hearts, diamonds, and clubs. Ranks are given by the rlabel vector and suits go from 1 to 4. In the code, I assume suits of the original three card badugi are spades, hearts, and diamonds, respectively, from high to low.

Code:
badugi3=function(trials)
{
  set.seed(1234)
  
  rlabels=c(1,13,12,11,10,9,8,7,6,5,4,3,2)
  vec52=1:52
  vec3=1:3
  veccy=c(100,10,1)
  
  tally=rep(0,20)
  
  tallyvec=rep(0,20)
  tallyvec[1]=654
  tallyvec[2]=653
  tallyvec[3]=652
  tallyvec[4]=651
  tallyvec[5]=643
  tallyvec[6]=642
  tallyvec[7]=641
  tallyvec[8]=632
  tallyvec[9]=631
  tallyvec[10]=621
  tallyvec[11]=543
  tallyvec[12]=542
  tallyvec[13]=541
  tallyvec[14]=532
  tallyvec[15]=531
  tallyvec[16]=521
  tallyvec[17]=432
  tallyvec[18]=431
  tallyvec[19]=421
  tallyvec[20]=321
 
  cardmat=matrix(0,nrow=20,ncol=3)
  cardmat[1,]=c(9,23,37)
  cardmat[2,]=c(9,23,38)
  cardmat[3,]=c(9,23,39)
  cardmat[4,]=c(9,23,27)
  cardmat[5,]=c(9,24,38)
  cardmat[6,]=c(9,24,39)
  cardmat[7,]=c(9,24,27)
  cardmat[8,]=c(9,25,39)
  cardmat[9,]=c(9,25,27)
  cardmat[10,]=c(9,26,27)
  cardmat[11,]=c(10,24,38)
  cardmat[12,]=c(10,24,39)
  cardmat[13,]=c(10,24,27)
  cardmat[14,]=c(10,25,39)
  cardmat[15,]=c(10,25,27)
  cardmat[16,]=c(10,26,27)
  cardmat[17,]=c(11,25,39)
  cardmat[18,]=c(11,25,27)
  cardmat[19,]=c(11,26,27)
  cardmat[20,]=c(12,26,27)
 
  #for (j in 1:20)
  #{
  #  print(rlabels[ranks(cardmat[j,])])
  #}
  
  count=0
  
  for (t in 1:(10*trials))
  {
    rand=sample(20,1)
    startcards=cardmat[rand,]
    startranks=rlabels[ranks(startcards)]
    remaincards=setdiff(vec52,startcards)
    
    #deal 4th card
    deal4card=2 # king of spades
    remaincards=setdiff(remaincards,deal4card)
    
    #first draw
    newranks=startranks
    firstnewcard=sample(remaincards,1)
    
    firstnewsuit=suits(firstnewcard)
    firstnewrank=rlabels[ranks(firstnewcard)]
    
    if(firstnewsuit<4)
    {
      othersuits=setdiff(vec3,firstnewsuit)
      if((firstnewrank<startranks[firstnewsuit])&(!(firstnewrank==startranks[othersuits[1]]))&(!(firstnewrank==startranks[othersuits[2]]))) 
      {
        #browser()
        newranks[firstnewsuit]=firstnewrank
      }
      
      #second draw
      remaincards=setdiff(remaincards,firstnewcard)
      secondnewcard=sample(remaincards,1)
    
      secondnewsuit=suits(secondnewcard)
      secondnewrank=rlabels[ranks(secondnewcard)]
    
      if(secondnewsuit<4)
      {
        othersuits=setdiff(vec3,secondnewsuit)
        if((secondnewrank<newranks[secondnewsuit])&(!(secondnewrank==newranks[othersuits[1]]))&(!(secondnewrank==newranks[othersuits[2]]))) 
        {
        #browser()
        newranks[secondnewsuit]=secondnewrank  
        }
        
        sortnewranks=sort(newranks, decreasing=TRUE)
        sorty=sum(veccy*sortnewranks)
        tw=which(tallyvec==sorty)
        tally[tw]=tally[tw]+1
        count=count+1
        if(count==trials) break
      }
    }
    
  }
  
 return(cbind(tallyvec,tally))
  
  
}
Badugi combinations Quote
08-31-2016 , 09:32 PM
who starts with 3 cards under a 6? should be 2 cards nder a 6 or a2 a3
Badugi combinations Quote

      
m