Talk:Zeckendorf number representation: Difference between revisions

no edit summary
(→‎Consensus on the sequence: is everybody happy?)
No edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 24:
:::I've rewritten the task to be based on distinct Fibonacci numbers, and the task now references the OEIS sequence as the desired result without specifying the algorithm. I don't think it will be any great hardship to the current entries to switch to this approach, since it merely involves starting the Fibonacci sequence at a point where it leaves out the first 1. --[[User:TimToady|TimToady]] 05:16, 12 October 2012 (UTC)
::::Okay, I think I've patched everything to be consistent with the new task description, but please double-check my work to see if I've done something stupid in your favorite language. --[[User:TimToady|TimToady]] 06:27, 12 October 2012 (UTC)
 
:::::Much thanks guys, the fixes are great. I am currently trying not to get a full blown cold, which appears to be what's affecting my concentration. --[[User:Paddy3118|Paddy3118]] 18:35, 12 October 2012 (UTC)
 
: It should be noted that this task can be solved without using a Fibonacci sequence. See the '''generic''' example in the REXX section. -- [[User:Gerard Schildberger|Gerard Schildberger]] 21:34, 23 October 2012 (UTC)
 
:: That doesn't make sense at all. Try the sequence 1, 2, 4 ... 2^n, how do you make a representation that's garanteed to have no 11s? --[[User:Ledrug|Ledrug]] 23:13, 23 October 2012 (UTC)
 
::: I don't understand "try the sequence". Do you want those numbers expressed as Zeckendorf numbers (instead of 0, 1, 2, 3, 4, 5, ..., 20)? The '''generic''' REXX example doesn't ''use'' a sequence at all. -- [[User:Gerard Schildberger|Gerard Schildberger]] 23:22, 23 October 2012 (UTC)
 
:::: Never mind, I thought "solved without using a Fibonacci sequence" meant "using some other sequence in its place", which obviously was my misunderstanding. --[[User:Ledrug|Ledrug]] 00:29, 24 October 2012 (UTC)
 
: Also, the '''general''' REXX solution solves the task for '''N''' Zeckendorf numbers, which merely generates a Fibonacci sequence whose last numer is greater or equal to '''N''' (instead of hard coding six Fibonacci numbers). I think it'd be a better task to list up to '''N''' Zeckendorf numbers, with 20 being the default. That way, no short cuts would be used in the examples and thereby hiding the limitations of the programs. -- [[User:Gerard Schildberger|Gerard Schildberger]] 21:34, 23 October 2012 (UTC)
 
==Perl 6, wrong fib sequence==
Line 30 ⟶ 42:
:By the way, according to your own criteria, the Python solutions are incorrect for 1, since using the 1,1 in the reversed order greedily should produce '10', not '1'. You shouldn't have to special-case 1 like that. --17:59, 11 October 2012 (UTC)
::More to the point, if you don't introduce a special discontinuity like that at 1, then the 1,1 and 1,2 solutions are isomorphic modulo the presence or absence of a trailing 0. Though I should probably not have said "incorrect" above; as Sonia points out, it's ambiguously specified. But I'd very much prefer to disambiguate the rule by saying something like "Using all the numbers in the sequence less than or equal to the number." This is in keeping with the greediness and the reversal of the sequence. Alternately I would not be adverse to going back to a formulation that uses "All the positive Fibonacci numbers in order." That is, the 1,2 solution. Which most of the implementations chose back when it was still unspecified as 1,1... --[[User:TimToady|TimToady]] 18:11, 11 October 2012 (UTC)
== J wiki edit trouble ==
It's supposed to show as
<lang J>
' '&~:Filter@:":@:#:@:#.@:((|. fib 2+i.8) e. fsum)&.>i.3 7
┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐
│0 │1 │10 │100 │101 │1000 │1001 │
├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│1010 │10000 │10001 │10010 │10100 │10101 │100000│
├──────┼──────┼──────┼──────┼──────┼──────┼──────┤
│100001│100010│100100│100101│101000│101001│101010│
└──────┴──────┴──────┴──────┴──────┴──────┴──────┘
</lang>
--LambertDW 02:12, 28 November 2012 (UTC)
Anonymous user