Talk:Perfect shuffle: Difference between revisions

Line 33:
 
:::: 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)
 
:: When changing the solutions to only do the calculation for the 7 deck sizes suggested by Paddy3118, the Python solution finishes in 0.11 seconds and the Perl solution in 0.12 seconds, on my machine. With the values suggested by Rdm it takes a bit longer, but still reasonable (1.32 sec and 3.29 sec respectively).
:: So, +1 from me for this change (with either one of those sets). I'd also suggest listing the expected inputs and outputs as a "Test Cases" table in the task description, like I tend to do [[Convert_seconds_to_compound_duration|in my tasks]]:
::{| class="wikitable"
|-
! input ''(deck size)'' !! output ''(number of shuffles)''
|-
| 4 || 2
|-
| 16 || 4
|-
| 64 || 6
|-
| 256 || 8
|-
| 1024 || 10
|-
| 4096 || 12
|-
| 16384 || 14
|}
:: Or:
::{| class="wikitable"
|-
! input ''(deck size)'' !! output ''(number of shuffles)''
|-
| 2 || 1
|-
| 6 || 4
|-
| 24 || 11
|-
| 120 || 24
|-
| 720 || 359
|-
| 5040 || 2519
|}
:: --[[User:Smls|Smls]] ([[User talk:Smls|talk]]) 07:23, 16 June 2015 (UTC)
Anonymous user