Daniel Lemire's blog

Science and Technology links (March 30th, 2018)

, 3 min read

People who score higher on intelligence tests tend to have larger brains. Twin studies suggest the same genetic factors influence both brain size and intelligence. The effects of campaign contact and advertising on Americans’ candidates choices in general elections is zero. A related fact: in…

Should you cache hash values even for trivial classes?

, 2 min read

Hash tables are a fundamental data structure in computing, used to implement maps and sets. In software, we use hash values to determine where objects are located within hash tables. In my previous blog post, I showed that the bulk of the running time when checking values in a hash table could be…

When accessing hash tables, how much time is spent computing the hash functions?

, 2 min read

Suppose that you create a large set of objects that you store in a hash table. Let us take 10 million objects. It is large enough that it probably will not fit in the cache memory of your processor. Let us keep the objects simple… say they are lists of three integers. In Java, it looks like…

Science and Technology links (March 23rd, 2018)

, 2 min read

Sending your kids to highly selective schools is maybe less useful than you think: “However, once we controlled for factors involved in pupil selection, (…) the variance in exam scores at age 16 explained by school type dropped from 7% to <1%.” Ugly people are more likely to be great…

Science and Technology links (March 16th, 2018)

, 3 min read

From the beginning of the 20th century to 2010, the life expectancy at birth for females in the United States increased by more than 32 years. The 3 major causes of death for females in 1900 were pneumonia and influenza, tuberculosis, and enteritis and diarrhea. In 2010, the 3 major causes were…

Iterating over hash sets quickly in Java

, 2 min read

There are many ways in software to represent a set. The most common approach is to use a hash table. We define a “hash function” that takes as an input our elements and produces as an output an integer that “looks random”. Then your element is stored at the location indicated by the value…

Science and Technology links (March 9th, 2018)

, 2 min read

The Audi A8, which goes on sale this year, will be the first car to offer Level 3 autonomy, which means that as a driver, you are expected to be able to relinquish control of the car to the computer in most instances. Standard tests do predict how well you will do in college with reasonable…

Iterating over set bits quickly (SIMD edition)

, 3 min read

Suppose that you have a long sequence of bits 10101011100000… you want to visit all the bits set to 1. That is, given 10101011100000, you would like to get the indexes of all the bits set to one: 0,2,4,6,7,8,9. In a recent blog post, I reviewed fast techniques to iterate over the position of the…

Science and Technology links (March 2nd, 2018)

, 3 min read

Flashing lights might cure Alzheimer’s, according to Nature. There is no paradox: being obese is definitively bad for you. Class attendance predicts success in college. Barbara Streisan had her dog cloned, more than once. Contrary to what we have been told: stopping or reducing dietary fiber…

Vectorized shifts: are immediates faster?

, 3 min read

Our processors are all equipped with vector instructions also called SIMD (single instruction multiple data). One common instruction is the “shift”. Roughly speaking, a shift is either a multiplication by a power of two or a division by a power of two, when considering the data as unsigned…

Science and Technology links (February 24th, 2018)

, 2 min read

Samsung is manufacturing and will sell 30TB hard drives. That’s huge. It is enough to record everything you see and hear for three years.- Of the cases of early-onset dementia, most were either alcohol-related or had an additional diagnosis of alcohol use disorders. Amazon’s CEO is funding a…

Iterating over set bits quickly

, 2 min read

A common problem in my line of work is to iterate over the set bits (bits having value 1) in a large array. My standard approach involves a “counting trailing zeroes” function. Given an integer, this function counts how many consecutive bits are zero starting from the less significant bits. Any…

Science and Technology links (February 16th, 2018)

, 1 min read

In all countries, in all years–without exception–girls did better than boys in academic performance (PISA) tests. Vinod Khosla said: There are, perhaps, a few hundred sensors in the typical car and none in the body. A single ad shown to you on Facebook has way more computing power…

Science and Technology links (February 9th, 2018)

, 2 min read

We shed 50 million skin cells every day. A mutant crayfish reproduces by cloning. To my knowledge, this might be the largest animal to reproduce by cloning. Before about 25 years ago, the species simply did not exist (…) it has spread across much of Europe and gained a toehold on other…

Don´t underestimate the nerds

, 3 min read

I’m a little nerdy. According to my wife, I even look like a nerd. I am not very big. I have a long resume posted online, and I’ll proudly post my follower count, but if you meet me in person, I am unlikely to come across as “impressive”. I don’t talk using “big words”. I have been…

Science and Technology links (February 2nd, 2018)

, 1 min read

Most mammals, including human beings, age according to a Gompertz curve. It is a fancy way of saying that your risk of death goes up exponential with age. Naked mole rats are mammals that do not age, in the following sense: unlike all other mammals studied to date, and regardless of sex or…