Combinatorics problem: you're arranging 10 people (A .. J) in a row. A and B must sit next to each other. How many arrangements? How could writing this problem as a program help scaffold the problem-solving process?
-
-
But subtractive is hard to reason about analytically -- how to compute len(..)? Then we rewrite additively: permutations(['AB'] + 'C' .. 'J') + permutations(['BA'] + 'C' .. 'J') Now we can easily derive the formula permutations(9) * 2.
Show this thread -
Maybe this is actually a compiler problem: how can you rewrite the subtractive program (which naturally falls out of the problem statement) into an additive one (which is easily countable)? i.e. how do you remove all conditional expressions?
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
cognitive psychology. PhD