View Full Version : Math: solving outcomes...

04-09-2003, 11:52 AM
Excuse me for being a little off topic as my problem has to do more with math than with programming (though I wouldn't mind if someone would make me an application from this). The one thing that this has to do with programming is that in this one needs to describe a problem (isn't that what programming is all about?) and I fail to do so - analytically. But here's what I got (to get to the point): I need to solve how many different graphs I get when

a) The grid where the graph is drawn is a hexagon with a vertical line splitting and two horizontal lines going through, so it looks like this

/|\ Here two (back)slashes represent one
/_|_\ and two overlapping '|' equal one
|_|_| (needed to get those undescores to fit)
\ | /

So there is a 13 possible lines that can be drawn to the grid

b) The graph is drawn from a single line (so every line drawn in to the grid is connected to another)
c) There can be no branches in the graph (and therefore the line can't cross itself)
d) The graph must go to every four part of the grid (E,W,N,S) at least once
e) (And to make it easier - and still just enough for my needs) the graph must be drawn so that no lines can be added to it without breaking the rule c
x) And if it's not too much trouble no graph can't be the mirror and/or flipped image of another graph

Here's a few example to (hopefully) make it a bit clearer (hope this fits to your screeen):

/\ The simplest /\ Wrong, /|\ Wrong, \ Little bit / Wrong,
/ \ outcome / \ south / | \ branches ___\ advanced / line is
| | |__| is not | | | at north | graph | not
\ / reached \ | / and south \ / / coherent
\/ \|/ \/ /

I've done some programming myself, a simple sokoban-game, game of life and that sort of stuff but I find this problem to be just a bit too much for my skills. So, what I'm asking for you to do is... Well I actually don't know what I'm really asking - the best you could do is to solve every graph according to my rules (my guess is that the number of these is a bit over twenty). But I'd also appreciate if you could tell me the exact number of all possibilities. If you do know how to solve it, but are lazy enough to not do it, please tell me and I'll do the work. Perhaps a simple snippet that produces these graphs would do so verifying the x condition would be a hell of a lot easier than it would be by twiddling just numbers.

If you've have gotten this far I thank you for your time and wish you good luck if you are to try solving this. Cheers!

04-09-2003, 12:12 PM
Two things:

One: I have moved this post here from the C Programming board because I think it's more fitting here.


Please do not ask people to do your homework for you. People are more than willing to help you, but they aren't going to do your work for you. If you have a question about a concept, please ask, but be specific as possible. Simple problem with code or how to do something specific? Post your code and people will be more than happy to help you.

Please read the board Guidelines and Homework Announcement (http://cboard.cprogramming.com/announcement.php?s=&forumid=3) for more information on what is appropriate.

I would also take this time to remind everyone that most schools have honor codes. I don't know what other's are, but please remember this. This site takes no repsonibility for people cheating. Personally I hold honor very highly and strongly discourage broad homework questions, ligitament or not. I am not your babysitter however. Ask at your own risk.

If you have any questions you are more than welcomed (and encouraged) to PM me (http://cboard.cprogramming.com/member.php?s=&action=mailform&userid=2) me and ask. I promise I answer hehe.

NOTE: It's been pointed out to me that this could be a problem out of a book that you are just learning on your own. If so I appologize. Still, What have you got so far so people know where to start helping you?

Good Luck,
Lead Moderator

04-10-2003, 06:55 AM
Homework...? Ah, perhaps it seems like that for you, but I'm a bit offended - well you couldn't know and I intentionally didn't mention my goal (but sorry for the cross-posting - I did take a minute to pick the forum, but...)

I'm about to write a book - a fantasy one. This thing I'm now developing is totally based on those hexagons (darn, those were hexagons - my nick has failed). Er... Excuse me for being a bit of few words but in a fear of plagiation I'd like to keep the rest of my own (there is a lot of people in these forums).

I also mentioned that this is not so much a programming question, although making an application would certainly help (at least to me - playing just with numbers is just too much for me). The one thing I really need is the graphs of what I asked. That is enough for me to complete this part. But I wouldn't mind either if one would explain how this problem is solved - this is just for my own fun (and definitely not for some teacher).

I've been trying to solve this with pen paper and think that I now have it - that is 17 graphs - but I can't be 100% sure.

Perhaps an answer that forgots the condition e and x would do (isn't that mathematically a hell of lot easier to do) as I can check what I now got as that result is what I'm really after (but what can be easily derived from those graphs which obey condition e and x) - sorry bout the heavy clause :)

Anyway, once again my apologies for crossposting and hopefully the embarrasing misconception about homework is now corrected.