Author Topic: Facebook Puzzles  (Read 4031 times)

0 Members and 2 Guests are viewing this topic.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Facebook Puzzles
« on: February 15, 2009, 03:30:46 am »
Has anyone else attempted any of these Facebook programming puzzles? Location: http://www.facebook.com/jobs_puzzles/index.php

I've submitted several of them but finally got stuck on one. They're pretty fun, though.

I'm stuck on this one, btw: http://www.facebook.com/jobs_puzzles/index.php?puzzle_id=2
http://www.chyea.org/ - web based markup debugger

Offline sdfg

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Facebook Puzzles
« Reply #1 on: February 15, 2009, 08:27:05 am »
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.
dey see me trollin'
dey hatin'

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Facebook Puzzles
« Reply #2 on: February 15, 2009, 01:16:58 pm »
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.

This is rather vague.  The part you mentioned is obvious.

This is basically a variant on the subset sum problem.  I would imagine that dynamic programming would probably be the way to go.  (Yes, I realize this is vague too. :))

Offline Newby

  • Moderator
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Facebook Puzzles
« Reply #3 on: February 15, 2009, 03:04:50 pm »
This is pretty neat. :)
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Facebook Puzzles
« Reply #4 on: February 15, 2009, 03:38:05 pm »
I found the one you're stuck on to be pretty straightforward. Basically, find the dollars per pound value for each, compare, then use whatever is least costly.

This is rather vague.  The part you mentioned is obvious.

This is basically a variant on the subset sum problem.  I would imagine that dynamic programming would probably be the way to go.  (Yes, I realize this is vague too. :))

Yea. That's what I basically concluded last night and have been doing some reading on it. I'm going to make another attempt at it soon. Hopefully I don't spend hours on it like I did on some of the others.

Sdfg, your response was pretty obvious. That's pretty much what the exact problem says to do. The word problem isn't where I was stuck, heh.
http://www.chyea.org/ - web based markup debugger

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Facebook Puzzles
« Reply #5 on: February 15, 2009, 05:44:20 pm »
Hehe, yeah.  There's a "pseudo-polynomial" dynamic programming solution to the subset sum decision problem, but it's worth noting that it's still an NP-complete problem.