Jump to content
BrainDen.com - Brain Teasers
  • 0

Please be obtuse!


karthickgururaj
 Share

Question

Recommended Posts

  • 0

I looked through the first few replies, and I now realize that this problem is even weirder than I initially thought.

But here's another thought: plasmid's method of assuming that the first two points are the closest/farthest doesn't work on a finite plane, so maybe it's wrong in the infinite case. But at the same time, maybe not, because stating that the first two points are the closest/farthest clearly warps the joint probability distribution of their positions on a finite plane (because obviously they are more likely to be closer together if they are the closest vertices of the triangle), but not on an infinite plane. Probability and infinity are pretty fragile things it seems. :(

Edited by gavinksong
Link to comment
Share on other sites

  • 0

Thanks all for the interesting discussion. I understand the folly in my own solution (at the least!).

 

I'm summarizing some of the interesting posts for a reader who might come across this thread in future. Might be worthwhile to also check the initial set of solutions that attempted to solve the problem "directly" on the infinite plane (including my own). The solutions varied from 1, 0.75, 0.64.. Also, you can check a related discussion: 

 

Didn't discuss the approach below much further, but same result as bonanova's (closest to simulation result):

seems to me every triangle will have a greatest angle between 60 and 180 degrees and cant see how any of those would be more likely than another so three quarters of those will have a greatest angle greater than 90 degrees?

 

Bonanova's solution:

My take:

 

[spoiler='Quick and dirty answer for finite circle']Place any three points A B and C in a unit (or any finite radius) circle.

We prohibit ABC from all lying on a straight line.

This is OK, because such configurations constitute 0% of all cases.

 

Construct the points A' B' and C' so that the centers of the line segments AA', BB' and CC' lie on the origin.

Inspect the eight triangles ABC, A'BC, AB'C, ABC', A'B'C, A'BC', AB'C' and A'B'C'.

In every case exactly six of the eight triangles are obtuse.

 

The probability of an obtuse triangle in a finite circle is 0.75.

 

---------

 

What is the probability that a random triangle inside a circle covers its center?
Examine the same eight triangles!

 

 

If the OP has a solution, it is the same as for a circle of finite radius.

 

Simulation results when trying over a square and a circle. Not the same result as what was predicted above, but close:

I'm not sure I follow. If you pick any three points randomly (keeping it in a finite area to make things comprehensible) and call them X, Y, and Z, then one of the three sides XY, YZ, or ZX must be the longest, and you can relabel the points so that the longest side has points A and B and make the leftover point be C. The points were all uniformly chosen in whatever area was available; the limitation of where point C could lie purely stems from having labeled A and B as the termini of the longest edge. Put another way: point C could fall outside the red and blue areas, but if it did then you would just relabel the points so it's no longer labeled C.

 

I really do think the answer is probably 75% instead of 64%, but I'm not completely sure what the hole in the 64% argument is. I get the feeling that there's something subtle going on that makes the probability distribution of point C within the red and blue regions become non-uniform and denser in the blue region, but I can't tell exactly what it is.

 

Edit: Plus, Java is telling me that it's about 72.5%  :wacko: It's seldom that I favor theory over experiment, but in this case I still think 75% is more likely correct.

package obtuse;
import java.util.*;
 
class Triangle {
  /* Contains x and y coordinates of the three points of the triangle in
   * variables x[0], y[0]; x[1], y[1]; x[2], y[2]
   */
  double[] x, y;
  
  public Triangle() {
    /* Picks the three points of the triangle randomly from the unit square
     */
    x = new double[3];
    y = new double[3];
    Random rand = new Random();
 
    for(int i=0; i<3; i++) {
      x[i] = rand.nextDouble();
      y[i] = rand.nextDouble();
    }
  }
  
  public boolean checkObtuse() {
    /*  This calculates the dot product of each pair of vectors from each
     *  vertex and sees if any of them are negative, which would indicate
     *  an obtuse angle.
     */
    boolean obtuse;
    
    obtuse = (((x[1]-x[0])*(x[2]-x[0]) + (y[1]-y[0])*(y[2]-y[0])) < 0) ||
             (((x[0]-x[1])*(x[2]-x[1]) + (y[0]-y[1])*(y[2]-y[1])) < 0) ||
             (((x[0]-x[2])*(x[1]-x[2]) + (y[0]-y[2])*(y[1]-y[2])) < 0);
    return obtuse;
  }
}
 
public class Obtuse{
  public static void main(String[] args){
    int iters = 100000;
    int obtuse = 0;
    Triangle myTriangle;
    
    for (int i=0; i<iters; i++){
      myTriangle = new Triangle();
      if(myTriangle.checkObtuse()) {
        obtuse++;
      }
    }
    System.out.println((double)obtuse/iters);
  }
}

 

 

Sure enough, when I modified the Java code to also calculate the probability of a triangle drawn from a unit circle to be obtuse, it wasn't ~72.5% like a unit square. It was ~72%. Gyah.
 

package obtuse;
import java.util.*;
 
class Triangle {
  /* Contains x and y coordinates of the three points of the triangle in
   * variables x[0], y[0]; x[1], y[1]; x[2], y[2]
   */
  double[] x, y;
  
  public Triangle(String shape) {
    /* Picks the three points of the triangle randomly from the unit square
     * or unit circle
     */
    x = new double[3];
    y = new double[3];
    Random rand = new Random();
    
    switch (shape) {
      case "UnitSquare":
        for(int i=0; i<3; i++) {
          x[i] = rand.nextDouble();
          y[i] = rand.nextDouble();
        }
        break;
      case "UnitCircle":
        for(int i=0; i<3; i++) {
          do {
            x[i] = 2 * rand.nextDouble() - 1;
            y[i] = 2 * rand.nextDouble() - 1;
          } while (Math.sqrt(x[i]*x[i] + y[i]*y[i]) > 1);
        }
        break;
    }
  }
  
  public boolean checkObtuse() {
    /*  This calculates the dot product of each pair of vectors from each
     *  vertex and sees if any of them are negative, which would indicate
     *  an obtuse angle.
     */
    boolean obtuse;
    
    obtuse = (((x[1]-x[0])*(x[2]-x[0]) + (y[1]-y[0])*(y[2]-y[0])) < 0) ||
             (((x[0]-x[1])*(x[2]-x[1]) + (y[0]-y[1])*(y[2]-y[1])) < 0) ||
             (((x[0]-x[2])*(x[1]-x[2]) + (y[0]-y[2])*(y[1]-y[2])) < 0);
    return obtuse;
  }
}
 
public class Obtuse{
  public static void main(String[] args){
    int iters = 100000;
    int obtuseSquare = 0;
    int obtuseCircle = 0;
    Triangle myTriangle;
    
    for (int i=0; i<iters; i++){
      myTriangle = new Triangle("UnitSquare");
      if(myTriangle.checkObtuse()) {
        obtuseSquare++;
      }
      myTriangle = new Triangle("UnitCircle");
      if(myTriangle.checkObtuse()) {
        obtuseCircle++;
      }
    }
    System.out.printf("%d unit square and %d unit circle", obtuseSquare, obtuseCircle);
    System.out.printf(" triangles out of %d trials were obtuse.\n", iters);
  }
}

 

 

Counter example to Bonanova's solution, which may be one of the reasons why the simulation result is not the same as predicted:

I'm not sure why the post gets messed up when I try to quote Bonanova's argument, but I can't quote it without wrecking its formatting.

Triangle ABC is roughly equilateral, and point C is very close to the origin.


ABC - acute
ABC' - acute
AB'C - obtuse
AB'C' - obtuse
A'BC - obtuse
A'BC' - obtuse
A'B'C - acute
A'B'C' - acute
attachicon.gifTriangles in circle.jpg

 

One more counter example to Bonanova's solution:

here is an example of 2/6 ratio. Only ABC' and A'B'C triangles are obtuse. Others are acute.

attachicon.gifobtuse.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...