Results 1 to 2 of 2

Thread: Trouble in Math Land

  1. #1

    Cool Trouble in Math Land

    Hello Math Gurus

    i Have been trying to solve this for 4 days now..Its time I accept ..I need help

    Here is the problem

    Lets say i have an aaray in C say a[256][256][124]

    hence a[0][0][0]=0
    and so on and so forth

    therfore i can get a generalised formula for calculating the linear index number as ;-
    [(z*65536)+(y*256)+x]=index number

    now lets say i have an index number 18921 how do i get the original x,y and z co-ordinates

    Help needed
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Jun 2005
    Taking your example, [(z*65536)+(y*256)+x]=index number=18921 we notice that the LHS leaves remainder x on division by 256. So x is the remainder of 18921 on division by 256, that is, 233. So z*65536 + y*256 + 233 = 18921, that is, z*65536 + y*256 = 18688 = 73*256. So z*256 + y = 73. The LHS leaves remainder y on division by 256, so y = 73. We now have z*256+73 = 73, giving z=0.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. 11th Grade Math Question - Land Plots
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: Sep 16th 2013, 03:17 AM
  2. Replies: 9
    Last Post: Mar 29th 2011, 07:11 PM
  3. Land question
    Posted in the Geometry Forum
    Replies: 1
    Last Post: Jan 22nd 2010, 12:47 AM
  4. land problem
    Posted in the Statistics Forum
    Replies: 1
    Last Post: Nov 15th 2009, 06:58 AM
  5. atsat math word problem trouble....
    Posted in the Algebra Forum
    Replies: 2
    Last Post: Oct 23rd 2009, 06:17 PM

/mathhelpforum @mathhelpforum