9 ms·
How large is that number in the Law of Large Numbers?
- dragontamer 3y agoMy statistics class at high school level taught the following: The number of samples you need is very difficult to calculate correctly, requiring deep analysis of standard deviations and variances. But surprisingly, you can simply know you've reached large number status when over 10 items exist in each category. --------- Ex: when doing a heads vs tails coin flip experiment, you likely have a large number once you have over 10 heads and over 10 tails. No matter how biased the coin is. Or in this 'Lotto ticket' example, you have a large number of samples after gathering enough data to find over 10 Jackpot winners.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- jmount 3y agoVery cool rule. I think you can justify it by approximating each category as an independent Poisson distribution. Then for each such processes the variance equals the mean. So once you have 10 successes in a bin, you have evidence of a probably good estimate for the arrival rate of that category. The book "The Probabilistic Method" calls a related idea "the Poisson paradigm." (10 a nice round number where the standard deviation is below the mean)
- jmount 3y agoSmall proviso: this is only true for a reasonable number of categories (or you run into repeated experiment problems).
- hgsgm 3y agoWhat's a reasonable number of categories? 10?
- dredmorbius 3y agoThat's defined by the phenomenon you're investigating. In the case of six-sided dice, there are precisely six categories, ideally with even odds of occurrence. With the lottery jackpot given, there are eight categories, with highly asymmetric probabilities and values. In real-world cases, you might be trying to distinguish two cases (treatment and control in a medical experiment), between multiple particles or isotopes (say, with physics or chemistry), amongst different political divisions (countries, states or provinces, counties, cities, or other), between political parties or candidates (which raises interesting questions over which and/or how many to include in consideration, in turn dependent on voting procedures, overall popularity, and impacts of non-winning candidates or parties on others), on multiple products, or on different behavioural characteristics in some domain (e.g., highly-active, occasionally-active, and lurking participants in online fora). There are times when categories are well and unambiguously defined. Others in which where you choose to draw divisions (say, in generational groups, or wealth or income brackets) is highly arbitrary. Even where there are a large number of potential categories, choosing some limited number for specific analysis (2, 3, 5, 10, etc.) and lumping the remaining into "other" may provide clearer insights and fewer distractions than choosing a large number of divisions.[1] In other cases, a very small number of individuals may account for an overwhelming majority of activity or outcome. I'd strongly argue that in this case, the analysis might be somewhat poorly focused, and that activities and outcomes rather than individuals are of greater interest.[2] What's key is to match your sampling and sample sizes to the phenomenon being studied. ________________________________ Notes: 1. Power law distribution / Zipf functions often mean that a very small number of participants has highly disproportionate impact or significance. 2. This is often the flip side of power law distributions. If we look at all book titles, there are a huge number of individual items to consider; there are roughly 300k annual English-language "traditional" publications, and over 1 million "nontraditional" (self-published, or publish-on-demand) titles. But if your focus is instead titles by percentage of revenue or number of sales, a top-n analysis (5, 10, 20, etc.) often captures much of the activity, frequently well over half. This is typical of any informational good: music, cinema, blogs, social media posts, etc.
- tgv 3y agoFor heads or tails, that leaves a very large margin. In approx. 1 in 20 trials, you'll end up with a 10-20 split.
- dragontamer 3y agoYeah, 95% confidence ratio (or approximately two standard deviations) is pretty standard with regards to statistical tests. You gotta draw the line somewhere. At high-school statistics level, its basically universally drawn at the 95% confidence level. If you wanna draw new lines elsewhere, you gotta make new rules yourself and recalculate all the rules of thumb.
- User23 3y agoI remember my high school AP Psychology teacher mocking p=0.05 as practically meaningless. In retrospect it's funny for a psychologist to say that, but I guess it was because he was from the more empirically minded behaviorist cognitive school and from time to time they have done actual rigorous experiments[1] (in rodents). [1] For example as described by Feynman in Cargo Cult Science.
- lisper 3y agoThe problem is two-fold: 1. p=0.05 means that one result in 20 is going to be the result of chance. 2. It's generally pretty easy (especially in psychology) to do 20 experiments, cherry-pick -- and publish! -- the p=0.05 result, and throw away the others. The result is that published p=0.05 results are much more likely than 1 in 20 to be the result of chance.
- dragontamer 3y agoSo run a meta-study upon the results published by a set of authors and double-check to make sure that their results are normally distributed across the p-values associated with their studies. These problems are solved problems in the scientific community. Just announce that regular meta-studies will be done, expectations for authors to be normally distributed is published, and publicly show off the meta-study. ------------- In any case, the discussion point you're making is well beyond the high-school level needed for a general education. If someone needs to run their own experiment (A/B testing upon their website) and cannot afford a proper set of tests/statistics, they should instead rely upon high-school level heuristics to design their personal studies. This isn't a level of study about analyzing other people's results and finding flaws in other people's (possibly maliciously seeded) results. This is a heuristic about how to run your own experiments and how to prove something to yourself at a 95% confidence level. If you want to get published in the scientific community, the level of rigor is much higher of course, but no one tries to publish a scientific paper on just a high school education (which is where I was aiming my original comment at).
- NelsonMinar 3y agoThat's a neat rule of thumb; is there a simple statistical argument for why 10 is the (not very large) number?
- fiddlerwoaroof 3y agoDoes this work the other way? I.e. “you have enough buckets if adding one more puts the number of samples in the smallest bucket below 10?”
- yafbum 3y agoStats class role of thumb: if you need to calculate the relative probability of two outcomes, you can get to within about 10% once you get 100 samples of each outcome (so, need more samples overall if the distribution is skewed).
- gear54rus 3y agoIts interesting that even in this thread the 2 answers differ by an order of magnitude lol
- gipp 3y agoEh it's really the same rule, just applying a different threshold.
- marcosdumay 3y agoThe problem is that the sensitivity to the number growth is supposed to be exponential. So if you need 100 samples for "within 10% of the value", then 10 samples should give you almost completely random behavior. In reality, it depends on your actual distribution, but the OP from this thread here is unreasonably conservative for something described as a "rule of thumb". Almost always, if you have at least 10 of every category, you can already discover every interesting thing that a rule of thumb will allow. And you probably could go with less. But if you want precision, you can't get it with rules of thumb.
- CaptainNegative 3y agoThe dependence on sample size is not exponential, it's sublinear. The heuristic rate of convergence to keep in mind is the square root of the sample size, i.e. getting 10x more samples shrinks the margin of error (in a multiplicative sense) by sqrt(10) ≈ 3ish. The exponential bit applies to the probability densities as a function of the bounds themselves, i.e. how likely you are to fall x units away from the mean typically decreases exponentially with (some polynomial in) x. Of course, this is all assuming a whole bunch of standard conditions on the data you're looking at (independence, identically distributed, bounded variance, etc.) and may not hold if these are violated.
- wodenokoto 3y agoI really like how the plots and graphics look. Is it the library by 3blue1brown? (Is it manim, it’s called?)
- bannedbybros 3y ago[dead]
- derbOac 3y agoThe biggest problem for real processes is knowing whether in fact x ~ i.i.d., with regard to time as well as individual observations.
- jameshart 3y agoCurious how people are ‘applying’ the Law of Large Numbers in a way that needs this advice to be tacked on? > Always keep the speed of convergence in mind when applying the law of large numbers. Any ‘application’ of the LLN basically amounts to replacing some probalistic number derived from a bunch of random samples with the expected value of that number… and tacking on ‘for sufficiently large n’ as a caveat to your subsequent conclusions. Figuring out whether, in practical cases, you will have a sufficiently large n that the conclusion is valid is a necessary step in the analysis.
- LudwigNagasena 3y ago> Figuring out whether, in practical cases, you will have a sufficiently large n that the conclusion is valid is a necessary step in the analysis. The econometrics textbook I studied has more words “asymptotic” in it than there are pages. Oftentimes it’s impractical or even theoretically intractable to derive finite sample properties (and thus to answer when n is really large enough).
- nathell 3y agoTangential: syntax-highlighting math! This is the first time I’ve seen it. Not yet sure what I think about it, but I can definitely see the allure.
- viscousviolin 3y agoIt's easy on the eyes and it can make reading lots of equations less awkward if done correctly. I remember finding out this was possible while I was working on an assignment in Latex - it looked amazing. It takes a little bit of work to colour in equations but I hope more people start doing it (including me, I'd forgotten about it for a while)
- tetha 3y agoYeah, I like it. I used this as a tutor in more finicky exercises when it becomes really important to keep 2-3 very similar, but different things apart. It takes a bit of dexterity, but you can switch fluently between 3 different whiteboard markers held in one hand while writing, haha. I am kind of wondering if a semantic highlighting makes sense as well. You often end up with some implicit assignment of lowercase latin, uppercase latin, lowercase greek letters and such for certain meanings. Kinematic - xyzt for position in time, T_i(I_i) for the quaternion or transformation representing a certain joint of a robot.
- rendaw 3y agoPedant-man on the scene: this is just highlighting since the highlighting isn't derived from syntax.
- crazygringo 3y agoWhich makes me wonder what that would look like and would it be helpful? But there's already such complex and varied typography in math I wonder if it would be kind of redundant. E.g. you don't need matching parentheses to be colored when they already come in different sets of matching heights.
- andrewprock 3y agoIt's been around for a long time (centuries?). In most textbooks, you'll get different semantics for italic and bold faces. Modern textbooks with color printing often use color in semantic ways.
- gloryless 3y agoThis kind of intuition is why a high school level statistics or probability class seems so so valuable. I know not everyone will use the math per se, but the concepts apply to everyday life and are really hard to just grasp without having been taught it at some point.
- zodmaner 3y agoThe sad thing is, having a mandatory high school level statistics & probability class alone is not enough, you'll also need a good curriculum and a competent teacher to go along with it. Otherwise, it wouldn't work: a bad curriculum taught badly by a unmotivated or unqualified teacher will almost always fail to teach the intuition, or, even worse, alienates students from the materials.
- alexb_ 3y agoIf you had a gambling game that was simply "heads or tails, even money", you would expect over a Large Number of trials that you would get 0. But once you observe exactly one trial, the expected value because +1 or -1 unit. We know this is always going to happen one way or the other. Why then, does the bell curve of "expected value" for this game not have two peaks, at 1 and -1? Why does it peak at 0 instead? What I'm asking about, I know I'm wrong about - I just want to know how I can derive that for myself.
- ineptech 3y ago"The expected value of a random variable with a finite number of outcomes is a weighted average of all possible outcomes." -- https://en.wikipedia.org/wiki/Expected_value https://en.wikipedia.org/wiki/Expected_value
- alexb_ 3y agoThat makes sense, I was always thinking of it as "Given an infinite number of trials..."
- ineptech 3y agoWhether/when its better to think in terms of "X has a 37% chance of happening in a single trial" vs "If you ran a lot of trials, X would happen in 37% of them" is kind of a fraught topic that I can't say much about, but you might find this interesting: https://en.wikipedia.org/wiki/Probability_interpretations https://en.wikipedia.org/wiki/Probability_interpretations
- tnecniv 3y agoThat would be the frequentist interpretation. A Bayesian would say that probability is to be interpreted in belief that an outcome will occur. Neither is really right or wrong, it depends on what you're modeling. If we’re analyzing some kind of heavily repeated task (e.g., a sordid night of us glued to the blackjack table where we play a lot of hands or data transmission over a noisy cable), a frequentist interpretation might feel more sense. However if you’re talking about the probability of a candidate winning an election, you could take a Bayesian view where the probability asserts a confidence in an outcome. A radical frequentist would take umbrage with an event that only happens once. However, I suppose, depending on your election rules and model (e.g., a direct democracy), you could interpret the election winner in a frequentist manner: the probability of winning is the rate at which people vote for the candidate. For a more complicated system I’m not sure the frequentist view is as easily justified. However to answer your question more directly, the expected value is just another name for the average or mean of a random variable. In this case, the variable is your profit. Assume we’re betting a dollar per toss on coin flips and I win if it’s heads (everyone knows heads always wins, right?). The expected value is probability of heads * 1 - probability of tails * 1. If the coin is fair, the probabilities are the same so the expected value is zero. Aside: sequences of random variables that are “fair bets” are called martingales and are incredibly useful. It’s a fair bet because, given all prior knowledge of the value of the variable thus far, the expected value of the next value you witness is the current value of the variable. You could imagine looking at a history of stock values. Given all that information, it’s a martingale (and thus a fair bet) if given that information your expected profit from investing is 0.
- Dylan16807 3y ago> This means that on average, we’ll need a fifty million times larger sample for the sample average to be as close to the true average as in the case of dice rolls. This is "as close" in an absolute sense, right? If I take into account that the lottery value is 20x larger, and I'm targeting relative accuracy, then I need 2.5 million times as many samples?
- dustypotato 3y agoDidn't make sense to me as well. Maybe it's better to use something along the lines of variance/mean instead?
- causality0 3y agoAm I the only one unreasonably annoyed that his graphs don't match the description of his rolls?
- crdrost 3y agoIf the blog author is reading, some notes for improvement: - Your odds calculation is likely wrong. You assumed from the word "odds" that "odds ratio" was meant, (Odds=3 meaning "odds 3:1 against" corresponding to p=25%) but the phrase is "approximate odds 1 in X" (Odds=3 meaning "odds of 1 in 3 to win" meaning 33%) and recalculating results in the remarkably exact expected value of $80 which seems intentional? - You phrase things in terms of variances, people will think more in terms of standard deviations. So 3.5 ± 1.7 vs $80 ± $12,526. - Note that you try to make a direct comparison between those two but the two are in fact incomparable. The most direct comparison might be to subtract 1 from the die roll and multiply by $32, so that you have a 1/6 chance of winning $0, 1/6 of winning $32, ... 1/6 of winning $160. So then we have $80 ± $55 vs $80 ± $12,526. Then instead of saying you'd need 50 million more lottery tickets you'd actually say you need about 50 thousand more. This is closer to the "right ballpark" where you can tell that the whole lottery is expected to sell about 10,200,000 tickets on a good day. - But where an article like this should really go is, "what are you using the numbers for?". In the case of the Texas lottery this is actually a strong constraint, they have to make sure that they make a "profit" (like, it's not a real profit, it probably goes to schools or something) on most lotteries, so you're actually trying to ensure that 5 sigma or so is less than the bias. So you've got a competition between $20 · n and 5 · $12,526 · √(n), or √(n) = 12526/4, n = 9.8 million. So that's what the Texas Lottery is targeting, right? So then we would calculate that the equivalent number of people that should play in the "roll a die linear lottery" we've constructed is 187, call it an even 200, if 200 people pay $100 for a lottery ticket on the linear lottery then we can pretty much always pay out even on a really bad day. - So the 50,000x number that is actually correct is basically just saying that we can run a much smaller lottery, 50,000 times smaller, with that payoff structure. And there's something nice about phrasing it this way. - To really get "law of large numbers" we should actually probably be looking at how much these distributions deviate from Gaussian, rather than complaining that the Gaussian is too wide? You can account for a wide Gaussian in a number of ways. But probably we want to take the cube root of the 3d cumulant, for example, try to argue when it "vanishes"? Except given the symmetry the 3rd cumulant for the die is probably 0 so you might need to go out to the 4th cumulant for the die -- and this might give a better explanation for the die converging more rapidly in "shape" to the mean, it doesn't just come close faster, it also becomes a Gaussian significantly faster because the payoff structure is symmetric about the mean.
- pid-1 3y agoOne way to gain intuition on why the LLN might work faster, slower or not at all is to write the mean equation in rescursive form (What's the next expected value estimation, given a new sample and the current expected value estimation?).
- blt 3y agoIn learning theory there is focus on "non-asymptotic" results. Instead of only showing that our method converges on the right answer in the limit of infinite data, we must show how fast it converges.
- otabdeveloper4 3y agoAbout three fifty. (No, just joking. Actually 42 plus or minus.)