-- How is 1-STICKY guaranteed?
Hey Vasudha,
I think the issue here is that I had mentally written a couple of sentences that never actually got written in the HW description. :) You are supposed to start with a string which is a stick palindrome. Apply the mutation rate only to those items which are at most from_ends distance from either end. Items further than that distance should be randomly chosen. I.e., mutated with proability 1, where a mutation might leave something unchanged.
In the particular case you are wondering about, 0 is the odds that we mutate the last character from the end. So it won't get mutated and will remain sticky.
I've corrected the description now.
Best,
Chris
(
Edited: 2017-10-21)
Hey Vasudha,
I think the issue here is that I had mentally written a couple of sentences that never actually got written in the HW description. :) You are supposed to start with a string which is a stick palindrome. Apply the mutation rate only to those items which are at most from_ends distance from either end. Items further than that distance should be randomly chosen. I.e., mutated with proability 1, where a mutation might leave something unchanged.
In the particular case you are wondering about, 0 is the odds that we mutate the last character from the end. So it won't get mutated and will remain sticky.
I've corrected the description now.
Best,
Chris