Incorrect answer in the 'cube' task
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GBrainy |
Fix Released
|
Medium
|
|||
gbrainy (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: gbrainy
The 'correct' answer in the 'Cube' problem is indeed wrong. The task reads:
"How many cubes do you count in the figure below? (not counting the figure)",
and the picture of a big cube subdivided into n^3 small cubes follows (see attachment). The number n is either 4, 5, or 6. GBrainy says that for each n the correct answer is n^3 (i. e. 64 for n = 4, 125 for n = 5 and 216 for n = 6), but obviously that's wrong.
There are also sub-cubes of sizes 2x2x2, 3x3x3 and so on. For example, in the case of n = 4, one can find 99 cubes:
8 = 2^3 cubes of size 3x3x3,
27 = 3^3 cubes of size 2x2x2
and 64 = 4^3 cubes of size 1x1x1.
So, for an arbitrary n the correct answer is 1^3 + 2^3 + ... + n^3. In particular, the answer for n = 5 is 224, the answer for n = 6 is 440, and, as already mentioned, the answer for n =4 is 99.
Changed in gbrainy (Ubuntu): | |
assignee: | nobody → Ben Crisford (bencrisford) |
status: | New → In Progress |
Changed in gbrainy: | |
status: | Unknown → New |
Changed in gbrainy (Ubuntu): | |
assignee: | Ben Crisford (bencrisford) → nobody |
status: | In Progress → Confirmed |
Changed in gbrainy (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in gbrainy: | |
importance: | Unknown → Medium |
Changed in gbrainy: | |
status: | New → Fix Released |
Changed in gbrainy (Ubuntu): | |
status: | Fix Committed → Fix Released |
I'm not a math user but I have downloaded gbrainy source and check that algorithm for obtain right answer fot this problem is resolved by:
rows = columns = deepth = 4 + random.Next (max_random);
ans = rows * columns * deepth;
right_answer += ans.ToString ();
For example if your case you have a cube with 4 rows, 4 colums and a deepth of 6 (faces of a regular cube), so in resume we have:
ans = (4 * 4 ) * 6 = 96