# Security Cable Investiation

1. Jan 26, 2014

### AlfieD

A door company makes doors out of square wooden panels. After installing many doors, they are asked to install a security cable that runs diagonally from the top right to the bottom left. With an n*m door, how many panels need to be lifted to place the security cable?

So what I did at first was just draw out some basic representations to see if any patterns jumped out at me: I did 5x4 and got 7 panels, 4x6 got me 8 panels, 4x7 got me 9, 5x6 got me 10, 5x7 got me 11, and 6x7 got me 12. So I started thinking if it was n+m-1, etcetera, but to no avail. I could see a pattern, but not a pattern for every one (there were groups where a pattern worked); I couldn't find a formula that was consistent, no matter what n or m equalled.

If someone could shed some light on this I would be appreciative. I don't actually know if there is an answer, but there probably is because I doubt I'd be set such a tedious homework!

AlfieD

#### Attached Files:

• ###### IMG_0892[1].jpg
File size:
45.5 KB
Views:
53
2. Jan 26, 2014

### AlephZero

Comments on what you have done so far:

Assuming the question means the cable is straight, your drawings are not very accurate, so some of your counting is wrong. Use a ruler!

If the cable does not have to be straight, the number of panels is different, and often smaller than for a straight cable.

If n and m have a common factor, this is a special case, because the cable goes exactly across the corner of some of the panels. For example 4x6 panels is the same as two sets of 2x3 panels.

That is wrong (you know that already), but it is the right idea.

3. Jan 26, 2014

### AlfieD

Funny thing is: I used a ruler. :/

The cable has to be straight.

So, are you saying that there is or there isn't a formula that is consistent for all values of n and m? Also, how do I work out the formula; I'm not really sure where to go from where I am.

4. Jan 26, 2014

### Dick

Yes, I think you can write a formula that good for all m and n. Start with AlephZero's observation. If m and n have no common factor, then your cable will never pass through an interior corner. Try to count that case first.

Last edited: Jan 26, 2014
5. Jan 26, 2014

### haruspex

The problem with your drawn examples is that sometimes your line passes very close to panel corners, but perhaps not quite through them. E.g. with origin (0,0) at lower left, look at (1, 1) in your first picture. You have the line going through that corner, implying it is at 45 degrees, but it finishes at (4, 5). Likewise at (3, 5) in the third picture.
If the line does pass through an interior corner, what does that tell you about m and n?
If it does not pass through an interior corner, how many panel edges must it cross?

6. Jan 26, 2014

### tinypositrons

This is why we love 9a2

7. Jan 26, 2014

### AlephZero

Well, I just looked at your drawings, and saw they were not accurate (see haruspex's post for example)

You can write a formula, but if n and m have a common factor the formula will have to include that somehow.

As a special case, think about what happens if n = m, compared with n = m + 1.

Or, think about doors with 3 x 2, 6 x 4, 9 x 6 panels, etc...

8. Jan 27, 2014

### AlfieD

Yeah, sorry; my ruler skills are somewhat lacking.

Ok, so I thought about the common factor thing and the only thing I could come up with was n+m-hcf(n,m). This seemed to work for all of the ones that I tried.

9. Jan 27, 2014

### Dick

That's what I came up with as well. Now can you see WHY it works?

10. Jan 27, 2014

### AlfieD

I think I see why it works; because when you have a common factor of n and m, say 2, it's going to have two perfect corners (where it goes directly through a corner of a plank without touching any other plank) which is where I first derived the n+m-1 thing. But then obviously I had to account for the hcf not being 1, so did hcf(n,m) instead, which seemed to work. When I said about the perfect corners, I didn't count the ones in the bottom left and top right because I don't think they're relevant.

11. Jan 27, 2014

### Dick

Yeah, counting 'perfect corners' vs places where you cross a line not at a corner is one way to do it. Well done.

12. Jan 27, 2014

### AlfieD

Haha, thanks. But thanks so much to you and the others; you pretty much drove me to that conclusion. :)