2017-10-21

How is 1-STICKY guaranteed?.

Hi,
 "python sticky_snippet_generator.py 2500 0 1 out1.txt
 Note even though in the first line above you are guaranteeing that all items at least 1-STICKY"
 How is it guaranteed to be 1-STICKY? For example, the following could be a sample output
 BCABCD...........B
 Since B does not stick with B, this could be a NONSTICK output. Please let me know if my understanding is correct.
Hi, "python sticky_snippet_generator.py 2500 0 1 out1.txt Note even though in the first line above you are guaranteeing that all items at least 1-STICKY" How is it guaranteed to be 1-STICKY? For example, the following could be a sample output BCABCD...........B Since B does not stick with B, this could be a NONSTICK output. Please let me know if my understanding is correct.

-- 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
X