Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 10-15-2009, 07:35 AM   #1
Site Team
berry120's Avatar
Join Date: Jul 2009
Location: England, UK
Posts: 3,422
Smile A challenge...

I like these sorts of things every so often, so thought I'd throw this up if anyone wanted to have a stab at it

Let's consider "stacks" of blocks in any number of dimensions - and for this example we'll consider a side length of 5.

So, a one dimensional stack of blocks would just be 5 blocks on top of each other - therefore using 5 blocks in total.

A two dimensional "stack" of blocks would have 5 blocks on the bottom, then 4, then 3, then 2 and then 1. So this would use 15 blocks in total.

A 3 dimensional "stack" of blocks would be a triangular pyramid. So it'd have 15 blocks on the bottom arranged in a triangle (5, 4, 3, 2, 1) then 10 blocks arranged in a triangle (4, 3, 2, 1) all the way up to just one block at the top. So this would use 35 blocks in total.

Applying this same logic, how many blocks would be needed to make a 4 dimensional "stack" of side length 5?

Following on from this, can you write a method / function that will, given the side length and number of dimensions, work out the total number of blocks needed?

An interesting spin off of this problem is this - given a normal triangular pyramid of blocks (3D) and assuming each block can only take a certain amount of weight before it collapses, if built tall enough will the whole pyramid collapse under its own weight? If we apply this to a 4D "pyramid", would it do the same thing? If so, is there a number of dimensions for which it won't ever collapse under its own weight?

EDIT: For clarification, I'm still assuming gravity is a vector force only ever acting on a single dimension.

Good luck

berry120 is offline   Reply With Quote
Old 10-17-2009, 07:42 AM   #2
Solid State Member
Join Date: Oct 2009
Posts: 19
Default Re: A challenge...

Let me make sure I'm thinking correctly before I write anything:

Would the 4 dimension length 5 require 75 blocks or am I just way off?

If you don't want to give that part away you don't have to answer.

Hoodlum is offline   Reply With Quote
Old 10-18-2009, 04:26 PM   #3
Site Team
berry120's Avatar
Join Date: Jul 2009
Location: England, UK
Posts: 3,422
Default Re: A challenge...

Afraid you're off for that one - but not by much.
berry120 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 08:35 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0