for June

Jun. 7th, 2013 10:51 pm
corvi: (Default)
Back to tinkering with simulated snowflake growth. This time I am using Game-of-Life type growth rules. Next up is to write a more complicated set of rules that will shift with simulated temperature and humidity.

Something about summer makes me want to tinker with fake snow. :)

corvi: (Default)
I have a boring tumblr account where I keep track when we worm the goats and how long the bees hibernate and that kind of stuff, plus a daily picture taken while I am out doing chores from the nice point and shoot camera [personal profile] juli  got me, because I do a better job actually having the motivation to keep records when I am convinced someone else might see it somehow. :) 

I was curious if there were seasonal color patterns in the daily pictures - more grey in winter, flower colors in spring, etc - so I wrote a Processing sketch that downloaded a year's worth of pictures and extract colors from them and put them in a circle.

Winter = right, fall = down, summer = left, spring = up, each radial line is a day.

So the answer is ... not really. I basically post pictures of grey things and green things no matter what time of year it is. Probably living somewhere with actual seasons would help.

So now I have this script, I thought I would hit a couple other people's picture-happy tumblr accounts and see what it looked like.

[personal profile] juli 's last year of images:

A tumblr devoted to exploring (dark) abandoned buildings:

The National Archives official tumblr, lots of old yellow paper and black and white photos.

A tumblr about cheese:

Haven't been able to find a tumblr with a good seasonal color variation, though, which was the whole point.
corvi: (Default)

[personal profile] juli and I have been talking about Faro or Pharaoh Shuffles, which is a common shuffling technique for card games or magic tricks. It goes like this: 


  1. Divide the 52-card deck into two half-decks of 26 cards, deck A and deck B.
  2. Merge the two half-decks together so that cards alternate, one from half-deck A, one from half-deck B, but the individual half-decks stay in order.


So if your deck starts out numbered like this:


1,   2,   3,   4,   5,   6,   7,   8 … 49,   50,   51,   52


You divide it into two decks, 1-26, and 27-52, and then merge them together like this:


1,   27,   2,   28,   3,   29,   4,   30, … 25,   51,   26,   52.


If you do this perfectly eight times with a deck of 52 cards, you will get back to the original order. I had trouble believing that, so we sat in a diner and carefully shuffled cards. Six cards return to their original positions after four shuffles. Eight cards take three, twelve takes ten shuffles and three restarts after losing my place.


Of course we both announced we would write a script when we got home, but Juli got hers done first. Go look at it here.


A graph of how many perfect faro shuffles it takes to bring a deck of N cards back into its original order:

bar graph of how many perfect faro shuffles are required to get a deck of X cards back to its original order

And here is an image of the patterns formed by shuffling 52 cards. Each horizontal line is the deck before or after shuffling, and each rectangle is a card. Black is card #1, red is card #52.

Grid image of the positions of 52 cards over the course of 8 perfect faro shuffles.

What about some other sized decks of cards? Decks that contain a power of two cards return to their original state in log-2 shuffles. Here are the patterns for decks of 16 (4 shuffles), 32 (5 shuffles), 64(6 shuffles), and 128(7 shuffles) cards:

shuffling 16 cards shuffling 32 cards shuffling 64 cards shuffling 128 cards



Decks with two more cards than a power of two take twice as many shuffles as the power of two. First the shuffling arranges every card in the deck except the first and last (which never move) in reverse order, then it turns them around again. Here are 18(8 shuffles), 34(10 shuffles), and 66 cards (12 shuffles) card decks:

shuffling eighteen cards shuffling 34 cards shuffling 66 cards



The slowest decks take two less shuffles than they have cards. Here's 84 (82 shuffles required to return to original state), which does include a "reversed-except-for-the-outside" state, but I don't know how to characterize any of the rest of it.
shuffling 84 cards


There is some discussion of the math here, but I wish it went into more detail.


corvi: (Default)

April 2017



RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 28th, 2017 10:31 am
Powered by Dreamwidth Studios