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
| { | |
| "9-1-1 Service and Public Safety Communications": [ | |
| { | |
| "dist": 5, | |
| "name": "Frank Bigelow", | |
| "url": "http://assembly.ca.gov/a5" | |
| }, | |
| { | |
| "dist": 64, | |
| "name": "Isadore Hall, III", |
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
| { | |
| "Agriculture": [ | |
| { | |
| "dist": 5, | |
| "name": "Senator Cathleen Galgiani (Chair)", | |
| "url": "http://senate.ca.gov/sd05" | |
| }, | |
| { | |
| "dist": 12, | |
| "name": "Senator Anthony Cannella (Vice Chair)", |
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
| def bits(n): | |
| b = [] | |
| while n > 0: | |
| b.append(n % 2) | |
| n >>= 1 | |
| return reversed(b) | |
| def montgomery_pow(x, n): | |
| a, b = 1, x | |
| for x in bits(n): |
This file has been truncated, but you can view the full 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
| { | |
| "metadata": { | |
| "name": "" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| { | |
| "metadata": { | |
| "name": "Weighted Reservoir Sampling" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| from math import sqrt | |
| def std_dev_over_mean(n, p): | |
| """ increment a counter by 1/p with probability p, n times. (independently) """ | |
| q = 1 - p | |
| var = n * q / p | |
| return sqrt(var) / n | |
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
| def harmonic_mean(xs): | |
| return 1.0 / sum(1.0 / x for x in xs) | |
| def harmonic_sum(xs): | |
| return len(xs) * harmonic_mean(xs) | |
| def hll_style_composite(xs, alpha): | |
| return alpha * harmonic_sum(2.0**x for x in xs) | |
| # computed the integral suggested in the original hyper log log paper |
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
| { | |
| "metadata": { | |
| "name": "Intro to Probabilistic Counting" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
NewerOlder