Live data from Hacker News

My Favorite Math Problem

mapehe.github.io

71–80 of 86 posts

Re: My Favorite Math Problem

#71
post #62

This problem reminds me of another problem. There is a round table and two players, A and B. The players take turns placing a coin on the table in any location they desire, but coins may not overlap. The first person who is unable to place a coin loses. What is the winning first move? Answer: the winning move is for player A to place the first coin in the center of the table. After that, no matter which location play…

Working through this myself... If you place a coin in the center, then due to symmetry there must be an even number of remaining places for a coin (or you didn't put it in the center). You can work up from remaining=2 to see that player A always wins with an even remainder.

It is not fully correct to think in terms of even numbers or remainders, because there are an uncountably infinite number of places that a coin can be placed.

It is the right general idea, but don't try to express it in numbers. Just think that for each non-center point P there is a unique corresponding point P' such that the center point is exactly midway between P and P'. That gets you your pairs of places to work with without having to bring numbers into it.

For a coin placed at the center it covers any given non-center point Q if and only if at covers Q's corresponding point Q'. After the first player plays the center we then have that for every point that is not yet covered that point's corresponding point is not yet covered.

Then you have to show that once the center point has been covered by a coin any subsequent coin played that covers a point R cannot also cover R's corresponding point R'.

Then you can proceed with your pairing argument that whenever player 2 covers a set of points player 1 can cover the corresponding points on the next turn, and that after this we have restored the condition that for every point still available its corresponding point is also still available.

Re: My Favorite Math Problem

#72

I thought this could be about the Monty Hall Problem, which I think is my own personal favourite. It isn't, of course, but I'll share some info here as no one else has raised it so far this thread :-) It's an interesting probability question in its own right, as it has a hugely counter-intuitive correct answer in my opinion. But the sh*storm it caused is equally interesting. Hence I will share this article which cove…

Yeah I remember when I heard about it years ago I actually wrote a simple program to show to myself that the second switching actually helps (yes, it does).

Re: My Favorite Math Problem

#73

I thought this could be about the Monty Hall Problem, which I think is my own personal favourite. It isn't, of course, but I'll share some info here as no one else has raised it so far this thread :-) It's an interesting probability question in its own right, as it has a hugely counter-intuitive correct answer in my opinion. But the sh*storm it caused is equally interesting. Hence I will share this article which cove…

Yeah I remember when I heard about it years ago I actually wrote a simple program to show to myself that the second switching actually helps (yes, it does).

That’s not totally clear, due to the way the problem is often described: As a one-off event, with no clear rules for what the host will do. If there is no clear rule about what the host will do, you are still left in the dark. For example, the host may have decided beforehand (in secret) that he will open another door only if you picked the winning door. In that case, switching will lose you the prize with certainty.

But yes, if it is clearly understood that the host always opens another door after you picked one, you should switch.

Re: My Favorite Math Problem

#74
post #71
post #62

Earlier quoted context omitted.

Working through this myself... If you place a coin in the center, then due to symmetry there must be an even number of remaining places for a coin (or you didn't put it in the center). You can work up from remaining=2 to see that player A always wins with an even remainder.

It is not fully correct to think in terms of even numbers or remainders, because there are an uncountably infinite number of places that a coin can be placed. It is the right general idea, but don't try to express it in numbers. Just think that for each non-center point P there is a unique corresponding point P' such that the center point is exactly midway between P and P'. That gets you your pairs of places to work…

Even though it's uncountable and potentially infinite, it's still even, because of exactly the symmetry relation you're saying.

I just thought that the intuition for an even number of places is a lot easier (for me) to grok.

Re: My Favorite Math Problem

#75
post #63

I like the infamous Von Neumann "Fly and the trains" math/physics problem - mainly because it's very easy to solve the easy way, or you can go about it the harder way. And apparently Von Neumann did it on the spot, the harder way, almost instantaneous. It goes like this (stolen from a website - there are many variations on this): Problem: Two trains are on the same line, 60 miles apart, heading towards each other, ea…

Reminds me of the ants-on-a-stick problem. 100 ants are spaced evenly on a 1m stick. They travel at 1m/minute. When an ant bumps into another ant, they both turn around and go the other way. When an ant reaches the end of the stick it falls off. How long before all the ants fall off?

That's not solvable as stated. I think you may have accidentally misstated the question.

> 100 ants are spaced evenly on a 1m stick

Are the ends at the end of the line of evenly spaced ants on the very ends of the stick?

> They travel at 1m/minute.

Is each ant initially traveling? What is the initial travel direction of each traveling ant?

This matters because if the ants are all traveling in initially traveling then (assuming maximal even initial spacing) it would take 1 minute for the last ant to fall off, but if each ant were initially traveling towards the nearest end it would take about 1/2 minute.

Googling, I found almost the same problem except that the question asked was what is the minimum time that guarantees all ants will have fallen off no matter what their initial directions are.

Re: My Favorite Math Problem

#76
post #41

Earlier quoted context omitted.

I disagree. Arguments to symmetry like this are found all over the place, especially in the kind of geometry and physics I'm familiar with. In fact the solution I came up with when I read the problem was very similar.

The original comment (by tasty_freeze) was an argument to symmetry. Just saying "because of symmetry" is not a proper explanation.

You're right that it's not a proper explanation. This feels just like a case of "details are left as an exercise". This is most frustrating when you're learning a subject, and you want to be able to check the details, or you are skeptical of a claim. Inevitably though people elide things that they think the reader (who they model as similar to themselves) will immediately be able to guess based on their experience. I'm sure you can think of an equivalent situation in your field of expertise.

Re: My Favorite Math Problem

#77
post #45

I came across one of my favorite math problems in high school and it blew my mind. ABC DEF + GHI ----- 123J Each letter represents a distinct digit 0-9. What is J? Of course you can write a short program that iterates through the possibilities. But there is also a very elegant solution that fits in a tweet. (If you don't want to try solving it, or have tried and have given up, here is the solution: https://twitter.co…

A nuance here is that you are assuming the existence of a solution. It may be the case there are no values for A to J that can result in that equation. Iterating through all possibilities shows that the solution exists, the proof in the tweet doesn't.

Yes, this is a good point. I wonder whether there is a proof to show that a solution exists that doesn't involve brute force.

Re: My Favorite Math Problem

#78
post #28

Earlier quoted context omitted.

> there is also a very elegant solution that fits in a tweet. (If you don't want to try solving it, or have tried and have given up, here is the solution I tried to understand the tweet a couple of times, but I couldn't follow the proof from the tweet itself, so I wrote it up again with the basic axiom from the tweet as a basis + work out each step of the process. https://gist.github.com/t3rmin4t0r/a953450ac64b686854…

I'm trying it with this TXR Lisp, just for fun. It uses an implementation of John MacCarthy's amb operator based on delimited continuations, which are slow. (defmacro amb-scope (. forms) ^(block amb-scope ,*forms)) (defun amb (. args) (suspend amb-scope cont (each ((a args)) (whenlet ((res (and a (call cont a)))) (return-from amb-scope res))))) (defmacro 0-9 () '(amb 0 1 2 3 4 5 6 7 8 9)) (defmacro val (p q r) ^(+ (*…

Normally in these kind of cryptogram puzzles the leading digits of a number can't be 0. Your solution has A = 0.

Re: My Favorite Math Problem

#79

Earlier quoted context omitted.

Modulo 9, a decimal integer is equal to the sum of its digits. More precisely, congruent, notated by ≡: For instance 123 ≡ 1+2+3 ≡ 6 (mod 9). We show congruences using ≡, and always have (mod N) on the far right to indicate the modulus for the congurence. More generally, if ABC is a decimal string, then we know that ABC ≡ A + B + C (mod 9). Moreover ABC + DEF + GHI must be congruent to A+B+C + D+E+F + G+H+I (mod 9).…

That was all good, except this bit was not obvious to me: > Modulo 9, a decimal integer is equal to the sum of its digits. More precisely, congruent, notated by ≡: > For instance 123 ≡ 1+2+3 ≡ 6 (mod 9). This is the part where the parent comment's explanation was helpful.

There is a nice, succinct explanation for this (which relies on some intuition or knowledge of modulo arithmetic and congruences).

First, a small defnition: let dsum(X) denote "sum of the digits of the decimal representation of whole number x".

In the modulo 9 congruence, 0 and 9 are equivalent symbols. 9 ≡ 0 (mod 9). Though distinct integers outside of the congruence they are indistinguishable elements of the congruence.

Observe that since 9 is congruent to 0, the number 10 is congruent to 1: 10 ≡ 1 (mod 9). Therefore, all powers of 10 are also congruent to 1: 1 ≡ 10 ≡ 100 ≡ 1000 ... (mod 9).

Next, note that these numbers x ∈ {1, 10, 100, 1000, ...} all have the property that x ≡ dsum(X) (mod 9). The sum of decimal digits of each power of 10 is 1, and each power of 10 is congruent to 1, modulo 9.

Within a congruence, whenever we multiply by any congruence element that is indistinguishable from 1, we get the same element. So all of these numbers 1, 10, 100, ... are identity elements in the modulo 9 congruence.

Identity means that, for instance 7 ≡ 70 ≡ 700 ≡ 7000 = 7000 ... (mod 9). If we multiply the congruence element 7 by any power of 10, the result is congruent to 7, modulo 9, because 10 is the identity element: no matter how many times we multiply an integer by 10, the resulting integer is the same modulo 9 congruence element. (Moreover, also note that dsum(7) = dsum(70) = dsum(700) ...).

Next, note that every decimal integer is formed by a sum combination of multiples of power of 10.

For instance, 1234 is equal to 1 x 1000 + 2 x 100 + 3 x 10 + 4.

But suppose we do this arithmetic in the modulo 9 congruence: it must necessarily be that:

1000 + 200 + 30 + 4 ≡ 1 + 2 + 3 + 4 (mod 9).

This is because, individually, 1000 ≡ 1 (mod 9), and 200 ≡ 2 (mod 9), 30 = 3 (mod 9). The power of 10 factors do not matter, since they are really powers of the identity element 1 in the mod 9 congruence.

The succinct explanation is then: every whole number has a decimal form made up of digits, which are multiplied by powers of 10. But in the modulo 9 congruence, powers of 10 do not matter: they map to the multiplicative identity element 1. That leaves the sum of the digits indistinguishable (in the modulo 9 congruence) from the value of the number (which is also a kind of sum of the digits, with each digit being scaled by a different power of 10).

Re: My Favorite Math Problem

#80
post #78

Earlier quoted context omitted.

I'm trying it with this TXR Lisp, just for fun. It uses an implementation of John MacCarthy's amb operator based on delimited continuations, which are slow. (defmacro amb-scope (. forms) ^(block amb-scope ,*forms)) (defun amb (. args) (suspend amb-scope cont (each ((a args)) (whenlet ((res (and a (call cont a)))) (return-from amb-scope res))))) (defmacro 0-9 () '(amb 0 1 2 3 4 5 6 7 8 9)) (defmacro val (p q r) ^(+ (*…

Normally in these kind of cryptogram puzzles the leading digits of a number can't be 0. Your solution has A = 0.

In that case, we can easily add these constraints to look for another solution, like this --- but that is a poor way:

  (compile-only
    (amb-scope
      (let* ((A (0-9)) (B (0-9)) (C (0-9))
             (D (0-9)) (E (0-9)) (F (0-9))
             (G (0-9)) (H (0-9)) (I (0-9))
             (J (0-9)))
        (amb (and (eql (+ (val A B C)
                          (val D E F)
                          (val G H I))
                       (+ 1230 J))
                  (nzerop A) (nzerop D) (nzerop G) ;; don't do this
                  (eql 1023 (mask A B C D E F G H I J))))
        (prinl (list A B C D E F G H I J)))))

Better just exclude the value 0 from the amb expression for those digits, to reduce the search space:

  (defmacro 0-9 () ^(amb ,*(range 0 9)))

  (defmacro 1-9 () ^(amb ,*(range 1 9)))

  (defmacro val (p q r) ^(+ (* 100 ,p) (* 10 ,q) ,r))

  (compile-only
    (amb-scope
      (let* ((A (1-9)) (B (0-9)) (C (0-9))
             (D (1-9)) (E (0-9)) (F (0-9))
             (G (1-9)) (H (0-9)) (I (0-9))
             (J (0-9)))
        (amb (and (eql (+ (val A B C)
                          (val D E F)
                          (val G H I))
                       (+ 1230 J))
                  (eql 1023 (mask A B C D E F G H I J))))
        (prinl (list A B C D E F G H I J)))))


  1> (compile-file "abcprob.tl")
  t
  2> (load "abcprob")
  (1 0 2 3 4 5 7 8 9 6)
So:

    102
    345
  + 789
  -----
  =1236
:)
Post reply on HN