Array Methods: Remove requirement for equal probability from array shuffle #3913
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given the scope and intent of the array methods lesson and the expected knowledge level of learners going through this lesson, I don't believe the "Shuffle an array" task should instruct to make each permutation of equal probability. Successfully achieving that requires that either someone happens to already know a shuffling algorithm like Fisher-Yates, or understands why nuances with
Array.prototype.sort()would lead to permutation bias.I think it's more pedagogically appropriate to simply omit that requirement from the instructions. That requirement won't likely change much about how many learners would do things, but risks sending someone down a rabbit hole of stuff out of the scope of practising working with arrays and array methods.
The solution can stay as is - the explanation is good and makes sense to introduce the permutation bias concept there, just not as an actual requirement for the task.
In various learning communities I take part in, this is a very common pain point and rabbit hole I see learners go down when trying to solve it (i.e. not a rabbit hole they go down after reading the explanation).