Talk:Perfect shuffle

From Rosetta Code

Hostile task requirement?

When I try to post the result specified by this task, I get a message that the website is offline. Perhaps this is because that result is a 21010 character long line of text. But something similar happens when I try to post the result as a table with 53 lines of 253 characters. Perhaps the task should be changed to not require such a large result? --Rdm (talk) 17:10, 15 June 2015 (UTC)

Just elide the result, like the other solutions do :) --Smls (talk) 18:55, 15 June 2015 (UTC)
I did elide most of it, but why shouldn't this be a part of the task requirements? --Rdm (talk) 20:07, 15 June 2015 (UTC)
If everybody (hopefully) will be eliding the output (to something reasonable), why have the Rosetta Code task ask for 10,000 shuffles?   Why not just ask for twenty shuffles (up to a deck size of forty)?.   That would make outputs somewhat homogenized.   -- Gerard Schildberger (talk) 20:15, 15 June 2015 (UTC)
Ok, never mind. I managed to get the elided part out there also. --Rdm (talk) 20:16, 15 June 2015 (UTC)
Did anybody realistically think that the programming entries (examples) would actually post 5,000 lines of output (I don't see one long line being easy to peruse).   -- Gerard Schildberger (talk) 20:20, 15 June 2015 (UTC)
"lines"? That's not really the problem. The task does however require 5000 numbers for the result (more if you include labeling - but that is left open). --Rdm (talk) 22:03, 15 June 2015 (UTC)
Yes, I meant lines (of "output" to the terminal)--- and the ability to peruse the results in some meaningful way.   I had thought that the printing/including the number of requested results (or lines) is the problem, else why would people elide the results?   If 5,000 numbers are just listed in word-wrap form (or even just one line), how can anybody read such a mass of numbers (or even verify any particular number)?   Adding labels or some sort of index (rank) number would definitely help in the readability, but it would add to the (huge) bulk.   I would hope everyone could see the futility of including (printing) such a list for each entry as part of this Rosetta Code task, other than it being an exercise to see if the programming entries could create 5,000 numbers.   However, if the task says to print 5,000 results, I'll change my entry to include them.   -- Gerard Schildberger (talk) 22:36, 15 June 2015 (UTC)
Seems like a flaw to me to. Why not edit the task to ask for shuffle counts for 2^(2*n) for n = 1..7 i.e only for counts: [4, 16, 64, 256, 1024, 4096, 16384]
Trying for: easy to state, similar size maximum, reduced output.
Although I haven't run any code to see if the 16384 calculation is reasonable, time-wise.
--Paddy3118 (talk) 22:33, 15 June 2015 (UTC)
Well... I've documented the algorithm I'm using in the J entry, and... 16384 has a cycle length of 14, which takes less than a millisecond for me to compute (though in general the cycle length for this task for a sequence of unique values of length 2^N should be N). So even if you brute force it, that form of the task shouldn't take that long. --Rdm (talk) 22:40, 15 June 2015 (UTC)