Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Small Stakes (http://archives1.twoplustwo.com/forumdisplay.php?f=41)
-   -   Baluga theorum tested (sql stuff) (http://archives1.twoplustwo.com/showthread.php?t=370216)

wildzer0 04-02-2007 12:07 PM

Baluga theorum tested (sql stuff)
 
So I was messing around with my pt database this morning and I was curious about seeing how the baluga theorem stacked up against my database. So I wrote a query to see how often TPTK was no good when the action goes like standard baluga theorem:
player a raises preflop, player b calls oop (could have limp/called), 2 players see the flop, player b checks, player a bets, player b calls, turn comes, player b checks, player a bets, player b raises, hand goes to showdown.

I found 279 hands that matched this criteria with the following query

[ QUOTE ]

select case when (gp2.final_hand like 'high card%') then 'High card' ELSE
case when (gp2.final_hand like 'a pair%') then 'A pair' ELSE
CASE WHEN (gp2.final_hand like 'two pair%') THEN 'Two pair' ELSE
CASE WHEN (gp2.final_hand like 'three of a kind%') THEN 'Three of a kind' ELSE
CASE WHEN (gp2.final_hand like 'a straight%') then 'a straight' else
case when (gp2.final_hand like 'a flush%') then 'a flush' else
case when (gp2.final_hand like 'a full house%') then 'a full house' else
case when (gp2.final_hand like 'four of a kind%') then 'four of a kind' else
case when (gp2.final_hand like 'a straight flush%') then 'a straight flush' end end end end end end end end end as final_hand_ab,

count(case when (gp2.final_hand like 'high card%') then 'High card' ELSE
case when (gp2.final_hand like 'a pair%') then 'A pair' ELSE
CASE WHEN (gp2.final_hand like 'two pair%') THEN 'Two pair' ELSE
CASE WHEN (gp2.final_hand like 'three of a kind%') THEN 'Three of a kind' ELSE
CASE WHEN (gp2.final_hand like 'a straight%') then 'a straight' else
case when (gp2.final_hand like 'a flush%') then 'a flush' else
case when (gp2.final_hand like 'a full house%') then 'a full house' else
case when (gp2.final_hand like 'four of a kind%') then 'four of a kind' else
case when (gp2.final_hand like 'a straight flush%') then 'a straight flush' end end end end end end end end end) as final_hand_count

from game g
join hand_histories hh on g.game_number = hh.game_number
join game_players gp on g.game_id = gp.game_id
join game_players gp2 on g.game_id = gp2.game_id
and hh.hand_history like '%*** FLOP ***%: checks%: calls%*** TURN ***%: checks%: raises%*** RIVER ***%'
and gp2.went_to_showdown_n = 1
and gp.went_to_showdown_n = 1
and gp.pre_flop_raise_n = 1
and gp.off_the_button < gp2.off_the_button
and g.players_saw_flop = 2
group by final_hand_ab


[/ QUOTE ]

This was the breakdown of final hands the checkraiser held.:

High card: 14 (5%)
One pair: 57 (20%)
Two pair: 72 (26%)
Three of a kind: 37 (13%)
A straight: 42 (15%)
A flush: 32 (11%)
A full house: 24 (9%)
Four of a kind: 1

So it seems like in the few hundred hands in my DB where baluga applied, TPTK was no good at least 75% of the time (I didn't do the breakdown to see how often one pair was an overpair). If anyone's curious and wants to try it on their own db, I'd be interested in seeing a larger sample size (although I have a feeling it will be similar). If you do run it, do me a favor and spot check the hand histories to see if you find anything that doesn't match, I'm pretty sure this query is correct from my own checking, but it's always possible a bad hand makes it through.

SimonAllan 04-02-2007 12:20 PM

Re: Baluga theorum tested (sql stuff)
 
You also need to take into account that two pair is often a result of a paired board, and that TPTK can still therefore be good in some cases where villain's hand is technically two pair. For example, Hero has AK, villain has AQ on an A447 board.

Djeorge 04-02-2007 12:20 PM

Re: Baluga theorum tested (sql stuff)
 
This is very cool stuff. Where's a good resource for learning about this "sql stuff" you speak of?

Imrahil 04-02-2007 12:22 PM

Re: Baluga theorum tested (sql stuff)
 
Very awesome. It would be great if you could get it perfect but I'm not so sure that's possible.

wildzer0 04-02-2007 12:25 PM

Re: Baluga theorum tested (sql stuff)
 
The 2 pair hadn't actually occurred to me when I was writing the query. I'll mess around with this and post an amended query in a bit

Kermit 04-02-2007 12:27 PM

Re: Baluga theorum tested (sql stuff)
 
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

Skuzzy 04-02-2007 12:30 PM

Re: Baluga theorum tested (sql stuff)
 
Did you consider draws/suck outs that hit on the river? Maybe I read it wrong but it looks like you are looking at the final hand and not the hand held on the turn.

wildzer0 04-02-2007 12:32 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

[/ QUOTE ]

Sorry you don't find this interesting.
[ QUOTE ]

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

[/ QUOTE ]

Look at my old posts, I posted how to do this.

wildzer0 04-02-2007 12:35 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
Did you consider draws/suck outs that hit on the river? Maybe I read it wrong but it looks like you are looking at the final hand and not the hand held on the turn.

[/ QUOTE ]

No, those aren't considered, and I'll say definitively right now that this won't happen (not people sucking out, including that in the query)

Kermit 04-02-2007 12:35 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
[ QUOTE ]
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

[/ QUOTE ]

Sorry you don't find this interesting.
[ QUOTE ]

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

[/ QUOTE ]

Look at my old posts, I posted how to do this.

[/ QUOTE ]

wildzer0,

I was sort of teasing. I am sure this is useful.

I am going to look through your posts now. I think this is a FANTASTIC feature of PT and am very excited to try it out.

Dorian Gray 04-02-2007 12:39 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
Did you consider draws/suck outs that hit on the river? Maybe I read it wrong but it looks like you are looking at the final hand and not the hand held on the turn.

[/ QUOTE ]
This is a very good point and I'd like to see these calculations done with turn equities in stead of river showdowns.

wildzer0 04-02-2007 12:48 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
[ QUOTE ]
Did you consider draws/suck outs that hit on the river? Maybe I read it wrong but it looks like you are looking at the final hand and not the hand held on the turn.

[/ QUOTE ]
This is a very good point and I'd like to see these calculations done with turn equities in stead of river showdowns.

[/ QUOTE ]

This would require integration with pokenum, which anyone is welcome to do. I personally think it's too much of a pain in the ass.

Vincent 04-02-2007 01:04 PM

Re: Baluga theorum tested (sql stuff)
 
Are we to assume that we can take these results, and conclude they also apply to the hands where Player B c/r's the turn & Player A folds TPTK? If not, how does this help us?

mikechops 04-02-2007 01:18 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
Are we to assume that we can take these results, and conclude they also apply to the hands where Player B c/r's the turn & Player A folds TPTK? If not, how does this help us?

[/ QUOTE ]

Why not? I don't see what player A's action has to do with the strength of player B's hand - Well I guess if player A has a boat as opposed to air, then player B's hand is less likely to be strong, but that should be a minor effect.

wildzer0 04-02-2007 01:19 PM

Re: Baluga theorum tested (sql stuff)
 
Obviously we don't know what villain has when we fold the turn. This tells us the hand villain ended up with when those hands went to showdown. If people aren't finding this helpful just disregard it or if any sql people want to improve on it, feel free to hit me up on aim at wildzer080.

Vincent 04-02-2007 01:23 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
Obviously we don't know what villain has when we fold the turn. This tells us the hand villain ended up with when those hands went to showdown. If people aren't finding this helpful just disregard it or if any sql people want to improve on it, feel free to hit me up on aim at wildzer080.

[/ QUOTE ]
This is sort of what I was leading at. It could be the case that villain is c/r'ing certain flop+turn combos w/ hands that would do well in pushing out TPTK, but don't necessarily reflect the results that we see here. Then again, maybe not.

BalugaWhale 04-02-2007 01:27 PM

Re: Baluga theorum tested (sql stuff)
 
booya

remember its a guideline not a rule

wildzer0 04-02-2007 01:34 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
booya

remember its a guideline not a rule

[/ QUOTE ]

haha it is now unbreakable concrete. Actually, the real reason I started fooling around with this was that I was curious about common situations where the guideline is less likely to apply. 2 instances where it is a lot less likely to apply are when the checkraiser is shortstacked (so a cr is all in and somewhere in the area of a minraise) and when the turn is a scare card. Those situations are also pretty related to stats (ie, a player who cr's a scare card is more likely to have TAG stats leaning towards ultra aggressive and the shortstacked player usually has some kind of combination of fishy stats). Of course this is pretty obvious to most, but it's kind of interesting to quantify with a somewhat decent sample size.

JackAll 04-02-2007 01:39 PM

Re: Baluga theorum tested (sql stuff)
 
Doesn't Baluga Theorem state only that we are raised on the turn? Which includes being raise from someone in position when we are oop and bet first - not just c/r'd when we are in position?

tedtodd 04-02-2007 01:59 PM

Re: Baluga theorum tested (sql stuff)
 
What if they're check raising draws....I suppose the failed ones result in HighCard...and the ones that hit result in the 26% of hands that are flushes and straights???

That would mean 3betting turns on draw heavy boards to get a fold would keep you ahead 74% of the time?

wildzer0 04-02-2007 02:03 PM

Re: Baluga theorum tested (sql stuff)
 
The one's that hit don't account for the entire spectrum of straights and flushes, but yeah, they definitely account for some portion of it.

bingobongo 04-02-2007 02:35 PM

Re: Baluga theorum tested (sql stuff)
 
thank you very much. you are going in the right direction
about querying PT.
i do not want to hijack this thread but i think it would be very interesting if somebody with a big database could check out, for example, the standard deviation of all Pre Flop All ins from their statistically expected outcome or the standard deviation from turn to river based on existing equity on the turn. i think we all had or fair share of "Disappointments" and we all cursed the poker sites. i think a lot of people would be interested in this kind of data

Grunch 04-02-2007 02:39 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

[/ QUOTE ]

Some kinds of queries are impossible to write against the PT database. Not because of SQL, but because of how the PT database is structured. In particular, individual bets aren't recorded, so you can't query on things like minraises etc. Even still, there are lots of very useful SQL queries you can write.

plan9 04-02-2007 02:40 PM

Re: Baluga theorum tested (sql stuff)
 
I get no matches...[img]/images/graemlins/confused.gif[/img]

wildzer0 04-02-2007 02:45 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
[ QUOTE ]
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

[/ QUOTE ]

Some kinds of queries are impossible to write against the PT database. Not because of SQL, but because of how the PT database is structured. In particular, individual bets aren't recorded, so you can't query on things like minraises etc. Even still, there are lots of very useful SQL queries you can write.

[/ QUOTE ]

I've actually gotten pretty good at doing stuff like this by using regular expressions to parse hand histories, either in the query or in a shell script that does a little extra processing. I've been wanting an excuse to bug you on AIM anyway so maybe I'll do that later.

Grunch 04-02-2007 02:45 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
pokey or grunch (are they the same person?)

[/ QUOTE ]

No.

Grunch 04-02-2007 02:48 PM

Re: Baluga theorum tested (sql stuff)
 
I always like hearing from fellow 2ers on AIM - no excuse needed. I probably won't be able to chat today however. This is like the day from hell at work.

bilbo-san 04-02-2007 02:50 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
[ QUOTE ]
Did you consider draws/suck outs that hit on the river? Maybe I read it wrong but it looks like you are looking at the final hand and not the hand held on the turn.

[/ QUOTE ]

No, those aren't considered, and I'll say definitively right now that this won't happen (not people sucking out, including that in the query)

[/ QUOTE ]

Including it in the query would be very hard.

But it wouldn't be hard to do it in code. You use the SQL to get the hands and the board on the turn, then use pokenum or some other module to evaluate the hand equity on the turn.

In code, you could do a LOT more logic, to figure out whether it matters if the board has a flush draw, or the board is paired, etc.

Kermit 04-02-2007 02:52 PM

Re: Baluga theorum tested (sql stuff)
 
[ QUOTE ]
[ QUOTE ]
wait a minute. you are telling me when people call raises and then c/r, stuffing their stack in on the turn, they usually have a hand??!! WTF!

In all seriousness, I really wish i wasn't so dumb, becuase their are some lines I would like to search in my PT. I asked about this a while ago and pokey or grunch (are they the same person?) told me this coudn't be done. [img]/images/graemlins/mad.gif[/img]

edited: just cause i suck

[/ QUOTE ]

Some kinds of queries are impossible to write against the PT database. Not because of SQL, but because of how the PT database is structured. In particular, individual bets aren't recorded, so you can't query on things like minraises etc. Even still, there are lots of very useful SQL queries you can write.

[/ QUOTE ]

Hey Grunch.

I shouldn't have misrepresented what you said --im just lazy.

IIRC, i asked you if i could search for a certain sequence and you said it wasn't possible (i dont remember what it was now).

Grunch 04-02-2007 03:04 PM

Re: Baluga theorum tested (sql stuff)
 
I vaguely remember that thread. I seem to recall the question being something regarding a minraise. I could be wrong tho.


All times are GMT -4. The time now is 11:23 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.