Cubes in a GridDate: 06/17/99 at 15:28:17 From: Daniel Holman Subject: Grids I'm trying to find a formula to determine how many cubes you need for a certain size grid. The bottom row in the cube always has 1 cube, the second has 5, etc. I have to work out how many cubes you need in all for a certain size grid. For example, a 3x3 grid needs 1 on the bottom, 5 in the middle and another 1 on the top. So that's 7 cubes for a 3x3 grid. I will give you the figures for larger ones: 3x3 = 7, 5x5 = 25, 7x7 = 63, 9x9 = 129, 11x11 = 231. I just cannot work out a formula to determine how many cubes you need for a specific size grid. Arrgghh! Please, please help! Date: 06/18/99 at 10:51:52 From: Doctor Anthony Subject: Re: Grids Make up a difference table n = 1 2 3 4 5 6 size = 1x1 3x3 5x5 7x7 9x9 11x11 f(n) = 1 7 25 63 129 231 1st diff. 6 18 38 66 102 2nd diff. 12 20 28 36 3rd diff. 8 8 8 With 3rd differences constant the expression for the nth term will be a cubic polynomial in n. So we assume f(n) = an^3 + bn^2 + cn + d n = 1 gives a + b + c + d = 1 n = 2 " 8a + 4b + 2c + d = 7 n = 3 " 27a + 9b + 3c + d = 25 n = 4 " 64a +16b + 4c + d = 63 So we have four equations with four unknowns. The solutions are a=4/3 b=-2 c=8/3 d=-1 Therefore f(n) = 4n^3/3 - 2n^2 + 8n/3 - 1 4n^3 - 6n^2 + 8n - 3 f(n) = -------------------- 3 Check this answer for n = 6 864 - 216 + 48 - 3 f(6) = -------------------- = 231 3 which checks with the value in the table. We could also express the formula in terms of grid size by replacing n in the above formula by (s+1)/2 (1/2)(s+1)^3 - (3/2)(s+1)^2 + 4(s+1) - 3 so f(s) = ---------------------------------------- 3 (s+1)^3 - 3(s+1)^2 + 8(s+1) - 6 f(s) = --------------------------------- 6 s^3 + 5s f(s) = ----------- = s(s^2 + 5)/6 6 check this result for an 11x11 grid, that is s=11 f(s) = (1/6) x 11 x (121+5) = 11 x 126/6 = 231 which checks - Doctor Anthony, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/