Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

single line graph puzzle 1

Status
Not open for further replies.

Olaf Doschke

Programmer
Oct 13, 2004
14,847
DE
How can you connect these nine points with a line drawn in a single stroke with only four segments!

Code:
.       .       .



.       .       .



.       .       .

Here's an exemple on how it does not work, because the left middle point is not on the graph.

Code:
.-------.-------.
 \_             !
   \_           !
     \_         !
.      \.       .
         \_     !
           \_   !
             \_ !
.-------.------\.

Bye, Olaf.
 
Code:
[COLOR=white white]
                     _/|
                   _/  |
                 _/    |
                /      |
       .       .       .
        \_   _/        |
          \_/          |
         _/ \_         |
       ./     \.       .
     _/         \_     |
   _/             \_   |
 _/                 \_ |
/______._______.______\.
[/color]

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
Code:
[COLOR=white]
[!].[/!]_______[!].[/!]______[!].[/!]________
!\_                   _/
!  \_               _/
!    \_           _/
[!].[/!]      \[!].[/!]       [!].[/!]/
!        \_   _/
!          \_/
!         _/ \_
[!].[/!]       [!].[/!]/     \[!].[/!]
!     _/
!   _/
! _/
!/
[/color]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
yes, correct. That puzzle seems to be known.

It's a good example of thinking outside of the box.

Bye, Olaf.
 

This scales up nicely:

3 x 4 dots with 5 lines
4 x 4 dots with 6 lines
4 x 5 dots with 7 lines
etc.
 

BTW, there are at least three distinct solutions (not counting rotations and reflections) for the 4 x 4 with 6 lines. See if you can find all three.

Side note: I once had an employee that went to a class where the instructor used the classic 3 x 3 to teach "think outside the box" and unless she heard wrong, the instructor stated that the 4 x 4 square does not have a solution. Moral -- Don't believe everything that your teachers say: Check things out for yourself.

 

>That puzzle seems to be known.

Yes, since years and years ago ...

But I never saw the others what Zathras has posted.
 
Zathras said 6 lines. Havent experimentetd much, but perhaps that's without the single line rule, drawing the solution with a single stroke.

Bye, Olaf.
 

No, no. Single line. Just like the 9-dot version.

3 x 3 = 4 lines
3 x 4 = 5 lines
4 x 4 = 6 lines
4 x 5 = 7 lines

all with the same rules... each dot once and only once, connected lines (i.e., without lifting up the pencil.


Follow-up on the 3 x 3... when presented to young children, it is amazing the creativity they can demonstrate (before the school system burns it out of them).

A couple of examples. One child noticing that the dots were hand drawn and therefore not exactly on grid coordinates saw that three lines could be used in a Z-shaped pattern with the lines joining at a distance on the right and left of the pattern.

Another, noticing that the dots were drawn on a page of a "flip chart" and that the dots had dimension (again, hand drawn) and the drawing implement was a rather broad-tipped "magic marker" simply folded the paper upwards such that the dots from the second and third rows nearly overlapped the dots on the first and solved the problem with A SINGLE LINE!!!

 
3X4 would be like such:

.----.----. .
\ /|
\ / |
. . . .
| \ / |
| /\ |
. . . .
| / \ |
|/ \|
 
Thinking literally outside the square, here's another possibility...

Let the points be named:

[tt]A B C

D E F

G H I[/tt]

Line 1: E to B
Line 2: Circle, from B, through D, H, F and back to B
Line 3: B to C
Line 4: Circle, from C, through A, G, I and back to C


Max Hugen
Australia
 

I'm surprised there are no takers on this one.

The problem also extends to 25 dots in a 5x5 square with 8 lines. (At least 2 distinct solutions. - Easily derived from two of the 4x4 solutions.)

I tried to find answers to the 4x4 with Google, but couldn't find any. Is it really possible that this is something new under the sun?

 
Here, 8 lines, hard to draw.
. .___.___.___.___
| | _/
.___.___.___.___./__
|\__|_ _/ _/
. . \._ ./ ./
| | \/___/
. . ./ ./\_.__
| | _/ _/ \___
. ./ ./ .___.______\
|_ /|_ /
/ /

[monkey][snake] <.
 

Sorry monksnake, that doesn't look like a valid solution.

It's hard to see, but it looks like at least one dot is being visited more than once. For example, the first dot in the second row looks like it is on three different line segments. See previous post... Each dot must be visited once and only once. You've got the connected line segments part right, though.

Multiple dot visits:
Row 2 column 1 (visited three times)
Row 2 column 2 (visited twice)
Row 2 column 5 (visited twice)
Row 5 column 2 (visited twice)

I would suggest starting with the 4x4 and then scale up.

 
I didn't realize, (based on the other posts) that a dot could only be visited once.

[monkey][snake] <.
 

That's why it's such a tough puzzle.

There are three distinct solutions to the 4x4 and at least 2 to the 5x5.

Two of the 4x4 can scale up to 5x5.

I have not yet found a solution to 6x6. My hope is to find a solution that scales up to nxn. Theoretically, if a solution can be found that has an end outside of the graph and doesn't pass thru "virtual" dots outside of the graph, then it would be possible to scale up to infinity with a square spiral. At least, that's what I'm looking for.

 
One 4x4 Solution
[tt]1 0 A B C D 0 2

0 0 E F G H 0 0

0 0 I J K L 0 0

0 0 M N O P 0 0

0 0 0 0 0 0 0 0

0 0 3 0 0 0 0 0[/tt]

N to H (N,K,H)
H to E (G,F,E)
E to 5 (I,M)
3 to 2 (O,L)
2 to 1 (D,B,C,A)
1 to P (J,P)
 
4x5 Solution
[tt]~_ _
| | | |
| | | |
| | | |
| |_| |[/tt]

About the same as the 3x4 solution.
 
5x5 Solution
[tt]. 1 A B C D E 2
.
. F G H I J
.
. K L M N O
.
. P Q R S T
.
. U V W X Y 4
.
.
.
. 3[/tt]
L to V (L,Q,V)
V to J (R,N,J)
J to F (I,H,G,F)
F to 3 (K,P,U)
3 to 2 (W,S,O)
2 to 1 (E,D,C,B,A)
1 to 4 (M,T)
4 to X (Y,X)
Moving one step further, a 5x6 solutiong would be like 3x4 and 4x5.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top