Law of Large Numbers code