Hacker Newsnew | comments | show | ask | jobs | submit | CarolineW's comments login

"Oh no, not again ..."

I can only repeat what I said on one of the many previous occasions this has been mentioned:

Dreadful - absolutely dreadful. It starts so well, then just turns into a thinly veiled rant/diatribe/spiel about an overly optimistic forecast of what the future could, but won't, be like.

Bad writing, bad philosophy, bad predictions. Just awful.

https://news.ycombinator.com/item?id=5195925

https://news.ycombinator.com/item?id=2828736

-----


More accurately - "A few things I've found useful when traveling." They're not essential, but I freely admit that experience tells me they are useful.

But the title as it stands is classic click-bait hyperbole.

-----


The fact that it's a fixed point comes from the triplke angle formula just a few lines above. Substitute and simplify, and you'll see that f applied to sin(1 deg) returns sin(1 deg).

As to why it conveges when iterated, starting from a value that's close enough, that's a different question. Is that what you actually intended to ask?

-----


Yes.

-----


This doesn't scroll vertically on the Blackberry browser. You have to sweep right to find the special scroll bar, click on that (hoping you don't miss), and then sweep back left to read the new text. A few iterations and I gave up. Maybe I'll read it later, maybe not, but the page is, for me, a usability disaster.

Designers - please consider using widely tested techniques and systems so you are at least aware of the people you exclude.

-----


the whole page is an iframe for this: http://homepage.ntlworld.com/edmund.grimley-evans/bcompiler....

-----


It's in the intersection of linear algebra and number theory, and knownm to be difficult. In effect it's a Diophantine equation, and most problems in that field have no generic techniques to solve them. I think Integer Programming is known to be NP-Hard, but I can't check that from here.

So no, there is no general technique apart from ingenuity, clever guesswork, and trial and error.

-----


> apart from ingenuity, clever guesswork

That's what I'm asking though: what is the ingenuity or cleverness required to solve this problem? The only technique I can think of is guess and check.

-----


In this particular case it's pretty easy because you know you'll be working with small numbers, so once you establish tighter bounds the work to 'guess and check' will be small.

This 'bound tightening' is the 'ingenuity' required for the problem. There's no general process to achieve that, which is why it requires ingenuity :)

SPOILERS BELOW

To do that you have to notice the common factor in the initial equations.

Let n1, n2, and n3 be number of chickens sold pre-lunch time by each farmer. The initial equations are:

  n1*x + (10-n1)*y = 35
  n2*x + (16-n2)*y = 35
  n3*x + (26-n3)*y = 35
Transforming them a little:

  n1 * (x - y) + 10y = 35 ;[1]
  n2 * (x - y) + 16y = 35 ;[2]
  n3 * (x - y) + 26y = 35 ;[3]
The common factor of (x-y) looks useful; you can establish relationships between n1, n2 and n3 with it:

  (n1 - n2) * (x - y) - 6y = 0  ;([1] - [2])
  (n1 - n3) * (x - y) - 16y = 0 ;([1] - [3])

  (n1 - n2) =  6 * (y / (x - y)) ;[4]
  (n1 - n3) = 16 * (y / (x - y)) ;[5]

  (n1 - n2) = 3/8 (n1 - n3) ;[6]
If you get there the puzzle is basically solved but for a bit of number crunching - you know n1, n2 and n3 are positive integers, n1 <= 10, so for [6] either n1=n2=n3 (trivial 0-post-lunch-price solution) or n1 - n2 = 3, n1 - n3 = 8. From there you substitute back into [4] and get 3 * (x-y) = 6y, so x = 3y.

You now have simple relations between n1, n2 and n3; as well as between x and y. The remaining step is to tie x or y to one of the n's by substituting into initial equations. For example from [1]:

  n1 * 2y + 10y = 35
  2y = 35 / (n1 + 5)
y must be integral in pennies; that part is tricker to derive and the simplest solution is to just notice that since n1 >= 0, and n3 >= 0, and n1 = n3 + 8, then 8 <= n1 <= 10, and try 8, 9 and 10 for n1. With n1 = 9, you get y = 1.25. That's the only 'guess and check' part of the problem.

-----


Quite often swathes of the search space can be eliminated or winnowed by using modulo arguments. You can also sometimes fold these problems into smaller spaces by considering equivalence arguments. There are many ad hoc techniques that no one has yet classified or unified, they are scattered across many mathematical disciplines.

-----


If you assume that then I think you find the after-lunch price is 0, which is unrealistic. There are other solutions, and your task is to find one that's reasonable.

-----


It seems reasonable to require "real world" conditions. Non-zero prices, whole cent prices, integral chickens per sale, non-negative chickens per sale, etc. With those, the solution is unique, and in part, that's what makes this problem interesting, hard, surprising, and with its own elegance.

-----


Alternatively:

  find -type f -exec md5sum '{}' ';' | sort > md5.out
  gawk '{print $1}' md5.out | uniq -c | gawk '$1>1' > md5.dups
  for m in $( gawk '{print $2}' md5.dups )
  do
    grep ^$m md5.out
    echo
  done

-----


No, your email is not in your profile. In fact, your profile is empty. Your email is in the email field, which only the admins can read.

-----


Ooh, I didn't realize that either

-----


Print version to avoid pagination and ads:

http://www.washingtonpost.com/wp-dyn/content/article/2008/02...

-----

More

Guidelines | FAQ | Support | API | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: