Click here to Skip to main content
15,121,851 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
AspDotNetDev25-Jan-12 9:03
protectorAspDotNetDev25-Jan-12 9:03 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
Stephen Dycus25-Jan-12 9:10
professionalStephen Dycus25-Jan-12 9:10 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
YvesDaoust25-Jan-12 8:02
MemberYvesDaoust25-Jan-12 8:02 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
Member 771612725-Jan-12 10:32
MemberMember 771612725-Jan-12 10:32 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
Leng Vang25-Jan-12 10:34
MemberLeng Vang25-Jan-12 10:34 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
YvesDaoust25-Jan-12 12:19
MemberYvesDaoust25-Jan-12 12:19 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
YvesDaoust25-Jan-12 13:08
MemberYvesDaoust25-Jan-12 13:08 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
Ronald M. Martin25-Jan-12 18:49
MemberRonald M. Martin25-Jan-12 18:49 
I used a spreadsheet constructed as follows:

A1 = 2
A2 = 1
B1 = =IF(B1=1,A1+1,A1)
B2 = =IF(B1=1,A2-1,B1-1)
Then I dragged B1 and B2 downward to create a list of all the combinations of all the base sizes I wanted to examine. In my case, I chose to stop at line 2016 with column A at 64 and column B at 1.
C1 = =A1*(A1+1)*(A1+3)/6
I dragged C1 to D1.
E1 = =C1+D1
I dragged C1, D1 and E1 to line 2016.
I looked at the line that started with 64 and 63 to determine the maximum sum I could generate from the data I was using. Then I extended the table as follows:
A2017 = 1
E2017 = =A2017*(A2017+1)*(A2017+3)/6
I dragged A2017 through E2017 down until the entry in column E was as large as possible but still less than or equal to the largest sum in the upper part of the table. I added column F with 1's in the upper portion of the table and 0's in the lower portion of the table to distinguish the two types of entries.

I copied just the values from the table to a new sheet. I sorted the new table using column E as the primary key and column F as the secondary key.

I added conditional formatting to column E from row 2 down to change the background color of each cell to red if its value was the same as that of the cell above it. When I realized that my red cells included both cases where there were two sets of two different-sized tetrahedra that contained the same number of cannonballs and the desired cases where the cannonballs from two different-sized tetrahedra can be combined to make a larger tetrahedron, I added another column that contained 1 on the same condition that colored the red cells and 0 when those cells would be while. I then conditionally colored this column from row 2 down so that it was green if the row above contained a zero in column F. I did it this way because I couldn't create a more complex condition with the existing conditional coloring mechanism.

The answers that others have posted have already covered the three solutions that I found this way. The question answered by the red cells is interesting in and of itself. It leads to other questions such as: "Are there any numbers of cannonballs that can be stacked into two tetrahedra more than two ways?" and "Are there any cannonball tetrahedra that can be decompsed into two tetrahedra two or more ways?"

Questions of this type remind me of Goldbach's Conjecture that every even number greater than 2 can be expressed as the sum of two odd primes. That was the subject of one of the first programs I wrote in 1961. The conjecture has never been proven or disproven.
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
AspDotNetDev25-Jan-12 19:05
protectorAspDotNetDev25-Jan-12 19:05 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
Ronald M. Martin25-Jan-12 20:14
MemberRonald M. Martin25-Jan-12 20:14 
GeneralRe: IQ / Programming Quiz (Cannon-Ball Stacks) Pin
AspDotNetDev25-Jan-12 20:32
protectorAspDotNetDev25-Jan-12 20:32 
GeneralGoldbach's Conjecture modified for practical use Pin
jsc4226-Jan-12 0:33
professionaljsc4226-Jan-12 0:33 
GeneralHow's your geometry? Pin
charlieg23-Jan-12 15:39
Membercharlieg23-Jan-12 15:39 
GeneralRe: How's your geometry? Pin
_Maxxx_23-Jan-12 15:45
professional_Maxxx_23-Jan-12 15:45 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 15:57
Membercharlieg23-Jan-12 15:57 
GeneralRe: How's your geometry? Pin
_Maxxx_23-Jan-12 16:09
professional_Maxxx_23-Jan-12 16:09 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 16:22
Membercharlieg23-Jan-12 16:22 
GeneralRe: How's your geometry? Pin
_Maxxx_23-Jan-12 16:32
professional_Maxxx_23-Jan-12 16:32 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 15:57
Membercharlieg23-Jan-12 15:57 
GeneralRe: How's your geometry? Pin
_Maxxx_23-Jan-12 16:11
professional_Maxxx_23-Jan-12 16:11 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 16:16
Membercharlieg23-Jan-12 16:16 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 16:17
Membercharlieg23-Jan-12 16:17 
GeneralRe: How's your geometry? Pin
charlieg23-Jan-12 16:12
Membercharlieg23-Jan-12 16:12 
GeneralRe: How's your geometry? Pin
_Maxxx_23-Jan-12 16:29
professional_Maxxx_23-Jan-12 16:29 
GeneralRe: How's your geometry? Pin
charlieg24-Jan-12 2:23
Membercharlieg24-Jan-12 2:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.