This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programming Diversions and the fly likes Smallest number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Smallest number" Watch "Smallest number" New topic
Author

Smallest number

HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
of disks ?
What is the smallest number of disks that need to be moved to make the triangle point downwards ?
[B]

[/B]
[ August 26, 2003: Message edited by: HS Thomas ]
Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
Three.
Assume they're numbered like this:
---0---
--1-2--
-3-4-5-
6-7-8-9
-------
Then we'll move 0, 6, and 9 like so:
-------
6-1-2-9
-3-4-5-
--7-8--
---0---
I don't know how to prove that we can't do it in two, though.
(Edited to fix spacing.)
[ August 26, 2003: Message edited by: Roy Tock ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

None, turn your monitor
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I would argue that since DOM is in Oz, his monitor is probably already turned downward. No extra effort required.


"I'm not back." - Bill Harding, Twister
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

:roll: Serves me right, I guess.
I keep meaning to find the lattitude/longitude for the Ranch to see how close I am to the opposite side of the globe.
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
lattitude/longitude for the Ranch


Using GMT time differentials and using , the options are
GMT - 7.00 So the options are :
US & Canada (Mountain Time)
Chihuahua, La Paz, Mazatlan
Arizona
Somewhere sharing a longitude with Arizona , I'd guess.
BTW , the answer posted is right.
Moving two disks you may get it to point anywhere but downward, I guess.
regards
[ August 27, 2003: Message edited by: HS Thomas ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

So the a rough approximation with respect to timezone would be GMT+5?
Hmm, 3 hours off. I think that's halfway between me and India.
Sorry about the hijack!
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
I think that's halfway between me and India.
Sorry about the hijack!

The hijack is ;
I thought you were in Australia. So GMT + (9.5 or 10) should be you.
Once you get past Fiji to the International Date Line you loose a day.
So crossing to Hawaii the time would be GMT - 10.
The time for the JavaRanch posts are GMT - 7 whereever you post from.

How would you work out the latitude of a post.
Better still is there an IP address for the JavaRanch? You could feed it into Norton Visual Tracker.
Server Name: DNS1.EJIP.NET
IP Address: 64.78.181.6
Registrar: BULKREGISTER, LLC.
Whois Server: whois.bulkregister.com
Referral URL: http://www.bulkregister.com
Server Name: DNS2.EJIP.NET
IP Address: 64.78.181.10
Registrar: BULKREGISTER, LLC.
Whois Server: whois.bulkregister.com
Referral URL: http://www.bulkregister.com

from a WHOIS internet registry.
My Alert Tracker isn't working right now (Java applet).
regards
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm the west coast, GMT +8:00 (Dave-Standard-Time, as I like to call it)
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
The time for the JavaRanch posts are GMT - 7 whereever you post from.
No, it's currently GMT - 6. Where do you get GMT - 7? This post will appear at approximately 7:20 GMT - you can do the math from there.
Here are a couple time servers for you:
http://www.worldtimeserver.com/
http://www.timeanddate.com/worldclock/
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
The post appeared at 8;20 GMT. I live about 2 miles from Greenwich.
This post should appear at 8:25 AM
and the time should show 8:25 - 7 = 1:25 PM.
BTW the IP addresses show up as a ISP based in Denver, Nevada, Las VEgas . SO ???
regards
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
I meant 1:25 AM ( in the morning).
So the Javaranch is at GMT - 6 and the hoster is at GMT - 7.
Too expensive to do your own hosting?
How did this question start anyway?
regards
[ August 27, 2003: Message edited by: HS Thomas ]
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11437
    
  87

Yes, but England is currently on summer time (BST), so UTC (or GMT) +1.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Yes, but England is currently on summer time (BST), so UTC (or GMT) +1.

Oops , forgot that.
Does no one else adjust their clocks in the summer ?
Highly recommended !
regards
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Does no one else adjust their clocks in the summer ?
Highly recommended !

Unfortunately the Ranch does, which is why I said it's "currently" GMT-6. Pain in the ass when you're trying to compare to a useful standard like GMT though. Arizona forgoes this nonsense, for which I am glad. Which made it odd that your answer was "same latitude as Arizona" since, while as it happens you were right, the logic was mistaken - other US states in Arizona's latitude do not share its time zone during summer.
Incidentally, most of the pages in the Big Moose Saloon include a notice about the time zone, near the bottom. I've taken pains to make sure it's correct.
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
All times are MDT (US) = GMT - 0600


Yes it would be highly problematic if Wales,Scotland decided not to "Spring forward,fall backwards".
I had used the Date Time facility on Windows that tries to simplify it by location relative to GMT. Catering for BST and other standards would have been too complex.
Mind you have done a good job of it.
BST = GMT + 0100
Must remember the time goes back to GMT soon.
regards
[ August 27, 2003: Message edited by: HS Thomas ]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Mind you have done a good job of it.
Well, I just adjust the message manually - the forum software isn't sophisticated enough to know the difference. I note that Windows' list of time zones does have a separate listing for Arizona, which is helpful. However, despite their labeling, they don't actually have a category for true GMT They just have the time that the people in Greenwich are using. :roll: Java, fortunately, provides options for whatever time zone you want.
Anyway, to answer the original question - the server is actually located in Denver, Colorado. I'll leave it to someone else to figure out exactly where DOM should relocate himself to, in order to be perfectly upside-down in a standard JavaRanch frame of reference.
[ August 27, 2003: Message edited by: Jim Yingst ]
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
Speaking of antipodes...
Has anyone ever seen an 'upside-down' globe? (Jeez, even 'upside-down' is prejudiced, for our 'otherwise-polared' friends).
And it doesn't count to just turn a regular globe over. I'm talking South Pole on top, and when the South Pole is on top, you don't have to do a handstand to read the writing on the globe!
I want one!


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
HS Thomas
Ranch Hand

Joined: May 15, 2002
Posts: 3404
Clever !

Early on, I couldn't understand why having the South Pole on the top would make it easier to read. Bending down over the globe, it certainly does.
The only problem with that is people might start believing that the South Pole was on the top.
A great idea but not very marketable (probably in Australia ? )!
regards
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8815
    
    5
See, that's the thing...
The South Pole IS on top, all these globes are wrong!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Smallest number