0

I am trying to write a Python code to sample 50 random points from the intersection of five subspaces in R8. The spaces are four hypercylinders (x12+x22=4; x32+x42=4; x52+x62=4; x72+x82=4) and two linear spaces (x1+x3+x5+x7=4; x2+x4+x6+x8=0).

For all I know is that the intersection can be an infinite set and finding roots of functions as mentioned in Python: Intersection of Spheres may not be feasible.

Also, I tried implementing from Sample random points over intersection if surfaces but couldn't get much.

I have recently started to use Python and request you to pardon me for my rookie mistakes.

Edit: Sorry, I had missed an extra condition of another hypercylinder in the intersection (x72+x82=4).

Ganesh Gani
  • 103
  • 3
  • That is a math question. All variables x1..x6 must be between -2 and 2. Fix randomly x1, x3 and x5. x7 is automatically unequivocally defined. x2, x4 and x6 can each have two possible values (due to the square, they can be either positive or negative). You can fix each of them with a "coin toss" (boolean random 0 or 1). Then x8 becomes automatically unequivocally defined. – MariusSiuram Apr 30 '21 at 12:58
  • @MariusSiuram Sorry, I had missed another hypercylinder in the intersection. I had checked before if any free variables persist but it didn't work out. For instance, fixing x1, x3, x5 might not satisfy the condition on the equation I had missed to add earlier. – Ganesh Gani Apr 30 '21 at 13:19
  • @Peter O. Thank you for reediting my question with right codes for mathematical text. – Ganesh Gani Apr 30 '21 at 13:26

0 Answers0