From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cee6b97ef93f6732 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-22 09:17:27 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Al Christians Newsgroups: comp.lang.ada Subject: Re: Programming Contest Date: Sun, 22 Jul 2001 09:21:19 -0700 Organization: Public Property Software Message-ID: <3B5AFD7F.9C7D24D1@PublicPropertySoftware.com> X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:10420 Date: 2001-07-22T09:21:19-07:00 List-Id: AlZimmerma@aol.com wrote: > > Mario, > > Thank you for your interest in the Darts Contest. > > > ". . . the 5 areas have values (1, 2, 4, 7, 11). Then the smallest > > unattainable score is 27." > > > > I don't get it. If the three darts hit 11, isn't the (attained) score 33? > > > > And isn't the smallest unattainable score = largest attainable + 1? > > > > And so wouldn't values (Infinity, ...) be a trivial solution to any N? > > > > What am I missing? > > It isn't true that smallest unattainable score is exactly one more than the > largest attainable. > > In the example, you are correct that 33 is the largest attainable score. But > there are a few scores smaller than 33 which cannot be attained. And 27 is > the smallest of these. > > To see this, observe that scores from 1 through 26 are demonstrably > attainable: > > 1 = 1 > 2 = 2 > 3 = 1 + 2 > 4 = 2 + 2 > 5 = 1 + 4 > 6 = 2 + 4 > 7 = 7 > 8 = 1 + 7 > 9 = 2 + 7 > 10 = 1 + 2 + 7 > 11 = 11 > 12 = 4 + 4 + 4 > 13 = 2 + 4 + 7 > 14 = 7 + 7 > 15 = 4 + 11 > 16 = 1 + 4 + 11 > 17 = 2 + 4 + 11 > 18 = 7 + 11 > 19 = 4 + 4 + 11 > 20 = 2 + 7 + 11 > 21 = 7 + 7 + 7 > 22 = 11 + 11 > 23 = 1 + 11 + 11 > 24 = 2 + 11 + 11 > 25 = 7 + 7 + 11 > 26 = 4 + 11 + 11 > > But there's no way to attain 27. > > Please let me know if this doesn't answer your question. > > Al Zimmermann > It looks to me like this is a problem of searching a huge search space for a good solution. Anyone have any idea if there is any non-brute-force way to construct or find the solutions? Has anyone in this group used Ada to solve such problems? Any features of Ada that made it particularly well-suited? I'm guessing that Lisp and similar languages might be better for writing a program, but that Ada would run a little faster so you could search more in a given time. In particular, Ada is probably much better at pulling a slice out of a list (array) than most of the functional languages, and this might make Ada much faster at generating and evaluating solutions. Any ideas what would work best -- genetic algorithm, simulated annealing, or ??? Al