Help with Calculating Hyperplanes in R^n

  • Thread starter Thread starter kouma
  • Start date Start date
AI Thread Summary
To calculate a random hyperplane in R^n that divides a search space of data points into two half-spaces, one can use the implicit equation u·(x - x_0) = 0, where x_0 is a point in the space and u is a perpendicular vector. Choosing x_0 randomly and selecting u also randomly allows for the creation of a hyperplane. To determine which side of the hyperplane a point x lies on, compute u·(x - x_0); positive values indicate one side, negative values indicate the other, and zero means the point is on the hyperplane. This method is applicable to any n-dimensional space, maintaining the definition of a hyperplane as an n-1 dimensional affine space.
kouma
Messages
9
Reaction score
0
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.

Thanks in advance!
 
Mathematics news on Phys.org
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.
 
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.
 
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?
 
Completely random :)
 
...and after you have the hyperplane, the only thing you want to wnow is if each point is in one side or the other?
 
Exactly, do you know the equation/formula to derive a hyperplane from an R^n euclidean space?
 
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.
 
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
kouma said:
Is there a name to this equation that you posted?

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

:biggrin:
 
  • #11
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
kouma said:
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!

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
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.

Please advise, thanks.
 
Last edited:
  • #14
It applies to any n, as long as you want a n-1 dimensional affine space (linear space with origin translated), which is what we usually mean by "hyperplane". Don't worry, and go ahead with your calculations.
 
Back
Top