+ Reply to Thread
Results 1 to 19 of 19

Thread: Math Problem     submit to reddit submit to twitter

  1. #1
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    Math Problem

    If two points are randomly placed inside of a square, what is the probability that the line formed by these two points will intersect two adjacent sides of the square?

    I think the answer is 1/3, although I may be wrong. Maybe someone else can also answer it!

  2. #2

    My knowledge of probability and statistics is extremely poor, but this question seems incredibly difficult. The probability depends not only on the slope of the line formed, but the placement of the points in relation to the sides of the square. A line with a slope of +/- 1 is guaranteed to satisfy the requirements of the problem, but you can have slopes approaching 0 and infinity that could still cross two adjacent sides, providing the points defining that line are sufficiently close to a particular side. I can think of no way to solve this problem. Conditional probability perhaps? But the conditions are brutally difficult, and if the points are placed "randomly" then you can't get base probabilities anyway.

    edit: Are you sure it isn't a trick question? There are infinitely many pairs of points that will cross two adjacent sides with their line, and infinitely many that won't.

  3. #3
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    Well of course there are an infinite number of them, but that doesn't mean you can't find the probability of some group of occurrences. For instance, consider the group of real numbers [0,100]. There are an infinite number of numbers in this set, although you know from intuition that if a real number is selected randomly from this group that it has a 1/10 chance of occurring in the set [0,10].

  4. #4
    The Flying Scotsman
    Join Date
    Apr 2006
    Posts
    1,745
    BG Level
    6

    Quote Originally Posted by Mojo View Post
    Well of course there are an infinite number of them, but that doesn't mean you can't find the probability of some group of occurrences. For instance, consider the group of real numbers [0,100]. There are an infinite number of numbers in this set, although you know from intuition that if a real number is selected randomly from this group that it has a 1/10 chance of occurring in the set [0,10].
    Your example requires the condition that the randomly selected real number also be an integer. And doesn't an integer between 0 and 100 have a 1/11 chance of appearing between 0 and 10, or am I mistaken?

  5. #5
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    There is no integer requirement, I don't know where you're getting this from.

  6. #6
    Cerberus
    Join Date
    Sep 2007
    Posts
    472
    BG Level
    4
    FFXIV Character
    Phede Mihnao
    FFXIV Server
    Midgardsormr
    FFXI Server
    Quetzalcoatl

    Two general possibilities:

    http://i40.tinypic.com/2czzsza.png
    -The line intersects one side and then intersects one of the two adjacent sides.
    -The line touches one side and then continues to the opposite side.

    Considering that every side has two adjacent sides, I'd say it's actually 2/3.

  7. #7
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    That answer is rooted in the assumption that those cases would occur in equal amounts.

  8. #8
    The Flying Scotsman
    Join Date
    Apr 2006
    Posts
    1,745
    BG Level
    6

    Ok never mind. I had to write it out before I understood.

  9. #9
    Relic Weapons
    Join Date
    Apr 2006
    Posts
    379
    BG Level
    4
    FFXI Server
    Titan

    Just a few thoughts that should hopefully help lead to an answer:

    Any line formed that is perfectly diagonal (angle of 45, 135, 225, 315 degrees) will always intersect 2 adjacent sides - probability 100%.

    Any line formed that is perfectly horizontal/vertical (angle of 0, 90, 180, 270 degrees) will always intersect 2 opposite sides - probability 0%.

    From a visual perspective, as lines start to diverge from the diagonals, you will no longer be able to find those lines going through the very center of the square if they are to intersect 2 adjacent sides. As you approach horizontal/vertical, they are only found along the sides and then disappear completely.

    Now if nature is kind, the distribution will be a happy sin function, varying between a probability of 0 and 1, with a period of 180 degrees. But I'm not sure if that is actually true, and don't feel like figuring it out.

  10. #10
    Relic Shield
    Join Date
    Oct 2006
    Posts
    1,696
    BG Level
    6

    I've sketched out some discussion for it. Looks like it would be difficult as shit to solve.

    Consider a square of width/height 2t, centred at the origin (0,0). Two points in R2, (a,b) and (c,d), such that -t ≤ a, b, c, d, ≤ t, so that these points reside within the square.

    Let f be a function such that f(x)=x((a-c)/(b-d))+(b-a((a-c)/(b-d)) = (ax-cx-a^2+ac+b^2-d)/b-d

    The function f intersects the square at adjacent sides if:

    x = t, -t implies that -t ≤ f(x) ≤ t

    f does not intersect at opposite sides if:

    x = t implies that f(x) > t or f(x) < -t

    What are the odds of case 1 or 2 happening? No fucking idea.

  11. #11
    Vacht
    Guest

    I am so glad im done with my math classes.

  12. #12
    Relic Shield
    Join Date
    Oct 2006
    Posts
    1,696
    BG Level
    6

    I've thought of another approach.

    http://server3.uploadit.org/files/se...n-solution.JPG

    Consider the point indicated in the square. The blue lines are drawn from the corners of the square to the point, and the red lines are the continuation of the blue lines through to the other side of the square. If the first point is the black dot and the second dot is within triangle A, then the resulting line will intersect the square at opposite sides. If it's in triangle B then the intersection will be at adjacent sides, at triangle C opposites, D adjacent, and so forth. Thus the odds of a the second point producing a line that intersects the square at adjacent sides is the area of B+D+F+G divided by the area of the square.

    Now I wonder if it's the case that no matter what the first point is chosen to be, the odds of a adjacent side intersection turn out to be the same. If that's the case, then you can just calculate what I've described and get your answer. If not then you could do something with the convergence of the infinite sum of a real number series, but that sounds too much like work.

  13. #13
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    That's the first step in the way I solved the problem. However, the areas B,D,F, and G change depending on the location of the first point. An average of these areas for every possibility of the first point is the correct answer.

  14. #14
    Relic Weapons
    Join Date
    Oct 2006
    Posts
    335
    BG Level
    4

    Quote Originally Posted by Mojo View Post
    That's the first step in the way I solved the problem. However, the areas B,D,F, and G change depending on the location of the first point. An average of these areas for every possibility of the first point is the correct answer.
    They do change, but since the probability should only be the sum of the areas of B, G, D, and F (using the picture above) over the area of the entire square, it should follow that you just need to calculate the function for the sum of the areas in terms of the initial point, then just integrate over the limits.

    Assuming the unit square should make it a lot cleaner, and I don't see why you can't without loss of generality.

    Edit: Looking at the picture, it actually looks a lot easier to calculate the probability that it isn't first:

    Assume: unit square
    Step 1: Calculate the four intersecting points along the edges of the unit square (the ones that aren't the corners) in terms of the initial point (x,y)
    Step 2: Calculate the sum of the area of each triangle A, C, E, other E in terms of x, y (dx dy)
    Step 3: Double integrate over x and y with both limits [0,1]
    Step 4: Subtract the result from the area of the unit square

  15. #15
    Relic Shield
    Join Date
    Oct 2006
    Posts
    1,696
    BG Level
    6

    Quote Originally Posted by Mojo View Post
    That's the first step in the way I solved the problem. However, the areas B,D,F, and G change depending on the location of the first point. An average of these areas for every possibility of the first point is the correct answer.
    Show us how you did it?

  16. #16

    Yeah.

    Totally read it as Meth Problem.

  17. #17
    Science Fiction Super Fan
    Join Date
    Jul 2006
    Posts
    3,210
    BG Level
    7
    FFXI Server
    Cerberus

    Quote Originally Posted by Vacht View Post
    I am so glad im done with my math classes.
    holy fuck this over and over and over

  18. #18
    Sea Torques
    Join Date
    Dec 2007
    Posts
    582
    BG Level
    5

    Here's one way to think of this probabilistically.

    Consider a unit square bounded by X = 0, X = 1, Y = 0, and Y = 1. You want the probability that a line passes through X = 1 & Y = 1, X = 0 & Y = 0, X = 0 & Y = 1, or X = 1 & Y = 0 with the "correct" slope (e.g., a line through X = 1 and Y = 1 consecutively with a negative slope) AND is in the square because the x and y coordinates of the points are randomly sampled from continuous Unif(0, 1). Whether or not the slope is positive, the line must be in the square... then condition on whether, within the square, the slope is positive or negative. The total probability is a sum of joint probabilities. Applying Bayes' theorem

    P(X = 1 & Y = 1 | - slope in square)P(- slope in square) + P(X = 0 & Y = 0 | - slope in square)P(- slope in square) + P(X = 1 & Y = 0 | + slope in square)P(+ slope in square) + P(X = 0 & Y = 1 | + slope in square)P(+ slope in square)

    P(- slope in square) = P(+ slope in square) = 1/2 since it is equally likely the slope is positive or negative. Now, deal with the other joint probabilities:

    P(X = 1 & Y = 1 | - slope in square) = P(X = 1 | Y = 1 & - slope in square)P(Y = 1 | - slope in square)

    Given that line passes through Y = 1 and has a negative slope in the square, the probability that the line passes through X = 1 is 1/3. There are two possibilities not equally likely: passing through the sides bounded by Y = 1 and X = 1 (1/3), and passing through the sides bounded by Y = 0 and Y = 1 (2/3). If the two points in the square are below the line Y = 1 - X, the resulting line can never connect X = 1 and Y = 1 within the square, but the resulting line can still connect Y = 0 and Y = 1 within the square. So you have the whole square to work with (Y = 0, Y = 1) vs. half the square (Y = 1, X = 1).

    Also, P(Y = 1 | - slope in square) = 1/2. There are four equally likely possibilities: passing through the sides bounded by X = 1 and Y = 1 (satisfies condition), passing through the sides bounded by Y = 1 and Y = 0 (satisfies condition), passing through the sides bounded by X = 0 and X = 1, and passing through the sides bounded by X = 0 and Y = 0.

    Therefore, P(X = 1 & Y = 1 | - slope in square) = (1/3)(1/2) = 1/6. The other joint probabilities are also 1/6 with similar reasoning

    Therefore, the total probability is 1/2(1/6 + 1/6 + 1/6 + 1/6) = 1/3.

  19. #19
    Groinlonger
    Join Date
    Oct 2006
    Posts
    2,964
    BG Level
    7
    FFXI Server
    Fenrir

    Maybe I should have erased some of it, but here's my solution. Ignore the part directly above the squares, that's just where I was writing to calculate other things. Some symmetry was used because it becomes painful to find the area in question as the boundaries won't be consistent otherwise.


Similar Threads

  1. (Simple?) Math Problem
    By Datonare in forum General Discussion
    Replies: 18
    Last Post: 2010-09-01, 09:07
  2. Math problem driving me bonkers
    By Zieara in forum General Discussion
    Replies: 14
    Last Post: 2010-01-19, 18:57
  3. Another math problem! (Not HW)
    By Julian in forum General Discussion
    Replies: 184
    Last Post: 2009-11-12, 16:33
  4. Math Problem (Calculus)
    By dekamii in forum General Discussion
    Replies: 54
    Last Post: 2009-07-30, 17:45
  5. "Simple" Math Problem
    By Wulfgang in forum General Discussion
    Replies: 64
    Last Post: 2008-09-25, 16:19