
Patrick B. answered 06/15/19
Math and computer tutor/teacher
You can find the probability that the NEXT character is not in alphabetical order.
a=1, b=2, c=3, d=4, ...., z=26
For any character ??? in the string, the probability that the next character
is NOT in alphabetical order is
( ???-1) / 26
For example, suppose the current character in the string is J=10.
then the probability that the next character is NOT in alphabetical order is (10-1)/26 = 9/26
So then you can multiply these probabilities of all but the last character in your string together
Note that if a is NOT the last character in your string, then the probability shall be zero
(since (1-1)/26 = 0 and there is no letter before a )