It seemed simple when I first received this problem in February, but I found out from a couple of other students that it's not as simple as it seemed. Might as well get this out before the end of the course.
Problem: Draw a diagonal line in a rectangle that consists of m rows and n columns and determine how many grid squares are passed through by the diagonal line.
Process: Using graph paper in class, I drew some examples down on paper and found some patterns.
This is what I found comparing m and n (before I ran out of space).
n
m 1 2 3 4 5 6 7 8
1 1 2 3 4 5 6 7 8 RED: Whenever n = m
2 2 2 4 4 6 6 8 8 GREEN: Whenever n = m are odd
3 3 4 3 6 7 6 9 10 YELLOW: Whenever n and m are odd
4 4 4 6 4 8 8 10 8
5 5 6 7 8 5 101112
6 6 6 6 8 10 6 1212
7 7 8 9 101112 7 14
8 8 8 10 8 121214 8
I wasn't so sure about the pattern that I found, because it seemed to look like it was all over the place.
I initially thought that there was a pattern whenever n or m are odd or whenever n or m are even, but then I had to look at whenever n = m, where the pattern would break. There also seems to be a pattern when looking diagonally across this chart.
Overall, I'm not entirely sure of what to make of this, even though "answer" were already given. I felt that if possible, I'd want to discuss this with Danny about this, but it's already the end of the course, so oh well.
No comments:
Post a Comment