# Hyperplanes question

1. Aug 23, 2010

### kouma

Hello Math friends,

I need some help in hyperplanes.

Basically, I need to calculate a random hyperplane that divides my search space, which consists of data points in R^n, into two hyperspaces. I know that a hyperplane is n-1 dimensionality, but how do I calculate it.

2. Aug 23, 2010

### mathman

The easiest way would be to select a coordinate and choose a fixed value. Divide your data points according to whether that coordinate is > or < the fixed value.

3. Aug 24, 2010

### kouma

That is what I was thinking also, I could simply take lowest and highest points from my data for each dimension, and randomly pick a point in-between that range, effectively splitting the search space into two half-spaces. But, I was wondering since I am asked to use a hyperplane to do this separation, is there an equation I can use to derive a random hyperplane.

4. Aug 24, 2010

### Petr Mugver

What properties you want the two half-spaces to have? For example, you want that half of the points are in one side and the other half in the other side? Or maybe you want the hyperplane to be as close as possible, on average, to the points? Or you just want it completely random?

5. Aug 24, 2010

### kouma

Completely random :)

6. Aug 24, 2010

### Petr Mugver

...and after you have the hyperplane, the only thing you want to wnow is if each point is in one side or the other?

7. Aug 24, 2010

### kouma

Exactly, do you know the equation/formula to derive a hyperplane from an R^n euclidean space?

8. Aug 24, 2010

### Petr Mugver

An hyperplane is a surface that passes through a point $$x_0\in\mathbb{R}^n$$, and that is perpendicular to a certain vector $$u\in\mathbb{R}^n$$. The implicit equation is

$$u\cdot(x-x_0)=0$$

Where the dot is the usual euclidean scalar product. So you just have to choose $$x_0$$ and u randommly. After you have done this, to know if a certain point x lies in one side or the other of the plane, simply calculate $$u\cdot(x-x_0)$$. If this is positive, then x is in the side u points to, if it's negative, it's in the opposite side, and if it's zero it's on the plane.

9. Aug 24, 2010

### kouma

This is a great explanation, exactly what I wanted. I am going to deploy it and see how it works.

Is there a name to this equation that you posted?

Thank you so much for the help.

10. Aug 24, 2010

### Petr Mugver

It is called: "implict equation of the hyperplane passing through x_o and perpendicular to u"!

11. Aug 25, 2010

### kouma

Hello Petr,

Assume we have a R^3 euclidean space with the following points a = (1, 2, 3), b = (3, 4, 5), and c = (3, 5, 6). if I pick Xo = (2, 2, 2), how do I derive the vector u so that I can use the implicit hyperplane equation you mentioned.

Thanks!

12. Aug 25, 2010

### Petr Mugver

You can take whatever U you like (you said you wanted a completely random plane, right?)
For example, you may choose U = (1, 3, 4). Then the equation of the plane is

U . (X - Xo) = 1 . (x - 2) + 3. (y - 2) + 4 . (z - 2) = 0

in other words

x + 3y + 4z = 16

That's it. Very simple!

13. Aug 26, 2010

### kouma

Thanks again Petr for the great and simple explanation.

Now, I did some searching around and I read in some lecture that the implicit equation of a plane doesn't generalize to higher dimensions (higher than 3D), is this true? because my euclidean space will almost always be higher than 3D. If so, how can I generalize it to high dimensions.