Original image

5 Familiar Numbers and the Logic Behind Them

Original image

Given how digital the world has become, we are hardly bothered by having to deal with one string of numbers after the next: credit card numbers, social security numbers, IP addresses and so on. Do these numbers hold any meaning, or are they just random sequences in a database? Read on to find out.

1. Credit Card Numbers

The string of digits that make up credit card numbers have a distinct, if subtle, structure.  The first digit signifies which system it belongs to: 3 is for travel and entertainment cards like American Express, 4 is Visa, 5 is Mastercard, and 6 is Discover.  The rest of the credit card number is used differently by each company -- for Visa cards, digits 2 through 6 are a bank number, 7-12 or 7-15 are the account number, and either 13 or 16 is a check digit, a number that is the result of a  series of simple but generally secret computations with the other digits that helps verify the full number isn't fake.  In an AmEx card, digits three and four indicate the type of card and currency, 5-11 are the account number, 12-14 are the card number within the account and 15 is a check digit (AmEx card numbers are 15 instead of 16 digits).

2. Zip Codes

zipcode1Zip codes were invented by Robert Aurand Moon and by 1963 were widely used by the United States Postal Service. The five-digit number is a code for an exact location, with each successive digit indicating a more specific place. The first digit indicates a group of states; for example, a 1 directs mail to Delaware, New York, and Pennsylvania. The next two indicate a sectional center facility -- a zip code beginning with 108 directs mail to the facility New Rochelle, NY. The last two digits represent a village or town near the facility or a location within a metropolitan area. Typically in a non-metropolitan area a city gets the first area code, and surrounding villages and towns receive zip codes in alphabetical order (for example, Glenmont, NY has 12077 and Gloversville, NY has 12078). And in case you were wondering, ZIP is an acronym that stands for Zone Improvement Plan. 

3. Telephone Numbers

rotaryEveryone's a little more familiar with telephone numbers -- there's country code, necessary if dialing internationally (1 is the United States), and area codes, which indicate a broad geographic area. The next three digits indicate a smaller area, and the last four are a random permutation.  The area code and first three digits of a phone number are referred to in the telephone business as NPA-NXX.  These numbers convey a unit of purchase for telephone companies, as they will generally buy one NPA-NXX, or one combination. The ownership reveals why cell providers are often so tetchy about carrying a number from one to another, or vice versa: you would be stealing a phone number from one company and giving it to another.

4. IP Addresses

tcpip_ip_addressIP addresses, at their most basic level, identify individual computers to the Internet. They are a series of four numbers punctuated by periods that look something like Each of these numbers (such as 255 in the example) is referred to as an octet. Each octet can have a value between 0 and 255 (so if you see an IP address with any octet higher than 255, it's fake). Together the octets of an IP address contain information about the type of network and, to an extent, the location of a computer. The first octet, called the class, tells you the size of a network a computer is in. A Class A network has a first octet between 0 and 127 and can have over 16 million IP addresses; a Class B network has a first octet between 128 and 191 and have about 65,000 addresses; a Class C network, used for most homes, has a first octet of 192-223 and can have 254 addresses. There are also Class D and E networks with first octets of 224-255 that are used for more specialized purposes. Most IP trackers use a location database to determine where an IP address is coming from, so there is not a direct scheme for the other octets. However, due to the modern use of subnetworks within a network, IP addresses are often masked. Therefore, it is no longer directly possible to tell the type of network a computer hails from.

5. Social Security Numbers

sscardSocial Security numbers are nine-digit strings that most Americans are assigned at birth, and are generally used as an identifier as well as a qualifier for various kinds of insurance and income from the government.  The first three numbers tell where the person first applied for the card; if the card was applied for at birth and the mailing address used was also the residential address, the numbers tell the rough location of birth (doesn't apply to babies born during vacation in Panama, but in general this is true).  The next two digits are called the group number, and allow SSNs of the same area number to be broken into smaller groups.  They are assigned in the following order: odd numbers 01-09, evens 10-98, evens 02-08, odds 11-99.  The last four digits, the serial numbers, are assigned consecutively 0001-9999.

Original image
iStock // Ekaterina Minaeva
Man Buys Two Metric Tons of LEGO Bricks; Sorts Them Via Machine Learning
May 21, 2017
Original image
iStock // Ekaterina Minaeva

Jacques Mattheij made a small, but awesome, mistake. He went on eBay one evening and bid on a bunch of bulk LEGO brick auctions, then went to sleep. Upon waking, he discovered that he was the high bidder on many, and was now the proud owner of two tons of LEGO bricks. (This is about 4400 pounds.) He wrote, "[L]esson 1: if you win almost all bids you are bidding too high."

Mattheij had noticed that bulk, unsorted bricks sell for something like €10/kilogram, whereas sets are roughly €40/kg and rare parts go for up to €100/kg. Much of the value of the bricks is in their sorting. If he could reduce the entropy of these bins of unsorted bricks, he could make a tidy profit. While many people do this work by hand, the problem is enormous—just the kind of challenge for a computer. Mattheij writes:

There are 38000+ shapes and there are 100+ possible shades of color (you can roughly tell how old someone is by asking them what lego colors they remember from their youth).

In the following months, Mattheij built a proof-of-concept sorting system using, of course, LEGO. He broke the problem down into a series of sub-problems (including "feeding LEGO reliably from a hopper is surprisingly hard," one of those facts of nature that will stymie even the best system design). After tinkering with the prototype at length, he expanded the system to a surprisingly complex system of conveyer belts (powered by a home treadmill), various pieces of cabinetry, and "copious quantities of crazy glue."

Here's a video showing the current system running at low speed:

The key part of the system was running the bricks past a camera paired with a computer running a neural net-based image classifier. That allows the computer (when sufficiently trained on brick images) to recognize bricks and thus categorize them by color, shape, or other parameters. Remember that as bricks pass by, they can be in any orientation, can be dirty, can even be stuck to other pieces. So having a flexible software system is key to recognizing—in a fraction of a second—what a given brick is, in order to sort it out. When a match is found, a jet of compressed air pops the piece off the conveyer belt and into a waiting bin.

After much experimentation, Mattheij rewrote the software (several times in fact) to accomplish a variety of basic tasks. At its core, the system takes images from a webcam and feeds them to a neural network to do the classification. Of course, the neural net needs to be "trained" by showing it lots of images, and telling it what those images represent. Mattheij's breakthrough was allowing the machine to effectively train itself, with guidance: Running pieces through allows the system to take its own photos, make a guess, and build on that guess. As long as Mattheij corrects the incorrect guesses, he ends up with a decent (and self-reinforcing) corpus of training data. As the machine continues running, it can rack up more training, allowing it to recognize a broad variety of pieces on the fly.

Here's another video, focusing on how the pieces move on conveyer belts (running at slow speed so puny humans can follow). You can also see the air jets in action:

In an email interview, Mattheij told Mental Floss that the system currently sorts LEGO bricks into more than 50 categories. It can also be run in a color-sorting mode to bin the parts across 12 color groups. (Thus at present you'd likely do a two-pass sort on the bricks: once for shape, then a separate pass for color.) He continues to refine the system, with a focus on making its recognition abilities faster. At some point down the line, he plans to make the software portion open source. You're on your own as far as building conveyer belts, bins, and so forth.

Check out Mattheij's writeup in two parts for more information. It starts with an overview of the story, followed up with a deep dive on the software. He's also tweeting about the project (among other things). And if you look around a bit, you'll find bulk LEGO brick auctions online—it's definitely a thing!

Original image
Scientists Think They Know How Whales Got So Big
May 24, 2017
Original image

It can be difficult to understand how enormous the blue whale—the largest animal to ever exist—really is. The mammal can measure up to 105 feet long, have a tongue that can weigh as much as an elephant, and have a massive, golf cart–sized heart powering a 200-ton frame. But while the blue whale might currently be the Andre the Giant of the sea, it wasn’t always so imposing.

For the majority of the 30 million years that baleen whales (the blue whale is one) have occupied the Earth, the mammals usually topped off at roughly 30 feet in length. It wasn’t until about 3 million years ago that the clade of whales experienced an evolutionary growth spurt, tripling in size. And scientists haven’t had any concrete idea why, Wired reports.

A study published in the journal Proceedings of the Royal Society B might help change that. Researchers examined fossil records and studied phylogenetic models (evolutionary relationships) among baleen whales, and found some evidence that climate change may have been the catalyst for turning the large animals into behemoths.

As the ice ages wore on and oceans were receiving nutrient-rich runoff, the whales encountered an increasing number of krill—the small, shrimp-like creatures that provided a food source—resulting from upwelling waters. The more they ate, the more they grew, and their bodies adapted over time. Their mouths grew larger and their fat stores increased, helping them to fuel longer migrations to additional food-enriched areas. Today blue whales eat up to four tons of krill every day.

If climate change set the ancestors of the blue whale on the path to its enormous size today, the study invites the question of what it might do to them in the future. Changes in ocean currents or temperature could alter the amount of available nutrients to whales, cutting off their food supply. With demand for whale oil in the 1900s having already dented their numbers, scientists are hoping that further shifts in their oceanic ecosystem won’t relegate them to history.

[h/t Wired]