Scroo, good point that Temasek Maths does not recognize negative numbers.
It reminds me of 12th century Arabic mathematics. The scholars in that era did not understand fully the concept of negative quantities and they worked with algebraic equations without negative signs in them.
Many of these scholars were employed by the monarchy, but one thing they never achieved was to spend the imperial treasury on failing investments and still boast a profit. Apparently that brand of maths was 8 centuries ahead of their time.
You want to slot 30 "b"s into a string of 30 "a"s so that no two "b"s are side by side.
That means the 30 "b"s must occupy the "spaces" in between the 30 "a"s, with a maximum of one "b" in each "space". For instance, we can have something like "aababa", but not "aabbbba".
Since there are 31 spaces, including the start and end positions, there must be precisely one space left empty. Hence, the number of permutations is 31 (you just choose which space is not occupied by a "b").