# Maximum PC

 It is currently Tue Apr 21, 2015 1:25 pm

 All times are UTC - 8 hours

 Page 1 of 1 [ 9 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: The Countdown ProblemiePosted: Mon Oct 04, 2010 6:33 pm
 Bitchin' Fast 3D Z8000*

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
I came across this problem watching a MSFT video. Personally, I think that it looks pretty interesting...

Problem: You are given six positive "source" numbers and a final answer. All of these will be natural numbers. Using the standard arithmetic operators (ie + - * /), construct an arithmetic statement using the source integers that is equal to the answer.

Constraint 1: All intermediate calculations must result in positive natural numbers.
Constraint 2: You may only use a source number one time; However, you're not required to use all of the source numbers.

Example: Given source = {2 5 9 12 18 40} and answer = 50. One possible answer is 5 * 18 - 40.

Any takers? =)

Top

 Post subject: Re: The Countdown ProblemiePosted: Tue Oct 05, 2010 6:27 am
 Java Junkie

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24245
Location: Granite Heaven

Since you don't have to use all of the source numbers, my first pass would be to find the factors of the answer and play with those.

Top

 Post subject: Re: The Countdown ProblemiePosted: Wed Oct 06, 2010 4:01 am
 Bitchin' Fast 3D Z8000*

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
As usual, the brute-force solution is pretty obvious, but I'd really like to come up with a method for finding a minimal length solution quickly (other than using BFS). I keep thinking that a best first search might be pretty good -- not sure though.

I went ahead and watched the rest of the Channel 9 video, which kind of took a turn for the worse. The problem went from finding a single solution to counting all solutions. Fine. Of course, the initial program wasn't fast enough otherwise there wouldn't have been much point in posting the video. Of course, this was exaggerated because the author was trying all permutations of length 6, so he suggested chopping down the search space by not computing the invalid expressions. A pretty obvious todo when using search except he didn't search and called it "program fusion".

He further sped up the program by eliminating equivalent expressions (ie 1*2*3 = 1*3*2 = 2*1*3 = 2*3*1 = 3*1*2 = 3*2*1) , but conveniently neglected to keep the same counting method (ie returning 1 now instead of 6 as before).

Also, I believe his program would have returned 1*2*3 instead of 2*3. Oh well. The problem is still pretty interesting. =)

Top

 Post subject: Re: The Countdown ProblemiePosted: Thu Oct 14, 2010 5:40 pm
 Bitchin' Fast 3D Z8000*

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Have you thought about it anymore? Just curious, how big of a boat would I need to travel the oceans of this world safely?

Top

 Post subject: Re: The Countdown ProblemiePosted: Thu Oct 14, 2010 8:16 pm
 Java Junkie

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24245
Location: Granite Heaven
40'+ monohull, 35'+ cat .. assuming you're taking the safest passages across bluewater

Top

 Post subject: Re: The Countdown ProblemiePosted: Sat Oct 16, 2010 11:51 am
 Bitchin' Fast 3D Z8000*

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
If I move back to LA, I'm considering buying a boat and just living in the marina (Marina Del Rey). 40' is a big boat... I'm not sure if I want to Google the slip fee.

Top

 Post subject: Re: The Countdown ProblemiePosted: Sat Oct 16, 2010 5:42 pm
 Java Junkie

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24245
Location: Granite Heaven
40' is also quite large for someone to single-hand ... if you have a partner, you'll be ok but alone that is a LOT of boat to handle.

Of course, you'd never make a bluewater passage alone .. right?

A liveaboard is a great idea .. I'd look into a cat in that case, though. More than twice the available space for the same beam.

Top

 Post subject: Re: The Countdown ProblemiePosted: Sat Oct 16, 2010 11:14 pm
 Bitchin' Fast 3D Z8000*

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Jipstyle wrote:
Of course, you'd never make a bluewater passage alone .. right?

What's this?! I thought you were looking forward to ski season!

Jipstyle wrote:
A liveaboard is a great idea .. I'd look into a cat in that case, though. More than twice the available space for the same beam.

I didn't know that... good to know!

Top

 Post subject: Re: The Countdown ProblemiePosted: Mon Oct 18, 2010 9:04 am
 Java Junkie

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24245
Location: Granite Heaven
Jipstyle wrote:
Of course, you'd never make a bluewater passage alone .. right?

What's this?! I thought you were looking forward to ski season!

I wasn't actually offering to come with (though .. woo!) .. just pointing out that any time you leave shore, you have to have someone on watch at all times. The passage from LA to Hawaii, for instance, is over 2000 knots .. given an average speed of 6 knots / hour for a monohull in bluewater (12 for a cat), you're looking at 2 week passage in bluewater. Unless you can stay awake for 2 weeks ... you really need a second hand on board.

Quote:
Jipstyle wrote:
A liveaboard is a great idea .. I'd look into a cat in that case, though. More than twice the available space for the same beam.

I didn't know that... good to know!

Cats are fantastic. Faster, more stable, easier to sail and far more space. Also far more expensive.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 9 posts ]

 All times are UTC - 8 hours

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Maximum FAQs    Forum Rules, Posting Guidelines & Announcements    The Good, The Bad & The Banned    FAQs Help/Do It Yourself    PC Building Lab    The Help Desk    PC Modding    Education & Certification Hardware    Nuts & Bolts    Portable Talk    Appraisals, Deals & Bargains (oh my!) OS/Software/Programming    Windows Parlor    Alt.OS.Abode    Games Arena    Programmers' Paradise Networking/Internet    Internet Truckstop    Network Nook In/Out    Magazine and Book Feedback    Forum & Website Feedback    Dog Pound Team Maximum PC Folding at Home    Team Maximum PC - Folding at Home - FIND CURES TO DISEASES    Team MPC - Folding Gauntlets