From: "David Hruska" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fall 2012 MATLAB Contest: October 31 - November 7
Date: Mon, 5 Nov 2012 10:33:22 -0500
Organization: MathWorks
Lines: 33
Message-ID: <k78m84$ft8$>
References: <k4v77h$im6$> <k6ribc$5k7$> <k6rqll$8o4$> <k6s0f8$2o0$> <k6sd64$guk$> <k78ilf$qu$>
Reply-To: "David Hruska" <>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1352129604 16296 (5 Nov 2012 15:33:24 GMT)
NNTP-Posting-Date: Mon, 5 Nov 2012 15:33:24 +0000 (UTC)
In-Reply-To: <k78ilf$qu$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:782077

> Hi,
> I think there is still something wrong with number of knots.
> One of the rule is "A node sitting directly on a line counts as two 
> knots."
> For simple set of 4 points:
> xy=[-1,0;1,0;0,1;0,0] and a=[0     1     0     0
>     1     0     0     0
>     0     0     0     1
>     0     0     1     0];
> number of knots should be 2, but numKnots returns 1
> and for xy=[-2,0;2,0;-1,0;1,0]; and the same matrix a (one line in other) 
> it should be 4 knots, but numKnots returns 1
> PozdrawiAM -
> Andrzej

Hi Andrzej,

Thanks for pointing this out. Indeed there is a bug; however, it turns out 
it's the rules that are not quite right. Any given pair of line segments can 
intersect at most one time. If a node is sitting directly on a segment, that 
still counts as just one intersection.

When we wrote the bullet point "A node sitting directly on a line counts as 
two knots" we must have been thinking about the example in the rules where 
each node is connected to two other nodes. In that specific case, the 
statement makes more sense but it is not correct in general.

Hope this helps.

MATLAB Contest Team