Data Pointed http://www.datapointed.net Visualization, Statistics, and Art Thu, 16 Feb 2012 04:28:55 +0000 en hourly 1 http://wordpress.org/?v=3.0 Raining A Deficit http://www.datapointed.net/2012/02/san-francisco-rain-year-before-after-valentines-day/ Thu, 16 Feb 2012 04:20:22 +0000 Stephen Von Worley http://www.datapointed.net/?p=3952 Is California headed into a drought? Should we expect a tardy parade of storms – the mythical March Miracle – to bury the Sierra and refill our reservoirs? Or will high pressure lock down the North Pacific, nudge the jet stream towards Alaska for good, and doom us to eight more months of summer?

When it comes to weather, past performance is often indicative of future results, so I charted the last fifty years of rainfall in downtown San Francisco:

San Francisco Rainfall

That’s a line per rain year – the period running from July 1st through the following June, centered on California’s wet winter months – with a circle for each day sized by the amount of precipitation. The bars show the total rainfall received on either side of Valentine’s Day for each year. To enhance readability, smaller amounts are tinted “dead grass” brown and larger amounts “pooling water” blue. The data comes from meteorologist Jan Null’s Golden Gate Weather site, with updates from the NWS monthly summaries.

On average, downtown San Francisco gets about 22.0 inches of annual rainfall: roughly two thirds (14.8″) on or before February 14th and the remainder (7.2″) after. This season thus far, the City has received 6.8 inches, about 46% of normal for the date, ranking as the third driest pre-Valentine’s period on record since 1960, behind 1975-76 and 1990-91.

As for our March Miracle? Check the chart, and you’ll find that the years which finished wettest share one thing in common: none started out unusually dry. Furthermore, the ten seasons with the driest beginnings averaged 8.1 inches before V-Day and a paltry 5.2 inches after, which suggests that when the last raindrop falls, the 2011-12 rain year will clock in at around half of normal.

“Don’t call a drought!” implore my skis and lawn. And perhaps rightfully so. At any moment, Mother Nature could deliver a duck-drowning deluge of Noachian proportions. However, the numbers suggest the opposite scenario, wherein the coastal Californian might be wise to toodle over to the local Home Despot and get one of them new fangled home desalination units – while the gettin’s good!

]]>
Where The 0.05% Live http://www.datapointed.net/2012/01/maps-of-sparsely-populated-us-census-blocks/ Tue, 17 Jan 2012 14:55:27 +0000 Stephen Von Worley http://www.datapointed.net/?p=3872 A public service announcement from the rural parts of America:

Hello there, friend. I’m the country. Chances are, within the past week or three, you flew over or motored right through me. And that’s okay, of course – life’s hectic, and it’s a long way from here to there. But I miss you.

So, please, come and visit. Upon arrival, you can do whatever you want. Relax, discover yourself, commune with nature, spot a UFO, fire large caliber weapons… I won’t judge.

Getting here is an easy two-step process. First, figure out where everyone else is. Then, head in the other direction:

The Mostly Uninhabited United States

That’s me in black: every U.S. 2010 Census block with less than one resident per square mile. I freckle the East, define the West, and blanket icy Alaska almost in its entirety:

Mostly Uninhabited Alaska

Perhaps grizzlies and tundra aren’t your thing? Bask in the warmth of my untrammeled Hawaiian shores:

Mostly Uninhabited Hawaii

Of the eight main islands, Lānaʻi is for lovers of peace and solitude. Unless you prefer to tiptoe through the UXO.

All in all, stateside, just under 155,000 people live in my 2,120,000 square miles: 0.05% of the total U.S. population spread across 60% of the land. In other words, when you visit, you’ll have plenty of room to stretch, pitch a tent, and build a campfire. Or bang on the bongos, strip naked, and prance around like an antelope. Whatever makes you happy.

Looking forward to seeing you soon!

The Country

]]>
Rank Candidates, Pie Edition http://www.datapointed.net/2011/11/san-francisco-mayoral-ranked-choice-election-pie-edition/ Wed, 30 Nov 2011 05:11:42 +0000 Stephen Von Worley http://www.datapointed.net/?p=3816 Now, to accentuate the late round action, a few circular variations of our San Francisco 2011 mayoral election ranked choice voting visualizations.

Warning! Warning! Warning! The following experimental images resemble pie graphs! If you’re a Chart Nazi and find them offensive, leave this page immediately. And go chase a unicorn. Tease a kitten. Whatever floats your boat. But please, no negative vibing in this direction. M’kay?

In these charts, ranked choice ballot trajectories radiate from the center, first round inside to last round out. Angular width represents the fraction of the overall vote, like a pie graph. An additional 1,900 votes have straggled in since we created the originals, causing Hall and Alioto-Pier’s exits to flip-flop and the color scheme to change slightly.

First, let’s view all ballots with a valid #1 choice other than mayor-elect Ed Lee or runner-up John Avalos, grouped by initial preference:

Ranked Choice Vote Trajectories

Next, the same non-Lee/Avalos first choice ballots, grouped by final result:

Ranked Choice Vote Trajectories

Finally, the 27% of all ballots cast, free of Lee or Avalos in any spot, which became exhausted:

Ranked Choice Vote Trajectories

Tom Petty was right! In a 16-candidate election, the wasting is the hardest part.

And that’s all I have to say about that.

]]>
Rank Candidates http://www.datapointed.net/2011/11/san-francisco-mayoral-ranked-choice-election/ Fri, 18 Nov 2011 18:10:40 +0000 Stephen Von Worley http://www.datapointed.net/?p=3761 Inspiration comes in many forms, and most recently, as the following carrot, dangled in front of my face by fellow blogger Burrito Justice:

San Francisco Mayoral Election Results Table

My my, San Francisco Department of Elections, what a big table you have. Because the whole circus – sixteen (16!) people – decided to run for mayor this year, and the City uses the system known as ranked choice voting.

For those unfamiliar, here’s how ranked choice voting works. Go to a polling place, grab a ballot, and mark your favorite candidates in order of preference, one, two, three. First choice is Abraham Lincoln, of course. Second choice, Betsy Ross. Third choice, Winston Churchill. San Francisco elections are pick three, so you’re done. Bask in the warm glow of civic duty.

But don’t bask long, because it’s time to tabulate! Add up the first choice votes. A majority wins, but otherwise, determine the least popular candidate (*), eliminate them, and give their votes to the next remaining choice on the supporting ballots. Repeat the process until finished.

In our hypothetical four-way election, suppose the first choices break out 40% Ross, 36% Lincoln, 18% Churchill, and 6% Gandhi. Gandhi is lowest, so he’s eliminated, and his supporters’ second choices split between Lincoln and Churchill. So, going into Round 2, we have 40% Ross, 39% Lincoln, and 21% Churchill. Churchill loses, and per next choices, two thirds of his votes go to Lincoln, and the rest to Ross. Honest Abe wins with a 53% majority.

Now, ramp that up to 16-candidate Frisco, and you get the tabular thicket of numbers pictured above.

In the interest of clarity, Burrito Justice tweeted:

Thanks! Hey @datapointed, time to apply the crayola chart methodology! RT @McClure_SF: @burritojustice http://www.sfelections.org/results/20111108/data/mayor.html via @kevinmonty

Great idea! Then, I whipped up a few drafts which didn’t go anywhere, and, at that point, I shoulda stopped. But Señor Justice had me hooked…

So, using the official San Francisco mayoral election data (as of November 17th), we calculated the trajectory of each ballot: the sequence of candidates that it counted towards in each round of the tabulation process. Next, we eliminated the trajectories for ballots with no valid choice. Then, we rendered each as a fixed-thickness horizontal line, colored by candidate, first round left to last round right. Finally, we stacked them to create a chart where the vertical axis represents the overall fraction of the voting pool.

Here are the trajectories, sorted most common first:

Vote Trajectories, Most Common First

At the top, we see the purple and medium blue of winner Ed Lee and runner-up John Avalos. A first choice of either of those two counted for them all the way through. Next is the bright cyan of Dennis Herrera, dark blue for David Chiu, cream for Leland Yee, and so on. To decode the colors, click through to the large version, which has labels for the major candidates.

The same trajectories, grouped by first choice:

Vote Trajectories, Grouped By First Choice

The bars along the left side show the initial preference by candidate. And… Newsflash! San Francisco isn’t completely colorblind; note the flow of votes along ethnic channels, especially from Herrera to Avalos and Chiu to Lee.

And to wrap it up, let’s sort by final result:

Vote Trajectories, Grouped By Final Result

To the right, we see Lee over Avalos, and large slug of dark gray, representing the trajectories which had no choices left in the race. These exhausted ballots – 27% of the total cast – ended up not counting. That being said, in a sixteen candidate torture test, ranked choice voting trounces the traditional plurality system, which would have degenerated into a government-sponsored festival of wasted votes.

Nevertheless, the “27% exhausted” figure bothers me, so I have to ask:

Is there a fairer way to deal with the insane variety of San Francisco politics? A ranked choice primary to narrow the field, followed by a ranked choice runoff?

Let’s take a vote.

Footnote: (*) Technically, in San Francisco, in each tabulation round, the most popular candidate who has more votes than the total for all less popular candidates is determined, and the votes of these less popular candidates are redistributed simultaneously. Typically, one candidate’s votes are redistributed in each round, except in Round 4 of this election, in which four candidates votes were redistributed.

]]>
Viz The Seasons http://www.datapointed.net/2011/11/history-of-the-sky-ken-murphy/ Wed, 16 Nov 2011 15:12:30 +0000 Stephen Von Worley http://www.datapointed.net/?p=3738

Watch daylight ebb and flow, fog linger and break, and storms bluster and clear in Ken Murphy’s wonderful A History Of The Sky: a calendar-style time-lapse chronicle of the heavens above San Francisco. Learn more from his site, and be sure to immerse yourself in the HD version of his latest full-year video (above).

[A History Of The Sky]

]]>
One To Many To One http://www.datapointed.net/2011/11/darpa-shredder-challenge/ Wed, 02 Nov 2011 17:09:41 +0000 Stephen Von Worley http://www.datapointed.net/?p=3624 DARPA Shredder Challenge

Rarely is something so squarely up my alley as DARPA’s Shredder Challenge. Simply download five shredded documents, reassemble the puzzles within, submit your answers, and claim a share of the $50,000 prize.

And sure, the Challenge’s sponsor – a research arm of the military-industrial complex – can use the resulting insights to pry into your sensitive affairs. But, ultimately, improved document destruction technologies will trickle down to the people, and privacy wins. So, register as a participant, grab the pieces, and totally unshred, dude!

]]>
Playing The Probabilities http://www.datapointed.net/2011/10/blackjack-shuffle-riffle-strip-ace-tracking/ Wed, 26 Oct 2011 07:04:04 +0000 Stephen Von Worley http://www.datapointed.net/?p=3568 Daddy needs a new pair of shoes. So, it’s off to Vegas… to win, baby! There, I’ll saunter up to a “twenty one” table, exchange a few hundred for chips, and pit my blackjack fu against the casino.

For the aspiring long-term winner – aka the advantage player – it goes something like this. First you memorize Basic Strategy: whether to hit, split, double down, or stand, based solely upon the value of your hand and the dealer’s upcard. Hit sixteen versus seven. Always split aces, never fives. Double ten against nine or less. And so on. In a single deck game, well-executed basic strategy brings you neck-and-neck with the house, advantage-wise.

Then, as seen in the movies, you learn to count cards. Statistically, a blackjack player wins the most money when the deck contains more high cards than low. And thus, the Hi-Lo system, which assigns -1 to tens, jacks, queens, kings, and aces and +1 to sixes and under. Start the count at zero after each shuffle. Add the Hi-Lo value for each card as it comes out. Bet larger amounts as the count goes positive, and the minimum otherwise. Practice ’til it’s automatic. And voilà, you’ve become a bona fide card counter, operating at one-percent advantage, ready to bring down the house at your earliest convenience.

Except for one gotcha: the casinos are wise to your action. The dealers and pit crew can count too and, by Nevada law, eject anyone for any reason. If they suspect you’ve got skills, expect to be tapped on the shoulder, escorted to the door, and launched through it.

So, as a countermeasure, you cultivate your cover. Should you look like some Silicon Valley automaton, surveiling the table and stacking chips to the count? No, probably not. A drunken rube? Flush with bravado and short on sense? Pissing away his inheritance? Yes yes yes!

Enter the shuffle, which, in an ideal world, takes an ordered deck (top) and completely scrambles it (bottom):

Perfect Shuffle Diagram

The colored blocks represent cards, and lines between decks show their trajectories. At the top and bottom, curves link cards that appeared back-to-back in the unshuffled deck – thin before to thick after.

Mathematicians say that it takes at least seven riffles – the two-stack interleave most people call a “shuffle” – to randomize a deck. However, while the dealer fiddles with the cards, the casino doesn’t make money, so to maximize the take, corners get cut.

From Cal-Reno blackjack trips of yore, I recall the very popular RRSR shuffle: two riffles, a strip (a series of running cuts), and riffle. Let’s simulate it with Epstein’s card interleave odds:

RRSR Shuffle Diagram

At first glance, it looks scrambled. However, in the curves along the bottom, we see a disproportionate number of short links deeper into the deck: pre-shuffle neighbors, still in the same relative order, now spread apart by seven cards, plus or minus a few. By golly, what we’ve got here is a failure to decorrelate.

Now, suppose we’re watching the discard pile, and the Jack of Diamonds goes in on top of the Queen of Hearts. After the next RRSR shuffle, when the Jack of Diamonds makes an appearance, there’s a good chance that the Queen of Hearts will soon follow. And therein lies the opportunity: to track clumps, predict aces, and engage in other profitable but presumably-pointless plays that soothe the looming pit boss as they fly under his radar.

So, hi ho, it’s off to scout casinos I go.

Note that my intended antics are 100% legal and completely Kosher, based solely upon what’s visible on the table. No monkey business like marking cards, bribing the dealer, toe-actuated in-shoe computers, etc. There will, however, be lots of free drinks and color commentary.

More details after I gross the first $1,000,000 – or get dragged off to the boiler room, cuffed to a pipe, and knocked sloppy. Whichever comes first!

]]>
My God, It’s Full Of Blocks http://www.datapointed.net/2011/10/us-population-density-and-google-maps-tiles/ Mon, 03 Oct 2011 16:20:08 +0000 Stephen Von Worley http://www.datapointed.net/?p=3397 Here’s a “behind the scenes” image that might strike you as interesting, eye candy, or perhaps both, depending upon your particular inclination and intimate knowledge of online map tiles:

U.S Map Tiles With 1,000+ Residents

That’s the contiguous United States, colored at each point by the zoom level of the smallest enclosing Google Maps tile wherein 1,000 or more people live, according to 2010 block-level Census data. Periwinkle represents zoom level 14+, navy blue 13, yellow 12, dark green 11, and so on.

The über-geek backstory? Last Friday, I told my Data Elves to get slippy – and create interactive Map X, featuring our own custom imagery, zoomable from continental down to “city core” scale, five-or-so miles across the browser window.

Eager to scope the project, the Elves grabbed an envelope, flipped it over, and made some calculations. We’d be rendering down to Google’s zoom level 14, and to cover the entire world, how many map tiles would we need to create? 357,000,000… each a 256×256 pixel image. The room buzzed with squeaky chatter about the “cloud” and FedEx-ing hard drives.

“Wait a sec,” I said, “Map X is U.S. only.” A mere 10,000,000 tiles would fill the bounding boxes of the Lower 48, Alaska, and Hawaii. Which certainly was a more manageable number, but still enough to make my compute farm sweat.

Could we do better? Yes!

Because, for the subject matter of Map X, detail correlates with population, and we could focus on the places where people live. Thus directed, the Elves mashed Census data with tile geography, applied the 1,000+ “interestingness” criteria, and the above image was born.

My team selected the old-school color scheme to maximize contrast whilst maintaining some semblance of readability. According to them, if it dredges up any repressed 8-bit feelings – like the urge to snipe an Atari 2600 off Ebay – that’s not a bug. It’s a feature.

Finally, the Elves added some padding – five tiles horizontally and four vertically – for the sake of context and to prevent solitary areas of interest from being marooned in “no imagery available at this zoom level”:

U.S. Map Tiles With 1,000+ Residents, Padded

This scheme renders everything near urban areas in full detail, while displaying the most desolate pockets of the American West at enough magnification to keep 99.44% of the three people who look out there happy. Total number of tiles: a cool 1,000,000.

The takeaway? Those crafty Elves pruned the naïve Map X render by a factor of ten, earning them their quarterly bonus: seven nights on Maui, all expenses paid. Aloha, little buddies!

]]>
British Isles And Golden Arches http://www.datapointed.net/2011/09/distance-to-mcdonalds-uk-ireland-mapped/ Wed, 14 Sep 2011 16:56:10 +0000 Stephen Von Worley http://www.datapointed.net/?p=3371 My inbox hums with feedback: warm fuzzies, media inquiries, cold pricklies, and scads of similar requests from across the pond that read something like this:

Bloody when will we see a McDistance map for the UK, you dodgy punter?

Apparently, British folk want to keep tabs on the local McDonald’s. Are they drawn by ancestral kin blood to Ronald? Burnt-out on the curry and crumpets? Or simply trying to evade the crushing tire treads of American McCulture?

Whatever the reason, for many months, I’ve wanted to help, but I didn’t have the necessary information… until now.

For the kind souls at AggData have granted me access to their geolocated database of all 1,100+ United Kingdom Maccy D’s restaurants, and bolstered with a quick scrape of McIreland, I humbly present the British Isles as visualized by the distance to the nearest McDonald’s:

Distance To McDonald's, UK and Ireland

By my calculations, to reach the McFarthest Spot in the United Kingdom – the place most distant from Maccy D’s, minus outlying or disputed territories, as the crow flies – one must sail polewards through heaving swells to the Shetland Islands. There, at the northern tip of the archipelago, uninhabited Out Stack punctuates the Atlantic, 379 kilometers from the nearest McDonald’s at Peterhead, Scotland.

And, on the isle of Great Britain, proper – anywhere reachable from London on foot, aka the mainland – Cape Wrath ranks McFarthest. From its restless shores to the nearest McFix, the hungry traveller must traverse the Scottish Highlands to Inverness, 136 kilometers inland.

Anyways, enjoy the map, my tea-quaffing lovelies. Cheerio!

Attention, Yanks! Read all about the McFarthest Spot in the contiguous United States here, here, and here.

]]>
Storing Your Value http://www.datapointed.net/2011/07/storing-your-value-burying-your-wealth/ Tue, 26 Jul 2011 15:53:04 +0000 Stephen Von Worley http://www.datapointed.net/?p=3304 Editor’s Note: In October 2009, I wrote the first version of this post, shortly after the stock market bottomed in the wake of the Financial Crisis. The economy has since righted itself, but now, while the band in Washington bickers about what song to play, we steam uncaptained towards the icebergs. To help in the event of a second crash, I present the original below, with light edits and updates for 2011.

Hundred Dollar Bills

Suppose that you snapped. It might have been the blood-red 401k statement that arrived in yesterday’s mail. Or that last year, you paid your broker $10,000 to lose $100,000. Or, perhaps, that while everyone else, by government largesse, refinanced houses, replaced clunkers, and recouped bad investments, you received nothing! Except a letter from the tax man.

So you went online, made a few phone calls, and faxed your John Hancock here and there. And, lickety split, there’s a pile of $100 bills in the middle of the living room floor. You cashed out. Now, what to do next?

You considered going big: the Insane Vegas Weekend, purchasing a yacht, giving it all to charity, etc. However, that’s not you – it’d be best to keep a few bucks around to cover your obligations and save the rest for a rainy day.

Which means that your slug of cash needs a safe, secure hiding place. You could squirrel it away in the house: beneath the floorboards, inside a wall, or under a mattress. But them thieves done seen all the TV crime dramas, and they know the usual stashes. Besides, if your humble abode burns to the ground, your nest egg goes up in smoke, too. Major bummer!

For the ultimate in cash protection, we look to the masters of liquid wealth, the venerable Pirates. A quick consult with Parakeet Pete yields the following solution:

Arrrr, bury your booty in a hole, matey!

Which sounds like a fine idea, but there’s one very important, unexplained detail: What to bury, exactly? The $100 bills? Their equivalent in silver? Gold? Or something else? What is the best store of value?

To help you determine the answer, I’ve created a table that details some of the most likely materials, including the price per pound, the quantity that’s worth $1,000,000, what to bury it in, and the pros and cons of each:

Stuff That You Might Put In Your Hole

Material Value Per Pound Size Of $1,000,000 Bury In Pros Cons
Wheat $0.14 120,000
bushels
subterranean silo never hungry bulky, mildew, mice, locusts
Moonshine $0.16 130,000
7gal stills
corked clay jugs many lovely banjo solos blindness
Gasoline $0.58 270,000
gallons
underground tank Peak Oil, baby! fumes, third degree burns
Ammo $2.10 525,000
shells
surplus ammo cans gun owners need you you need owners with matching gun
Vodka $7.80 1,800,000
shots
Russian-proof bear boxes the Bloody Mary requires V8 and Worcestershire
Jerky $18 27 tons duct-taped lawn bags infinite lifespan everything stinks like jerky
Cigarettes $57 7 pallets basement of abandoned 7-11 captive market nicotine stains
Guns $60 2,500
shotguns
water-tight firearm lockers reinforces Alpha Dog image ATF raids, terrorism indictment
Silver $580 1,700
pounds
rolling plastic totes Werewolves begone! not Gold
Caviar $2,400 1,100
servings
Arctic tundra endear yourself to power elite must ice or eat within 3 hours
CPUs $6,000 4,000
chips
sealed anti-static tray light weight, inert, brainy loses half of value every two years
Cocaine $9,000 50 kilos legs of faux llama keepsakes world-wide demand unstable customers, Scarface
Gold $22,500 200 bars,
100g each
treasure chest time-tested currency metal detectors, confiscation
$100 Bills $45,000 43″ stack mason jars backed by U.S. Government worthless beyond Thunderdome
Diamonds $175,000 black velvet
pouchfull
vault with lasers and trip wires profit, intrigue, girl’s best friend low utility, De Beers assassins
Plutonium $2,000,000 1.3 inch
sphere
argon-filled, lead-lined bunker ultra-compact CIA, critical mass, death by inhalation

ObDisclaimer: I am not a financial advisor, and this is not financial advice. All prices approximately USD as of July 15, 2011. Burying your life savings in a hole may incur risks, including, but not limited to, mold, worms, plunderers, and loss of map and/or principal. Underground balance is not FDIC-insured.

Hope that helps!

]]>