Increasing your win fraction based on math to make something profitable isn't illegal, just like card counting isn't illegal--the cool thing is, unlike a casino who can ask you to leave, the state can't prevent someone from playing the lottery...good on her!
IIRC the most common exploitable information has been scratchers that have numbers printed on the scratch-off material itself--and then statistically exploiting a non-randomness in the correlation of these numbers to the underlying "match these" (or whatever game it is). The problem with exploitation of that error is it only allows you to determine if a card is likely to be a winner--not determine the if a winner is present in a ticket you don't have. Fortunately, due to customer protection laws, most states allow you to return (either exchange or for cash) unscratched tickets--so you buy 100, or 1000, and return those not likely to be winners (stupid state). This has been done numerous times.
Now people say "just don't make those games"--problem is, the type of "game" that is vulnerable to this exploit is also the most popular type--the "poker" or "tic tac toe" or other types that give the "user" (face it, it's a drug) a feeling of both sequential game-play (not just scratch and randomly win), and the illusion of being able to affect the outcome through choice (which isn't true, but hey, if you already are taxing people who are bad at math, why not really run up the profit margin by addicting their addled brains).
Other more complex (and profitable) methods would allow you to exploit any weaknesses in the distribution algorithms, but require far more samples, and are extremely difficult without insider info.
Anyway, I go with "go her", "lotteries are a tax on people who are bad at math", and "dumb state". And leave with this interesting opinion--lotteries are one of the oldest ways to appease the unwashed masses--they are bread and circuses--by imposing an extraordinarily regressive tax on the poorest, by giving them a hope in pure chance that the state will make all their wishes come true--while "doing a good thing by helping {schools, etc}" it's just a social control method--why do you think winners are so publiscized, (well, the poor ones), and the wealthy winners (I know a family with millions who has won 250k TWICE) or the long term results of winner are never shown (it's like behind the music on crack).