Math 4140 Homework 1 Key Problem 1 How many strings over the alphabet {A, B, C} fail to have adjacent repeated Summary: Math 4140 Homework 1 Key Problem 1 How many strings over the alphabet {A, B, C} fail to have adjacent repeated letters? Your answer should be a function of the length n of the string. So, for example: 3 of length one: A, B, C 6 of length two: AB, AC, BA, BC, CA, CB Answer: Notice that the first character can be anything but each subsequent character must not match the one before it. This method will give all strings without adjacent repeated letters. This means we have a three way choice followed by as many two way choices as are needed to finish the string. Since independent choices multiply, we get 3 · 2n-1 Problem 2 Suppose that we want to pick four squares out of an N × N grid so that the four squares form a connected shape. Count, as a function of N then number of ways that this can be done. Hint: divide and conquer. Answer: Lemma 1 There are (n-k +1)×(n-m+1) ways to place a k ×m rectangle into an n×n grid. Proof: Given the width and height of the rectangle, n - k + 1 is the number of lateral positions where the upper left corner of the rectangle can be placed, similarly n-m+1 is the number of vertical positions where the upper left corner can be placed. Since the rectangle can be Collections: Mathematics