Jump to content
BrainDen.com - Brain Teasers

witzar

Members
  • Posts

    237
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by witzar

  1. Let s(t) be the distance Alice covers in time 't'.

    We assume s(t) is a continuous and differentiable function of 't' - a reasonable assumption: Since Alice can't disappear and appear in a different spot in zero time (implying infinite speed), and can't instantaneously change her speed to a completely different value (implying infinite acceleration).

    This is exactly what meant by the last sentence of my answer:

    The question remains: is it possible to run like this?

    I'd also add one more condition: s(0)=0, since the runners start moving when the the race starts.

    Same restrictions should also apply to Bob,

    so another question is: how can he run with a constant positive speed?

    Obviously he can't without braking his speed function at 0.

  2. Alice could run fast for 0.2 mile then slow for the rest of the first mile,


    and repeat this pattern for the whole marathon.
    This way her pace is constant on every 1-mile segment.
    Now, after 26 miles of the race she is 26 seconds behind Bob,
    and she is going to run fast on remaining 0.2 mile segment of the race.
    If she runs fast enough the fast segments, she wins.
    The question remains: is it possible to run like this?

  3. If at least one of m or n is odd, player 1 wins. First he removes middle line, then do actions symmetrical to player 2's actions with the removed line.

    This is incorrect.

    Consider 3*3 for example. After player 1 removes middle line, player 2 removes some line perpendicular to line just removed, leaving player 1 with 2*2.

     

    if m and n both even, player 2 wins. Every move player 1 make, player 2 make symmetrical move with center point.

    This is correct. :)
  4. Here is the simple game I've invented (if someone invented it before, then I'm not aware of it):

     

    A pawn is placed on every square of m*n chessboard.
    Two players take alternate turns removing pawns.
    On each turn, a player removes one or more pawns.
    All pawns removed in a single turn have to be taken from the same row or the same column.
    The player who cannot make a move loses (alternatively: the player who takes the last pawn wins).

    Let's call the player who begins the "first player" and the other one the "second player".

    Which player (the first or the second) has a winning strategy depending on the chessboard dimensions?
     

    PS The game can be played on more interesting boards. Just draw some number of crossing lines

    on a sheet of paper and place a pawn on each point of intersection of the lines.

    The pawns removed in a single turn should come from a single line.

    I've tried to play this game on the pentagram (the star: five lines, ten points/pawns) with my 9 years old daughter.

    It was fun. Determining which player wins was even bigger fun.

    • Upvote 1
  5. For me, it's not obvious.

    Which part?

    If you don't understand the first statement, then just look at the definition of probability.

    Let me quote from Wikipedia:

    "Probability is the measure of the likeliness that an event will occur."

    The key word here is measure. Measure is a non-negative value you assign

    to each measurable set of your space (the assignment should have some special properties).

    No measure - no probability, as simple as that, just by the mere definition.

    So let me state it once again: 1) we need to agree upon which subsets of our space are measurable,

    2) we need do assign them measure, and only then 3) we can ask about probabilities of different events.

    Before steps 1) and 2) probability is not even defined, so questions like 3) are meaningless.

     

    PS Your example problem with rain and plots could be easily resolved by choosing a finite number of sets

    that should me measurable and assigning them proper measures. Same procedure cannot be done to solve the original problem.

  6. Asking about probabilities makes no sense unless there is a probability distribution.

    Unfortunately there is no reasonable distribution on R+.

    But an obvious distribution exists on interval [0,x], where x is any positive real number.

    One thing we can do in such case is to try to solve the problem for [0,x] and then see

    if the solution has a limit when we go with x to infinity.

    With this approach it's obvious that the probability we look for equals 0.5 for every x,

    so obviously it's limit is also 0.5 when x goes to infinity.

    • Upvote 1
  7. Let P(n) denote the number of primes in set {n, n+1, ..., n+2001}


    (the set of 2002 consecutive positive integers starting with n).
    We are given that P(1)>=168.
    First observe that P(2003!+2) = 0. Indeed k | (2003!+k) for k=2, 3, ..., 2003,
    so each number in set {2003!+2, 2003!+3, ..., 2003!+2003} is composite.
    Now observe that |P(n+1) - P(n)| <= 1. Indeed, shifting the set by one to the right
    cannot change the number of primes in the set more then by 1.
    Therefore P(n) takes all intermediate values between P(1)(>=168) and P(2003!+2) (=0),
    so the value of 150 is also taken for some 1<n<(2003!+2) in particular.

  8. That's an equation, in words. And symbols are algebra.

    The problem is to find d and c given h=(c+d) and f=(2c+4d).

    As k-man stated, it can can be solved as follows: d=0.5f-h and c=2h-0.5f.

    Suppose a solution of the problem exists that is "without algebra, equations, etc.".

    Such a solution would be effectively a magic black box: you drop h and f inside,

    and the box spits out (0.5f-h) and (2h-0.5f).

    The magic box works like this:

    (a,b) --> (a/2-b),(2b-a/2)

    How can we use it?

    1. (0,b) --> (-b,2b)

    2. (a,0) --> (a/2,-a/2)

    So we can use the box to multiply and divide an arbitrary number by two.

    We can also use the box to do an aritrary subtraction (a-b):

    first throw (0, a) in to get 2a, then throw (2a, b) in to get (a-b).

    Of course we can do an arbitrarary addition too: a+b = a-(-b), so we can use (1.)

    to get (-b) and reduce the problem to subtraction.

    Having addition we do have a multiplication, since a*n = a+a+...+a (n times.).

    An so on.

    The question follows:

    Could such magix box that allows arbitrary addition and subtraction

    "without albebra, equations, etc." exist?

    Or let me state it this way. Suppose Joe is your pal eager to solve

    any children-and-dogs problem on your request. In such case you could

    solve arbitrary arithmetical problems using only finite requests to Joe.

    If Joe solves each such request "withoul algebra, equations, etc.",

    then so do you. But is it possible?

  9. I get 41.

    But I cheeted:

    public class TriangleCount {
    
        final int[][] p = {
            {0, 0},   {2, 0},   {4, 0},   {6, 0},
                 {1, 1},   {3, 1},   {5, 1},   {7, 1},
                      {2, 2},   {4, 2},   {6, 2},   {8, 2},
                           {3, 3},   {5, 3},
                      {2, 4},   {4, 4},
        };
        
        void count() {
            int count = 0;
            for (int i = 0; i < p.length; i++)
            for (int j = i + 1; j < p.length; j++)
            for (int k = j + 1; k < p.length; k++) {
                int a = (p[j][0] - p[i][0])*(p[j][0] - p[i][0]) + 3*(p[j][1] - p[i][1])*(p[j][1] - p[i][1]);
                int b = (p[k][0] - p[j][0])*(p[k][0] - p[j][0]) + 3*(p[k][1] - p[j][1])*(p[k][1] - p[j][1]);
                int c = (p[i][0] - p[k][0])*(p[i][0] - p[k][0]) + 3*(p[i][1] - p[k][1])*(p[i][1] - p[k][1]);
                if (a == b && b == c) {
                    count++;
                    System.out.println("Equilateral triangle #" + count + ": i=" + i + " j="+j + " k=" + k);
                }
            }
        }
    
        public static void main(String[] args) {
            new TriangleCount().count();
        }
    }
    

  10. And here is the straightforward approach:

    public class SandwichedHT {
    
        boolean isSandwiched(String s) {
            if (!s.endsWith("TH")) {
                return false;
            }
            String s1 = s.substring(0, s.length() - 1);
            int lastH = s1.lastIndexOf("H");
            if (lastH == -1) {
                return false;
            }
            return ((s1.length() - lastH) % 2 == 0);
        }
    
        int count() {
            int i = 0;
            String s = "";
            do {
                s += (Math.random() < 0.5) ? "H" : "T";
                i++;
            } while (!isSandwiched(s));    
            return i;
        }
        
        double avg(int tries) {
            long totalCount = 0;
            for (int i = 0; i<tries; i++) {
                totalCount += count();
            }
            return ((double) totalCount)/tries;
        }
        
        public static void main(String[] args) {
            int tries = 1000000;
            double avg = new SandwichedHT().avg(tries);
            System.out.println("tries=" + tries + " avg=" + avg);
        }
    }
    

    It gives same results.

  11. Nice approach. Your answer is smaller than what I get.

     

    Here is a Java code I just wrote to confirm my calculations:

    package sandwichedht;
    
    public class SandwichedHT {
    
        enum State {
            W, E, O, S;
            private State onT, onH;
    
            static {
                W.onT = W; W.onH = E;
                E.onT = O; E.onH = E;
                O.onT = E; O.onH = S;
            }
    
            public State transition() {
                return (Math.random() < 0.5) ? onH : onT;
            }
        }
    
        int count() {
            int i = 0;
            for (State state = State.W; state != State.S; state = state.transition()) {
                i++;
            }
            return i;
        }
    
        double avg(int tries) {
            long totalCount = 0;
            for (int i = 0; i<tries; i++) {
                totalCount += count();
            }
            return ((double) totalCount)/tries;
        }
        
        public static void main(String[] args) {
            int tries = 1000000;
            double avg = new SandwichedHT().avg(tries);
            System.out.println("tries=" + tries + " avg=" + avg);
        }
    }
    

    It's results are pretty close to 8.

  12. Let's consider the following states:


    w = "still waiting for the first H"
    e = "H followed by even number of T's"
    o = "H followed by odd number of T's"
    s = "odd number of T's sandwiched between two H"

    We start in state w and when we get to the state s we are done.
    We have the following transitions:
    w->w (T), w->e (W)
    e->e (H), e->o (T)
    o->e (T), o->s (H)
    with 0.5 probability each.

    (It would be helpful to draw a diagram at this point.)

    Let x|y denote the average number of transitions (tosses) needed to get from state y to state x.

    Let's start with e|w:
    e|w = 0.5*1 + 0.5*(1 + e|w) => e|w = 2.

    Same thing with o|e:
    o|e = 0.5*1 + 0.5*(1 + o|e) => o|e = 2.

    Now the more difficult one:
    s|o = 0.5*1 + 0.5*(1 + s|e) = 0.5*1 + 0.5*(1 + s|o + o|e) = 0.5*1 + 0.5*(1 + s|o + 2) => s|o = 4.

    Finally:
    s|w = s|o + o|e + e|w = 4 + 2 + 2 = 8.

    So 8 tosses are needed on average.

  13. To get from (7,1) to (10,5) you need to take 3 steps right and 4 steps up,


    so a straight line through these points croses line x=8 4/3 units above (7,1) (since it's 1 step right).
    Therefore the coordinates of 4th vertex of the quadrilateral are (8, 1+4/3).
    Given this caclulation of area of the quadrilateral is elementary: 4*(8-(2+2/3))/2 = 2*(5+1/3) = 10+2/3.

  14. Let p2 be equilateral triangle with side of length 4*3^0.5. Perimeter and area of p2 are both equal to 12*3^0.5.


    Let p1 be rhombus with side of length 3*3^0.5. P1 and p2 have equal perimeters.
    Obviously we can make p1's area anything between 0 (when shorter diagonal of p1 tends to 0) and 27 (when p1 becomes a square)
    without changing it's perimeter, so we can make it equal to 12*3^0.5 (=~20.785) in particular.

×
×
  • Create New...