rlucas.net: The Next Generation Rotating Header Image

ancient

Oregon Lottery Video Poker Hold / EV statistics

This posting has three parts:

I. Why video lottery is a bad thing for the state to run
    in which I describe philosophical and practical problems with the status quo.
II. What the state doesn't tell about the mechanics of video lottery
    in which I describe the key statistical
metrics of how deleterious the game itself is, which metrics are not
published by the state.
III. My proposed scheme for remedying the situation.
    in which I indulge myself with presumed legislative fiat.

It will in turn be followed (preceded, for those of you reading in LIFO
order on the main page) by specific information hinted at in section II.

I. Why video lottery is a bad thing for the state to run.

Video poker (video lottery) as run in Oregon is deplorable for a number of reasons:

1. It uses a state-enforced monopoly to dole out “free money” to the private sector at the whim of the lottery administrators.
    A. No innovations, goods, or services are required
of lottery “retailers” — the machine is in effect an artificially
scarce rent-producing box.
    B. Unlike in a public-private collaboration such as
a utility, where the public (through the state) gives rights-of-way and
monopoly in exchange for the pulic good of universal power and
communications accessibility, the private portion of the video poker
cartel (bars) brings nothing to the table except access to drunk people
with cash.
    C. Giving free rents to qualifying and willing bars
in this manner dramatically disorts the economics of bar ownership,
subsidizing poor management of properties (it is not unusual that a bar should “break even”
on honest revenues, and make the annual profit from video lottery) and
penalizing bars whose morals or decorum make video lottery unacceptable.

2. It figuratively “addicts” the state budget to its revenues, giving itself institutional inertia.
    A. Video lottery sales comprise the lion's share of
lottery sales ($530 M / $895 M in FY 04), making the video lottery the
sine qua non of the entire operation.  (The portion of sales from
video lottery will rise dramatically as “line games” — slot machines
— are added.)
    B. The net transfers to the state in excess of $364
M  make for 3% of the state's budget.  This does not include
an effective “slush” fund of carry-forward earnings.  Legislators
must account for this gap if they take anti-lottery measures,
effectively hobbling forward-thinking lawmakers.  Job and
entitlement cuts that would follow budget cuts due to lottery rollback
give the lottery allies in the powerful public-employee unions.
    C. The lottery uses its earnings, before paying the
state its dividend, to pay for aggressive public-relations campaigns to
ensure its institutional lifespan.  If Republicans are afraid of
having to “starve” state-perpetuated “beasts,” this one is
truly fearsome.

3. It literally addicts gamblers, and constitutes a massive regressive wealth-transfer system.
    A. The video lottery is faster and more addictive
than paper lottery tickets; in fact, Oregon video lottery now
officially includes “line games,” or slot machines.  For more on
the addictiveness of the video lottery in South Carolina, see
http://slate.msn.com/id/36673/
    B. By reducing the need for a higher or more
progressive income tax, the video lottery subsidizes the highest-income
Oregonians.  (Not that we need to be paying particularly higher
income taxes, mind you, but there you have it.)

4. WORST OF ALL: Video lottery is the least transparently-treated part of the whole lottery scheme.
    A. The lottery commission emphasizes the paper
ticket games on its web site and its PR campaigns.  In fact, the
“ticket” lottery sales (excluding keno, multistate, and sports) amount
to less than 22% of sales — the vast majority comes from video lottery.
    B. The lottery publishes frequency charts and odds
of winning for the various ticket games, but publishes little about the
video lottery machines.
    C. Nowhere are the rules, EV / hold, and frequency audits of the video poker machines published. 

On the flip side, however, there are lots of things to like about the video lottery:

1. It gives money to the state budget.
[2. Some folks like to play it for fun.]

How can any principled person like the video lottery?  Religious
folks should hate it because it's gambling.  Liberals should hate it because it's regressive in
its redistribution and because some people have fun with it. 
Conservatives should hate it because it “feeds the beast” and teaches
fiscal irresponsibility, and because some people have fun with it. 
Libertarians should hate it because it's a state-violence-enforced
monopoly in what should be a competitive market and therefore people
aren't free to have fun with it on their own terms.  Humanists
should hate it for its fostering of antisocial behavior and its
reduction of human potential to negative-sum lever-pressing
domapinergic repetition.

II. What the state doesn't tell about the mechanics of video lottery.

What do I mean when I talk about “hold” or “EV?”  These are
measurements of the “edge” in a game (hold being the house edge), or,
from the player's perspective, the Expectation Value, given as portion
of amount wagered to be received back on each trial on average (note
that EV is typically stated less the initial unit bet, e.g. starting at
0, giving a positive or negative figure, -.05 instead of .95.  I
prefer EV given with 1.00 instead of 0 as a starting place, for ease in
the types of calculations I prefer.  If you are using the normal
method, simply subtract 1 from the EV numbers I use).

A quick primer on EV: for every $1 you bet, how much will you make
back, on average?  With a perfect coin-toss, it's $1 in, $1 out —
50/50 odds, or a 1.00 EV.  If the coin were biased to heads by 1%,
then your $1 bet on tails would win $0 [or “lose”] 50.5% of the time,
and win $2 only 49.5% of the time, giving you a 0.99 EV.  EV under
1 is considered “negative,” while the rare chance for a positive EV bet
is one in which the EV is greater than 1, also known as “getting the
best of it.”  Representative EVs include: roulette (American)
.947, blackjack ~.98, craps (pass line) .985, coin toss, 1.00, a year
in a savings account, ~1.01, a year
in the US equity markets, ~ 1.07.  Remember, EV is calculated with
each and every bet, like compound interest, so a .99 EV game done for
100 trials should net you back only 0.37 of your money (though in
reality variance messes up that neat figure).  Contrast that
with 100 years in the stock market at 7% [1.07 EV], which should give
you 867 times your money back, less taxes.  The total amount bet *
the number of bets is “action;” if you bet $5 100 times, you put $500
in action through, even though you may only have ever had $25 to play
with.  The “hold” is1-EV, or the percentage of each bet that the
house gets back; because it's calculated on each trial, the house
expects to earn the “hold” times the “action.”  Got it?

Poker players, stat jockeys, and others with a sense of EV will appreciate this chart from the Oregon Lottery's
annual report FY 2004:


Sales:
The Lottery had the highest sales
years ever in each of the following categories:
Total Lottery Sales:                   $895.18 million

Video Lottery Sales:                 $530.97 million


Total Traditional Sales:              $362.30 million

Keno Sales:                             
$116.48 million


Powerball Sales:                      
$  45.97
million


Sports Action Sales:                 $  10.00 million

At the bottom is Sports Action — a game that is technically beatable
(positive EV) if you are an expert handicapper.  Then comes
Powerball, a game that is rarely, but occasionally, positive EV because
it is progressive (if nobody wins, the jackpot can theoretically get
large enough to give a positive return).  Then comes Keno and
“traditional” — the stuff that most people think of when “lottery” is
said — all negative EV games but transparently so.  But almost
all the money, in reality, comes from video lottery — video poker (and
soon slots) — about which almost no information can be found.

Note that video poker can be positive EV — in a competitive market
like Las Vegas, where 1. operators have an incentive to reduce the hold
(increase the EV) and 2. progressive jackpots exist that, when unwon,
can boost the EV to positive.

Why, gentle reader, am I spouting off about the corrupt lottery system?

The answer is that I recently visited a local watering-hole with some
friends, and lined in the cramped ante-bar area were some video lottery
machines (no boon to those of us smooshed together, waiting in line to
get a drink).  My friend A. pointed to the screen of the nearest
one, which read

[Machine Configuration]      [Game Configuration]
[Reports]              
             [etc]

…instead of the usual blinky-beepy come-ons.  Curious, we
pressed the reports button, and found the machine happy to give us
printouts of the game holds, results, revenues, etc.  For your
edification, I will be posting this information shortly.  However,
in sum, please be aware of the following:

– The EV on most all Oregon video lottery games is 0.90, or put another
way, the “hold” is 10%.  This is a truly outrageous rate that
makes casino roulette (~5.3%) blackjack (~1-2%) and craps (~1.5%) look
like great deals.

– The EV on “flush fever” is 0.94, or the hold is 6%.  This is
very bad, but a hell of a lot better than others (like “jacks or
better”).

– The “double up” game, offered after each win, is even-money (EV 1.00).

(Keep in mind that all games played against a “house” with
near-infinite resources subject the player to “gambler's ruin,” a
situation in which the player underperfoms his EV because short-term
variances wipe out his bankroll.  This boost the effective hold
over the theoretical hold, in most cases.)

Why is this significant?  After all, everyone knows that the
lottery is a sucker bet, right?  Well, perhaps, but there are
sucker bets, and then there are sucker bets.  You are wiped out
exponentially faster with such a huge edge as 10%.  Consider a
brisk but realistic pace of 360 video poker hands per hour — the least
that may be wagered is 25 cents.  The total action per hour is $90
— at 1% hold, the player loses less than a buck.  But with Oregon
video lottery, the least he will expect to lose is $9 per hour — more
than the state's minimum wage.  Consider, too, that the average
bet is larger, and that the swings of the game put him at risk of
gambler's ruin.

The difference between a sucker bet, and a sucker bet, is huge. 

III. My proposed scheme for remedying the situation.

Here is what should be done:

[As a general premise: 0. “Indian” casinos should be replaced with a
brand-new way to take land and manpower and make jobs; I call these
special programs Indian “factories.”  The Indian factories can
make “goods” that are exported at a “profit.”  This will give them
jobs and tribal tax revenues.]

[UPDATE: The Wall Street Journal recently covered a development where
it appears others share the above premise — there is now a trend for
Indian tribes to use reservation land to build legitimate industry,
like concrete plants.]

1. The state gives up video lottery.
2. To combat grey market video lottery, to prevent folks driving out of
state to play other states' terminals, and to ensure proper income
reporting for taxation, the state forms a video lottery audit board.
3. The audit board licenses establishments to have a certain number of
machines present, and licenses machine owners to run any number of
privately-owned machines with publicly-audited software.  Each
machine's hold percentage may be set and changed by its owner.
4. Each machine must be conspicuously labelled with its hold percentage / EV (see II. above) and most recent audit.
5. The audit board charges fees sufficient to fill its budget. 
Overage is rebated to license-holders, preventing the state from having
an interest in promoting video lottery.
6. Machine-owner licensees contract at arm's length, at-will, with
establishment-licensees as to machine placement.  This creates a
healthy, adversarial competition for the customer's dollar between the
booze and the slot machine.
7. The state makes its money off of income taxes.

The ends my plan serves are:
1. Elimination of state dependence upon, promotion of, or interest in, people losing more money at the video lottery.
2. Reduction in the “hold” and profitability of video machines by market forces, thereby:
3. Reducing incentives for “Indian” casinos by taking pricing power away from them on video poker-type games.
4. Reducing incentives for poorly managed bars by lowering the amount of the received subsidy from the video lottery.
5. Maximizing  happiness by promoting more play per unit wager for
lovers of video lottery and eliminating video lottery from some bars
for whom the lowered margins do not justify keeping the games.

FIX: Evil MSN Search spyware behavior for DNS errors in MSIE

In Microsoft Internet Explorer >= 5, a DNS error (asking for a hostname that doesn't exist) causes IE to pull an evil stunt and feed the requested URL to http://search.msn.com/dnserror.aspx , where it is used to search MSN and logged for who knows what nefarious purpose.  Rather than being opt-in behavior, this is opt-out, and rather than making it clear with a choice in options like “Automatically search when a site is not found”, opting out is a matter of making this choice:

Tools:Internet Options:Advanced:Search from the Address bar:Do not search from the Address bar.

Irksome.

CVSPermissions 0.3 patched to fix grep bug

CVSPermissions is a set of scripts that are called by CVS upon invoking
certain operations, such as commit (wisely, CVS has hooks for just this
purpose).  The scripts check an access control list, and
selectively permit operations based on username.  Unfortunately,
while the scripts come pretty elegantly close to “the simplest thing
that could possibly work,” they use grep without considering its
propensity for matching substrings within a string, so user “lou” will
match the ACL entry for “alouicious.”  The solution is adding ^
and $ around the grep regexes, which I have done in the attached
tarball.

I haven't heard back from Vivek Venugopalan, the author of
CVSPermissions, about the bug.  So, I am providing CVSPermissions
v 0.3-rlucas-1 with my patches.  GNU GPL applies and AS-IS; I have
tested only on GNU/Linux with CVS 1.12.9 and GNU grep 2.5.1.

http://cyber.law.harvard.edu/blogs/gems/rlucas/cvspermissions0.3rlucas1.tar.gz

Happily, this is an open source success story.  Boy meets slightly
broken but otherwise perfect software, boy fixes software, software
helps boy do work, boy gives software back to the world.  It
brings tears to my eyes.

Update 2005-12-01: Vivek has emailed back and incorporated the changes; get the latest version at: http://www.sanchivi.com/cm/cvspermissions/

INFO: Apache SSL error: You have to perform a *full* server restart when you added or removed a certificate …

Have you seen this spuriously:

Ops, no RSA or DSA server certificate found?!
You have to perform a *full* server restart when you added or removed a certificate and/or key file

in your ssl error log (and of course your Apache didn't successfully start: ps -aux | grep httpd | wc -l is zero…) when you were using

apachectl restart

…or some utility that in turn used that method for restarting apache?  Try substituting

apachectl stop && apachectl start

 

BUG/WORKAROUND: Class::DBI / Postgres: "Can't delete: Can't bind a reference"

In Class::DBI, there appears to be a problem with the Postgresql driver
and certain kinds of relationships being defined.  It shows up as
a “can't bind a reference” error in the DBIx::Recordset code for
Postgres.

It persists for me with Class::DBI 0.96 and DBIx::Recordset 0.26.

The effect is seen for me when I retrieve a Class::DBI object id # 56
with some has_a relationships defined, and then try immediately 
to delete it.  It bombs out with

Can't delete 56: Can't bind a reference at blah/blah/blah/DBIx:/Recordset blah blah


I can work around this by 1. removing the has_a relationships, or 2.
stringifying the object before deleting it (found this inadvertantly in
writing some debug statements to explore this; very vexing that reading
a property has such a nonorthogonal effect, but I'll hush since I
haven't the time to become a CDBI developer myself).

INFO: Hawing PS12U Printserver CUPS URI for Linux printing

I have a Hawking Printserver, model number PS12U.  I had already set its IP address using the Windows software (it should be noted that you can ARP the printserver from Linux if need be; google for more info).  However, in order to set it up as a printer on my Linux machine, I needed the appropriate URI to feed to lpadmin.  I tried a number of things like ipp://192.168.0.1/lp1, etc., but finally gave up and used “printconf.”  The proper URI / URL to use, it appears, for addressing the Hawking PS12U is:

 

lpd://192.168.0.1/lp1

 

Where the IP address in the middle is naturally the one you've set for the Printserver and the “lp1” to “lp3” corresponds to the physical port on the PS12U to which you've connected the printer.

I didn't say it was groundbreaking or an awesome fix, just info that I hadn't been able easily to find.

Migrating to new rlucas.net domain for most blogging

Gentle reader,

This server has gotten so slow,
probably thanks to Philip's blog, that
I have finally decided to put up my own server elsewhere.  Other
reasons are:

  • I can't use vim here to edit my entries.
  • I hate the HTML munging that this blog software uses.
  • Despite
    the PageRank boost of the .harvard.edu domain, I have decided to opt
    for the branding aspect of my long-time username, rlucas, which has
    been the local part of my Internet email address since 1993 or
    so.

And so, I am putting on hold this, my
Berkman blog.  I do intend to keep using it for Harvard-specific
things, on occasion, but my technical notes and, newly, my startup and
VC related dispatches, will be found from now on at my rlucas.net blog.

[FIX] Perl DBI / DBD::Pg bind values rely on Perl's automatic numeric/string scalar conversion

Scenario: you are using DBD::Pg to interface with your database (perhaps directly through DBI, or through an abstraction layer like Class::DBI or DBIx::ContextualFetch) when you get an odd result:

DBD::Pg::st execute failed: ERROR: parser: parse error at or near [your string, or the part of your string that doesn't begin with leading digits] at …

or

DBD::Pg::db selectrow_array failed: ERROR: Attribute “yourstring” not found at …

If you look at the PostgreSQL query log, you'll see that “yourstring” was not properly quoted as a literal in the SQL delivered to the parser.

Since you've either been relying upon your abstraction layer or personally doing the Right Thing and binding your values with the “WHERE thing=? AND otherthing=?” syntax, you're quite confused — this should all be quoted.

The problem is that Perl has flagged that scalar as a numeric value, possibly because you used a numeric operator on it (like > or == instead of gt or eq). The solution is to upgrade to DBD::Pg 1.32 or to explicitly stringify your string as “$yourstring”.

Below is the bug filed with CPAN.

Mac OS X 10.2, Perl 5.6.0, DBD::Pg 1.22, DBI 1.45

Bind values appear to rely upon Perl's automatic numeric/string scalar conversion in order to determine whether or not to quote.

This bug was discussed on
http://aspn.activestate.com/ASPN/Mail/Message/perl-DBI-dev/1607287

my $dbh = DBI->connect(…); #connect to Postgres; no errors with SQLite
my $scalar = “abc”;
warn “scalar is greater than zero (and now considered numeric)” if $scalar > 0;
warn “dbh->quote(scalar) works ok: ” . $dbh->quote($scalar);
warn “but bind values do not:” . $dbh->selectrow_array(
“SELECT 1 WHERE 1=?”,
undef,
($scalar)
);

Using a numeric operator on the scalar makes Perl auto-convert it to a number; this is interpreted by the magic in Pg.xs as rendering the scalar ineligible for quoting.

One solution is to bind those variables that must be text but might have been numberified with “$varname”, thereby stringifying them in the eyes of Perl.

FIX: "Undefined subroutine CGI::dump" crashes a formerly working script.

Possible scenario: you wrote an ancient script using the CGI.pm module by Lincoln Stein, and it ran fine on your old RedHat 6.2 box with Perl 5.00503 and an ancient version of CGI.pm.   However, after reinstalling your script on a newer box with Perl 5.6, or else after upgrading your perl and/or CGI.pm, your script is broken and says

Undefined subroutine CGI::dump

Answer: in version 2.50 of CGI.pm, CGI::dump was changed to CGI::Dump. Try:

perl -pi -e 's/CGI::dump/CGI::Dump/' yourscript.pl

 

Class::MethodMaker v2 dies with cryptic "Unknown error" in compilation with bad arguments to use / require

If you use Class::MethodMaker and have a subtle error in your

use Class::MethodMaker [ whatever…];

line, such as not quoting a bareword, you can end up with this error:

Unknown error
Compilation failed in require.
BEGIN failed–compilation aborted.

If this happens, scrutinize your “use” lines and especially your C:MM line.If you use Class::MethodMaker and have a subtle error in your

use Class::MethodMaker [ whatever…];

line, such as not quoting a bareword, you can end up with this error:

Unknown error
Compilation failed in require.
BEGIN failed–compilation aborted.

If this happens, scrutinize your “use” lines and especially your C:MM line.