A math problem, sort of
May 14th, 2009 by Gordon | 3 Comments
An old friend of mine from my school-of-ed-days called me up today in the middle of one of his classes with a math question. He was subbing in a precalculus class at some high school, and had come to a problem that was causing a lot of hubbub amongst the students, and apparently no amount of internal deliberation was clearing anything up. He read the problem to me over the phone in the hopes that I might immediately recognize what was going on and what the proper solution was. Unfortunately, I found myself in a similar boat as the students, and to give you a quick spoiler, I ultimately determined that the real problem at hand was that the question was extremely poorly worded and just not practical. Unfortunately since I never got to see the problem or the textbook from whence it came, I'm just quoting--as best as I can--what I think he said the problem was over the telephone, so understand that just as in the game of telephone, the accuracy of my quote may have already degraded. But if I recall correctly, it was something like this, below.
A company has a total of 14 computers, 1 host computer, and 3 printers. Using graph theory, show whether it is possible to connect the computers so that each one is connected to two other computers, the host, and one printer.
The first issue I have with this problem should be obvious to anyone who understands a decent amount about computer networking: he's doing it wrong. In fact he couldn't be more wrong about his general setup to this problem. In the real world, you would never use graph theory in this situation. The actual solution, which we'll get to eventually, is so much more straight-forward. So as you might imagine, when I first heard that question, I did not hear a sophisticated mathematician posing a practical problem about graph theory; instead I pictured a bumbling old man frustrated with technology walking into an electronics store ranting about the "best" way to connect a series of computers together--a bumbling old man who clearly doesn't understand a thing about modern networking at all, that is. Lord have mercy on whatever poor sales associate has to deal with him and try to explain how horribly inefficient his use of unnecessary mathematics is making things. So I don't see any real mathematical insight to be gleaned from that problem; I just see a lot of ambiguity that leaves the students worse off in the end. I see an older math teacher gradually losing touch with the modern world, struggling to explain concepts of graph theory to uninterested youth and desperately trying to tie in real-world examples to make the problem seem more interesting. While that's a good thing to do in theory, it's actually quite harmful in practice when the real world example doesn't make any sense. And take my word for it--in this particular case, it just doesn't make any sense.
First of all, he's omitted some very important details. Keep in mind that my phrasing of the problem above is not at all a verbatim quote, and from what I recall, one central point of confusion for the students was whether or not we should count the host computer as a "computer". For the sake of clarity, the question should explicitly label each reference to a computer as either the "host" or a "client," rather than using a broad term. It seemed to be asking to connect each client computer to 2 other client computers as well as the host computer, although they didn't really explain that well. So which is it? Do we connect each computer to 2 other clients + the host = 3 computers total? Or do we just daisy chain the host in there somewhere, essentially making it indistinguishable from any of the client machines? The latter option wouldn't really make sense, because it'd be extremely difficult to configure any of the clients not directly connected to the host to even recognize it as a host. Plus you'd have to have all of the computers powered on at all times for that to work, and even then, if any one of them had any hardware issues, all machines further down the line would lose connectivity.
And what about the printers? Are these the low-budget, only-has-one-USB-connection type of printers you'd find in a retail store? Or are these full-blown network printers? If they're the former, then they can only possibly be connected to one computer at a time, so the quick answer to the question is: no, you cannot connect each client to a printer. But even if you could somehow hack together some sort of one-to-many, direct plug connections with printers to computers, why would you? There are much easier and better solutions. You'd connect each printer to a single computer (and if you had any sanity to your setup, all three printers would be connected specifically to the host--though this would not be strictly required), and then configure them as "shared printers" on the network. But in an office where you need 14+ workstations, the likelihood of buying three low-end printers is already quite low; you would more likely get network printers which would be connected to the network at large and not directly to any computer (though you would still install the printer drivers on the host computer and allow it to act as a controller). But I suppose this doesn't fit well with the graph theory model to suggest that we don't have the printers attached to any computers directly.
So the real question at this point should start to become a little more clear, namely: what the hell does the author actually want us to learn? It's important to recognize that he clearly has a very misinformed view of how computer networking works, and instead try to abstract the problem into something meaningful. If our goal is to connect each object to no more than two other objects, then I don't really see the point. Clearly you can line the computers up in a circle and daisy-chain them together. That's easy. And with the additional (potential) requirement of each one connecting to the host and a printer, you just throw them in there somewhere as well. Here we have to abandon our sense of real-world common sense and assume that printers can magically have as many computers plug into them as is desired, when in actuality (as mentioned above), they would only ever allow one input connection--either direct USB through a computer or indirectly over a network. So our messy graph theory diagram might look something like this:

But again, I don't really see what the point of this would be. If all this exercise is intended to do is to get students to be able to line up things in a circle, then it seems completely trivial and a waste of time. If that was really the lesson, perhaps the class would be better suited standing in a circle holding hands to the benefit of any bodily-kinesthetic learners in the class. Although I suppose that hand-holding is probably considered sexual harassment nowadays, so scratch that. Looking at that diagram above produced from the problem, the real question we should be asking is: what the fuck is wrong with our IT department?! If we are directly connecting computers as the problem implies, there are still more problems this creates. First, computers typically only have one network card. If we are connecting them directly to each other, in any interpretation of the setup described, we will absolutely need at least two network cards in each computer (if not three).
From there we would either connect each node directly together with crossover cables, or we would need to place 2-port switches between each connection. I should probably be tarred and feathered for even mentioning the possibility of using crossover cables as such in a business environment, so forget that I even said that and stick with using 2-port switches. But let's not forget that 2-port switches don't actually exist; they generally only come in multiples of 4 or limited multiples of 5. So we'll get a bunch of 4-port switches to connect in between each pair of client machines. We might use the third port to also connect the host, but the problem now is that we potentially have redundant connections to the host, as each computer is connected to two different switches on two different network cards, yet each switch might have its own connection to the host. Fortunately, since we have an even number of nodes, if we daisy-chain them all into a loop, then we can alternate switches to also be attached to the host computer. If the problem had an odd number of clients, though, we'd be fucked. What I've described so far would look something like the diagram below. The hexagons are switches. And keep in mind that I'm not even bothering with printers on this one.

Next logical question: how the hell are we assigning unique IPs to each of these computers? We can only have one DHCP client (which is why I've chosen switches instead of routers), so is the host computer somehow magically handling this? That seems exceedingly complex, and would require it to have eight (yes, 8!) network cards installed (one for the internet), which is downright ridiculous. Of course I could modify my diagram above and have each switch feed into a central router that is also connected to the host. That would be reasonable (all things considered) and would no longer require the host to have eight network cards. But even still, this is getting exceedingly complex. The fact that we've got 14 machines with 2 network cards each is insane. And do we really want to buy fourteen 4-port switches when we'll only ever be using two ports on half of them and three on the other half? Who in their right mind would set up a network that way?
If you want to know how this would be done in the real world, it's actually quite simple. We'd have a server room that contains the host and a clusterfuck of network equipment, like most businesses do. There you would have your 24-port switch (instead of fourteen individual switches), your router, any firewalls and spam filters you might like, and your host machine. The host machine would act as the domain controller running Active Directory on a Windows network, or do something similar on a *nix-based network. There would be absolutely no daisy chaining. Each client would just be plugged into the one central switch, which allows it to connect to the host or to any other client machine. The printers would all be network printers and would similarly be connected to the switch and controlled by the host. Nice and simple. Here's the final diagram.

As you can see, we don't need to even think about using graph theory in this practical, real world example. We just get a switch with enough ports to accommodate all of our machines and peripherals (and then some, so we can always add a few more), and then just plug in everything and go. Graph theory should never enter into the equation. So now I kind of hope that at least one of the students in that class, or even the regular teacher, might see my analysis of that confusing problem here. The students have every right to question it. Whatever "right answer" was intended to be produced, I can assure you it was not all that "right." I understand that math is a mostly theoretical field which makes it sometimes difficult to tie in a broad range of real-world examples. But even so, this example just makes it look like the author isn't even trying. That was a terrible example, and I think it does more harm than good to ask a student something like this, because if they're in the least bit tech-savvy they should be able to tell you "you're doing it wrong," or simply fail to come up with any intelligible answer out of shyness.
If this question was intended to hint at some discussion of star topology versus ring topology between interconnected routers (not computers!), then maybe you'd have something worthwhile. But generally speaking, you would never connect two client computers directly to each other. You would connect them to a larger switch or router which has a host controller attached at some point, and that router may be connected to further routers. A much better question would have been from the perspective of an internet service provider trying to connect a number of network clusters. That question would probably have a number of parallels with the current question, but would have been substantially better seeing as it actually makes sense to ask that. Connecting different routers together that have to share a "host" connection to the outside world is an actual, meaningful problem with real world applications. Connecting 14 client machines in an office directly through one another is not.
Unfortunately it's questions like these that contribute to a general loss of interest in schoolwork. Because if the author is trying to illustrate all the uses mathematics has in the real world, he should probably, you know, make sure that his real world examples are actually plausible. Otherwise, what's the point? Lastly, a quick shout out to an online web app called Autodesk Draw, which is fantastic for making Visio-style diagrams if you don't actually have Visio and don't feel like paying any money. But anyways, the lesson to walk away with is that your high school teachers might not have a clue what they're talking about. Don't trust that they do, kids.
I'm pretty sure my network card can flip into auto-crossover mode.
Not that I ever use the network card on my computer.
I like it a lot! I don't think this guy was very old. Actually, he seemed pretty on the ball. However, he committed a big crime by cranking out that quiz and not double checking it for clarity of instruction. Did you hear the kids shout "thank you" to you at the end of the phone call?
Thank you, indeed, sir!
Thank you, Antoine, for your unending pedantry. =P