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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 13 Apr 2013 14:04:34 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Marble Clock Date: Sat, 13 Apr 2013 15:04:38 -0400 Organization: > Bestiaria Support Staff < Message-ID: References: <7075541f-01b7-4cd4-997f-b0b8048f067d@googlegroups.com> X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.118.117 X-Trace: sv3-pyA0TNr8Nk57W5/SdynFz+AdzihRGuGn9fI2rmX2gYzC/3E/Fwb+C1SuIY8Vu0kUDL9jDnP5Ks8aDCu!nvyxB6VELLQOP3H+Y/0+tDk8IvlrzORJfr7DmOcWdpSzDhkh/Yz6UKURfR7U8SiuthSjd33m6+Ne!YKyregZc2N2Sie8DxkvN0sPqiuczJkvZhp0hB12h27s= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3841 Xref: number.nntp.dca.giganews.com comp.lang.ada:181050 Date: 2013-04-13T15:04:38-04:00 List-Id: On Fri, 12 Apr 2013 15:28:42 -0700 (PDT), gattamaneni abhiram declaimed the following in comp.lang.ada: > Thank You for the help. I completed the coding part using stacks for the trays and a Queue for the reservoir. I am stuck at a point, I need to determine the number of 12-hour cycles the clock goes through before the marbles in the reservoir are back in their original order > (relative to the number of input marbles used to fill the reservoir). Can you help me with this? That sounds more like an exercise in permutation and combinatorial... What really confuses the matter is, based on your original description, the marbles being returned to the reservoir when a tray is emptied will be in /reverse order/ for the tray (you state that a tray empties from the same end it is filled). The inefficient method would be to number the marbles, remove any "real time" delay, run a 12-hour cycle as fast as the machine can process, check the reservoir marble order, and repeat keeping track of the cycles, until the marbles are in order... The efficient method would be to derive some formula for how the marbles get permuted. Maybe determine the minimum number of marbles that can operate a 12-hour cycle and determine how many cycles are needed for that to return to original. Add one marble and see how many cycles that takes. Add a second marble and count cycles. Then see if there is some easy math to handle larger number counts. Is there a progression: did 1 marble over minimum require 720 times the minimum clock marbles (720 minutes in 12 hours), did 2 marbles over take 720 times the 1 marble over... That would indicate that raising 720 to (reservoir - minimum) would give the multiplier to the number of cycles used by the minimum count -- you might need to test for a few larger counts to confirm the hypothesis... 11 hours, 3 15min, 2 5min, 4 min, and 1 to cascade the whole mess -- 21 marbles is the minimum? abcdefghijklmnopqrstu bcdefghijklmnopqrstu a <> <> <> cdefghijklmnopqrstu ab <> <> <> defghijklmnopqrstu abc <> <> <> efghijklmnopqrstu abcd <> <> <> fghijklmnopqrstudcba <> e <> <> ... jklmnopqrstudcba fghi e <> <> klmnopqrstudcbaihgf <> ej <> <> -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/