When the New York State lottery first came out in the 1960's I was about 15 years old and bought one of their once-a week tickets (that's all there was). Ticket cost a buck, which, for a fifteen-year old in 1966, was serious money.
The tickets, if I recall correctly, had the number pre-printed on it, and the number was six or seven digits long. I saved and cherished my ticket until the drawing day. The next day, I eagerly looked up the winning number in the paper, mentally spending my new wealth.
Not one digit that appeared ANYWHERE in my number appeared ANYWHERE in the winning number. It was as if my number was 0246864 and the winning number was 1357975.
I cursed softly, and realized my number could have been a LOT closer and I still would have lost.
I became much wiser that day. The following week, I started buying "Mad" magazine regularly, which was dedicated to teaching pimply-faced adolescents that the world is full of sharks looking to fleece you. A much better investment.
As regards lotteries, I live by two maxims:
If you don't play, you can't lose.
Your chances of winning are almost exactly the same whether you play or not.