There are dozens of articles online that deal with this.
One particular article by Rabbi Gil Student (here) quotes many Poskim on the matter. After summarizing the halachic background, that the issue of Asmachta for gambling is a machlokes between the Shulchan Aruch and Rema, he notes that Rav Ovadiah Yosef (Yabia Omer 7:CM:6) prohibits lottery participation for Sephardim, who rule like the Shulchan Aruch, and discourages Ashkenazim from doing so. However, Rav Ovadiah Hadaya (Yaskil Avdi 8:YD:5:3) disagrees, and permits lottery tickets even for Sephardim, by arguing that it does not fall under the general rule of asmachta, since the company paying out the money always intends to do so. Rabbi Yosef counters by saying that the proceeds from each individual ticket are stolen, see there for details. Rav Ya'akov Ariel (Beohalah Shel Torah 1:11) permits this for Sephardim since the payment comes in advance of the draw, so one is clearly acknowledging that they are ok with the possibility of losing.
He then quotes various other modern-day poskim about other reasons why entering a lottery is not asmachta and would allow even Sephardim to purchase lottery tickets, including the OP's theory:
Rav Sternbuch (ibid.) also suggests that the odds of winning a lottery are so low that no purchaser assumes he will win. Therefore, there is no asmakhta.
However, Rabbi Student concludes that there may be moral issues with purchasing lottery tickets. As always, CYLOR for psak.
Edit: Also, see this article which permits it, and quotes students of Rav Ovadiah Yosef's who claim that he retracted his stringent ruling later in life.