In this section, you will learn about combining information from multiple planes into a single hash value. In the last video, you saw how by the sign of the dot product between the normal vector of a plane and a vector representing your data, you could get a relative position relative to that plane. In this lecture, I'm going to show you how to use this information for multiple planes to get a hash value for your data in your vector space. In order to divide your vector space into manageable regions, you'll want to use more than one plane. For each plane, you can find out whether a vector is on the positive or negative side of that plane. So you'll get multiple signals, one for each plane and you want to find a way to combine all of those signals into a single hash value. This has value will define a particular region within the vector space. Let's walk through an example. Then you will see the general formula for combining signals from multiple planes. So for a single vector, let's say that it's dot product with plane 1 is 3, so the sign is positive, and the hash value is set to 1 to indicate that the sign is positive. For the second plane, the dot product is 5, so the sign is again positive and the hash value is 1. For the third plane, the dot product is -2, so the sign is -1 and the hash value is set to 0 to Iindicate that the vector v is on the negative side of plane 3. To combine these intermediates hash values into a single hash value, you'll do the following. Take 2 to the power of 0 times h1 + 2 to the power of 1 times h2 + 2 to the power of 2 times h3, it gives us a combined hash value of 3. So just as a reminder you have multiple planes and it helps us to divide the vector space into smaller sub regions. But you want to have a single hash value, so you will know which bucket to assign the vectoring. You do this by combining the signals from all the planes into a single hash value. Here are the rules you applied written out, if the sign of the dot product is greater than or equal to 0, assign the intermediate has value of 1. Otherwise if the dot product is less than 0, assign the intermediate hash value of 0. To combine the intermediate as values, use this formula, this is how you get locality sensitive hashing. Let's implement this in code. Given a list of planes and vector, starts with a hash_value of 0, which you'll use to accumulate the sum of intermediate hash values. Then for each plane, you want to calculate the sign of the dot product. Set the intermediate hash_value to 1 if the sign is greater than or equal to 0. I'll set it to 0 then you multiply the intermediate add value by 2 raised to the 8th power and added to the hash_value. Finally, you return the hash_value. So if you run code in the lecture notes book, you'll get the same results as the example you saw earlier, go ahead and try it out. >> Now you have seen what it means for a hash function to be locality sensitive, and examples of such hash functions. Next, you will see how this is useful for speeding up the k-nearest neighbor computation. Let's go to the next video.