comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Marble Clock
Date: Sat, 13 Apr 2013 15:04:38 -0400
Date: 2013-04-13T15:04:38-04:00	[thread overview]
Message-ID: <ni9jm8lldnc7qhre63245gqtbn65ieaqaa@invalid.netcom.com> (raw)
In-Reply-To: e3763890-38c3-4fe2-a776-726e77f53528@googlegroups.com

On Fri, 12 Apr 2013 15:28:42 -0700 (PDT), gattamaneni abhiram
<abhiram.gattamaneni@gmail.com> 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/


  parent reply	other threads:[~2013-04-13 19:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02  0:09 Marble Clock gattamaneni abhiram
2013-04-02 12:02 ` John B. Matthews
2013-04-02 19:46   ` gattamaneni abhiram
2013-04-02 19:54     ` Eryndlia Mavourneen
2013-04-03  9:14       ` Simon Wright
2013-04-03 12:45         ` Eryndlia Mavourneen
2013-04-03 16:53         ` Simon Wright
2013-04-12 22:28         ` gattamaneni abhiram
2013-04-13  5:51           ` Simon Wright
2013-04-13 19:04           ` Dennis Lee Bieber [this message]
2013-04-03 11:52     ` John B. Matthews
2013-04-03  7:44 ` Mike H
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox