Results 1 to 6 of 6

Math Help - The volume of the interior of an ellipsoid in Rn deminsion, help would be appreciated

  1. #1
    Newbie
    Joined
    Jun 2012
    From
    copenhagen
    Posts
    3

    The volume of the interior of an ellipsoid in Rn deminsion, help would be appreciated

    hi everyone
    i have been given this problem to solve, usage of R or Rstudio is required so solve it.
    i would appreciate undescriply for anyone helping me solve it, even if it costs me money.
    the problem is attached to this thread, please take a moment to check it
    thanks again
    Attached Thumbnails Attached Thumbnails The volume of the interior of an ellipsoid in Rn deminsion, help would be appreciated-abc.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    mfb
    mfb is offline
    Junior Member
    Joined
    Jun 2012
    From
    Germany
    Posts
    72
    Thanks
    5

    Re: The volume of the interior of an ellipsoid in Rn deminsion, help would be appreci

    What did you find out so far?
    Do you know how stochastic integration works?
    Where do you struggle?

    As the program for the integration can be quite simple, I do not think that the platform is important here.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jun 2012
    From
    copenhagen
    Posts
    3

    Re: The volume of the interior of an ellipsoid in Rn deminsion, help would be appreci

    hey, thanks for your time to check it out.. yes i have so far found the 2D of how the ellipsoid should be enclosed at. but that is supposed to be
    the easiest part. here is the Rcode. which u can put and check it out..if u can help with 3D..damn ur the king..

    nsim = 10000
    dim = 2
    a = c(1,1) # a cricle actually
    X = matrix(nr=nsim,nc=dim,data=runif(nsim*dim,min=-1,max=1))

    ## checking if a point is inside
    A = (X^2 %*% (1/a^2)) # contains the (x[1]/ a[1])^2 and (x[2]/a[2])^2 values
    B = apply(X=A,MARGIN=1,FUN=sum) # sum entries on each line

    inside = ( B < 1) # check if each points is inside

    plot(X,col=1+inside)


    Vhat = mean(inside)*4
    Vhat
    Follow Math Help Forum on Facebook and Google+

  4. #4
    mfb
    mfb is offline
    Junior Member
    Joined
    Jun 2012
    From
    Germany
    Posts
    72
    Thanks
    5

    Re: The volume of the interior of an ellipsoid in Rn deminsion, help would be appreci

    I do not know what c(1,1) does, but is there something like c(1,1,1) for 3 dimensions? Is there an n-dimensional version of that?
    The basic idea is to generate n random numbers each, (scale, ) square and add them.
    "Vhat = mean(inside)*4" -> in general, the factor is 2^dim.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Jun 2012
    From
    copenhagen
    Posts
    3

    Re: The volume of the interior of an ellipsoid in Rn deminsion, help would be appreci

    yes the idea is n-deminsional. could u make something out of it?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    mfb
    mfb is offline
    Junior Member
    Joined
    Jun 2012
    From
    Germany
    Posts
    72
    Thanks
    5

    Re: The volume of the interior of an ellipsoid in Rn deminsion, help would be appreci

    R might have a different way to do this, but in C++ my approach would look like this:

    Code:
    int dimensions=10;
    int inside=0;
    int npoints=100000;
    
    double sqsum;
    double rnd;
    for(int k=0;k<npoints;k++) {
      sqsum=0;
      for(int i=0;i<dimensions;i++) {
       rnd=rand()/RAND_MAX;
       sqsum+=rnd*rnd;
      }
      if(sqsum<1) {
        inside++;
    }
    double volume=inside/npoints*2**dimensions;
    cout<<"The volume is approximately "<<volume<<endl;
    I did not include scaling for ellipsoids here.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. volume of solid inside ellipsoid
    Posted in the Calculus Forum
    Replies: 1
    Last Post: December 6th 2009, 02:40 AM
  2. Volume of ellipsoid
    Posted in the Calculus Forum
    Replies: 0
    Last Post: November 17th 2009, 06:26 PM
  3. interior of set closure differnet from interior of the same set?
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: October 17th 2009, 11:13 AM
  4. Replies: 1
    Last Post: September 29th 2009, 06:09 AM
  5. Replies: 3
    Last Post: December 22nd 2008, 11:40 PM

Search Tags


/mathhelpforum @mathhelpforum