Suppose that you have a pool of n
different types of coupons (one of each) and
want to sample k
coupons with replacement. What is the distribution of the
random variable X
, which counts the number of distinct coupons observed with
each k
-sized sample? I was unable to come up with a closed-form solution on my
own, instead resorting to simulation and brute force. This captures a solution
I was able to find by searching online and putting the pieces together. I've
written the equations below in approximate Wolfram language syntax, since math
typesetting is not available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
function main() { | |
local input="$1" | |
local output="$2" | |
local timestamp="$3" | |
if [[ "$input" == "$output" ]] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Update video timestamps to match timestamp metadata in associated JSON files. | |
import asyncio | |
import datetime | |
import json | |
import os | |
import os.path | |
import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
readonly TIME_ZONE="${TIME_ZONE:-America/Los_Angeles}" | |
function main() { | |
local file="$1" | |
local timestamp | |
timestamp="$(extract_timestamp "$file")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import asyncio | |
import concurrent.futures | |
import functools | |
import time | |
import typing | |
import aiohttp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import asyncio | |
import os | |
import sys | |
async def main(): | |
parser = argparse.ArgumentParser("Createa a child process") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Exact anagram finder. We start with a target name ("vilepechora") and consider | |
# all two-name exact anagrams of this target. Specifically, we do not consider | |
# anagrams of subsets of the original character set. We consider first and last | |
# names as different types to narrow the search space (there are 1712 matches if | |
# you consider first and last names to be interchangeable). There are "only" 582 | |
# matches by considering first and last names separately (based on which dataset | |
# they're found in). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
county | od_deaths | population | |
---|---|---|---|
okanogan | 16 | 42634 | |
yakima | 96 | 256035 | |
grays_harbor | 43 | 76841 | |
clallam | 38 | 78209 | |
mason | 30 | 67615 | |
king_county | 649 | 2.252e6 |