Correct use of double brackets?

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Correct use of double brackets?

Postby acesjohn » Fri Aug 24, 2018 10:53 am

Ok so I have two stats coded:

1) Bet T After F donk (3bet pot)
&
2) Bet T After F raise (3bet pot

#1 starts:
sum(if[(cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) AND NOT (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet).....

#2 starts:
sum(if[((cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) OR (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet))....

I have also coded a "Bet T after F float, that is only half an expression (call 3b/4b only), this was within on bracket. I believe #1 is correct. But I do doubt #2, I get two very different stats baised on if i use this double bracket.

without a double bracket i get 427/427, which i know is horribly wrong. With the double bracket i get 0/0 which is more believable as in my sample their were only 19 opportunities to bet the turn after a flop raise (collectively).

Is the double bracket correct here because it defines a "part 1" either a or b and then moves on to "part 2"?

Hope my question makes sense!
acesjohn
 
Posts: 134
Joined: Mon Sep 08, 2008 6:21 pm

Re: Correct use of double brackets?

Postby Flag_Hippo » Fri Aug 24, 2018 12:25 pm

acesjohn wrote:#1 starts:
sum(if[(cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) AND NOT (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet).....

#2 starts:
sum(if[((cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) OR (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet))....

I have also coded a "Bet T after F float, that is only half an expression (call 3b/4b only), this was within on bracket. I believe #1 is correct. But I do doubt #2, I get two very different stats baised on if i use this double bracket.

This has nothing to do with the brackets and you will get the same results with or without the double bracket. The reason you are seeing different results is that #1 is using 'AND NOT' and #2 is using 'OR'.
Flag_Hippo
Moderator
 
Posts: 14505
Joined: Tue Jan 31, 2012 7:50 am

Re: Correct use of double brackets?

Postby acesjohn » Sat Aug 25, 2018 8:24 am

Not quite what i was asking, because #1 is for a donked flop and #2 is for a raised flop. A donked flop can only be a Call pre, a raised flop can be a Call or Raise pre.

What I want to know is why are my results 427/427 & 0/0 when i use these two codes:
sum(if[(cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) OR (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet) AND (cash_hand_player_statistics.amt_f_bet_facing > 0 AND lookup_actions_f.action SIMILAR TO '(R|XR)%') AND NOT cash_hand_player_statistics.flg_f_3bet_def_opp AND cash_hand_player_statistics.flg_t_open_opp, 1, 0])


sum(if[((cash_hand_player_statistics.flg_p_3bet_def_opp OR cash_hand_player_statistics.flg_p_4bet_def_opp) OR (cash_hand_player_statistics.flg_p_3bet OR cash_hand_player_statistics.flg_p_4bet)) AND (cash_hand_player_statistics.amt_f_bet_facing > 0 AND lookup_actions_f.action SIMILAR TO '(R|XR)%') AND NOT cash_hand_player_statistics.flg_f_3bet_def_opp AND cash_hand_player_statistics.flg_t_open_opp, 1, 0])

The only difference is a double bracket.

I used the other code to show that i had not previously needed a double bracket. Sorry that probably made it confusing to understand my question :/
acesjohn
 
Posts: 134
Joined: Mon Sep 08, 2008 6:21 pm

Re: Correct use of double brackets?

Postby WhiteRider » Sat Aug 25, 2018 9:33 am

Technically you're not using double brackets there - you're grouping more expressions.
These two are functionally equivalent:
(a OR b)
((a OR b))
But your expressions are more complex than that.

Your two expressions are like this:
a OR b AND c
..and..
(a OR b) AND c

They can be different if the AND gets higher priority than the OR, because then the first one becomes:
a OR (b AND c)

Including more brackets will make your expressions more accurate, unless you put them in the wrong place.
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Correct use of double brackets?

Postby BillGatesIII » Sun Aug 26, 2018 2:59 pm

BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 20 guests

cron
highfalutin