Talk:Perfect shuffle: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 20: Line 20:


::::::: No, I'm not saying (or implying) that I didn't read about the failure, and I have read the Rosetta Code task's requirements.   It says to print (essentially) 5,000 results.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:52, 15 June 2015 (UTC)
::::::: No, I'm not saying (or implying) that I didn't read about the failure, and I have read the Rosetta Code task's requirements.   It says to print (essentially) 5,000 results.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:52, 15 June 2015 (UTC)

=== What to do? ===


: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]
: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]
Line 26: Line 28:
:--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 22:33, 15 June 2015 (UTC)
:--[[User:Paddy3118|Paddy3118]] ([[User talk: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. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 22:40, 15 June 2015 (UTC)
:: Well... 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. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 22:40, 15 June 2015 (UTC)


:::'''Who would object''' to my suggested change and why? I did not start the draft task or do a language implementation but the task as written could be improved by defining drastically shorter output requirements. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 00:01, 16 June 2015 (UTC)
:::'''Who would object''' to my suggested change and why? I did not start the draft task or do a language implementation but the task as written could be improved by defining drastically shorter output requirements. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 00:01, 16 June 2015 (UTC)

:::: I cannot think of any grounds for objection to shortening the sequence. Though for a decent workout, perhaps the sequence should be factorial values: 2 6 24 120 720 5040? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 04:20, 16 June 2015 (UTC)

Revision as of 04:20, 16 June 2015

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)
As I tried to state in my original paragraph - putting all those numbers on a single line crashes the wiki implementation. (Not permanently, but you can't save an edit which has the full result on a single line.) But ... are you saying that you didn't read that original paragraph nor the task description? --Rdm (talk) 22:43, 15 June 2015 (UTC)
No, I'm not saying (or implying) that I didn't read about the failure, and I have read the Rosetta Code task's requirements.   It says to print (essentially) 5,000 results.   -- Gerard Schildberger (talk) 22:52, 15 June 2015 (UTC)

What to do?

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... 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)
Who would object to my suggested change and why? I did not start the draft task or do a language implementation but the task as written could be improved by defining drastically shorter output requirements. --Paddy3118 (talk) 00:01, 16 June 2015 (UTC)
I cannot think of any grounds for objection to shortening the sequence. Though for a decent workout, perhaps the sequence should be factorial values: 2 6 24 120 720 5040? --Rdm (talk) 04:20, 16 June 2015 (UTC)