Talk:Primes - allocate descendants to their ancestors: Difference between revisions
Content added Content deleted
m (→Task comments) |
(→Task is ambiguous: new section) |
||
Line 15: | Line 15: | ||
# I already put a textual description : "This solution could be compared to the solution that would use the decomposition into primes for all the numbers between 5 and 3^33". |
# I already put a textual description : "This solution could be compared to the solution that would use the decomposition into primes for all the numbers between 5 and 3^33". |
||
--[[User:Old man|Old man]] ([[User talk:Old man|talk]]) 09:00, 25 February 2015 (UTC) |
--[[User:Old man|Old man]] ([[User talk:Old man|talk]]) 09:00, 25 February 2015 (UTC) |
||
== Task is ambiguous == |
|||
I would like to see some ambiguities resolved, here: |
|||
(1) Timing. Timing is meaningless because of potential differences between machines. (Imagine I use elastic map reduce here, for example.) See also [[Rosetta_Code:Village_Pump/Run_times_on_examples%3F]] |
|||
(2) Inadequate illustration: So, ok, an ancestor is the sum of the factors of a prime. But the example only considers a case where there are two factors. What are the ancestors of 72? When we are summing ancestors, if a number is an ancestor of two other numbers do we count it once or twice? And so on... |
|||
(3) Inadequate definition: What is a descendant? Clearly there are some bounds on descendants from the problem writeup stating that 46 has 557 descendants, but what are they? |
|||
Hypothetically, this part of the "C implementation" might define the bounds of the problem: |
|||
<lang C>#define MAXPRIME 99 // greatest prime factor |
|||
#define MAXPARENT 99 // greatest parent number |
|||
#define NBRPRIMES 30 // max number of prime factors |
|||
#define NBRANCESTORS 10 // max number of parent's ancestors</lang> |
|||
But there might be additional constraints implemented in the algorithm and/or data structures. This kind of thing really belongs in the task description. |
|||
Hypothetically, I might try inspecting some of the code samples, to see how they behave. But, for example, the C implementation does not compile. Among its problems is that it tries to do <code>malloc(sizeof(Children))</code> when what has been defined is struct Children. |
|||
(I am rather reluctant to attempt to debug someone else's buggy code to attempt to reverse engineer the bounds of the problem when I could more easily ask for those bounds.) |
|||
So... would it be possible to rephrase the task to address these issues? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 02:53, 26 February 2015 (UTC) |