VERY HARD Puzzle: What Is The Distance Between Two Random Points In A Square?

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 3,6 тис.

  • @MindYourDecisions
    @MindYourDecisions  5 років тому +200

    Happy 3 year anniversary! I'm honored the video was linked by Cleve Moler (creator of MATLAB). blogs.mathworks.com/cleve/2017/09/25/how-far-apart-are-two-random-points-in-a-square/

    • @zohar99100
      @zohar99100 5 років тому +2

      I did the same but with a circle of radius R instead of a square. That's a harder problem and I solved it. The answer is 128R/45π. No computer no excel no rows. Just a pure and accurate mathematical solution. For R=1 the answer is 0.905414787.......
      A computer solution (using a sample of 40,000 points) gives the same result.
      A very simple problem is to find the average length of a cord in a circle of radius R and the answer is 4R/π ( π= 3.141592654...)

    • @satyaanshu
      @satyaanshu 4 роки тому

      I remember solving this in grade 12, for JEE prep

    • @tomz1364
      @tomz1364 4 роки тому +1

      I challenge you to argue that this is not correct: the average = sqrt(2)/2. The longest distance =sqrt(2), the shortest = 0, therefore answer= (sqrt(2) + 0)/2 :)

    • @ketan9318
      @ketan9318 4 роки тому

      Actually the term random should be mentioned explicitly as uniform distribution in this case. In general the answer to 'random' cannot be given.

    • @alexdemoura9972
      @alexdemoura9972 4 роки тому +2

      According to _RANDOM POINTS ASSOCIATED WITH RECTANGLES_
      (A.M. MATHAI, P. MOSCHOPOULOS, G. PEDERZOLI)
      published in _RENDICONTI DEL CIRCOLO MATEMATICO DI PALERMO_ , SERIE II - TOMO XLVIII (1999), pages 163-190
      The average distance between random points in a rectangle is
      1/15•( Lw³/Lh² + Lh³/Lw² +
      + d•(3 - Lw²/Lh² - Lh²/Lw²) +
      + 5/2•
      •( Lh²/Lw log [(Lw+d)/Lh] +
      + Lw²/Lh log [(Lh+d)/Lw] ) )
      where:
      Lh - height length;
      Lw - width length;
      Diagonal d = √(Lw² + Lh²)
      In this specific puzzle
      Lh = Lw = 1
      d = √2
      1/15•( 1 + 1 +
      + √2•(3 - 1 - 1) +
      + 5/2•
      •( 1 • log (1+√2) +
      + 1 • log (1+√2) ) ) =
      = 1/15•( 2 + √2 +
      + 5/2•(2•log(1+√2)) ) =
      = 1/15•( 2+√2 + 5•log(1+√2) ) =
      = 0.52140543316472...

  • @ImranZakhaev9
    @ImranZakhaev9 8 років тому +4427

    "Did you figure this out?"
    :l

    • @pornpori
      @pornpori 8 років тому +260

      "Who do you think watches these videos? Paul Dirac? Karl F. Gauss?

    • @peterlindner3283
      @peterlindner3283 8 років тому +31

      I was going to do it with excel and use 1million rows. He [Presh Talwalkar - the author] gets the answer using 10,000 rows. But I was stumped in his 2nd solution, even though I figured it would use integration. ...

    • @derciferreira7211
      @derciferreira7211 8 років тому +6

      I figured out!

    • @dropyghost
      @dropyghost 8 років тому +57

      Yes, Im my way to get my nobel prize, I solve this in a napkin.

    • @mpperfidy
      @mpperfidy 8 років тому +8

      Me too! Though I'd also just used the napkin to blow my nose, and its contents, including the solution to this problem, were broadly indistinguishable from one another.

  • @CollinInGame
    @CollinInGame 8 років тому +1883

    I'll never solve this. it took me 3 and a half minutes before I realised I could just close the video and not have to worry about it.

    • @Aethgeir
      @Aethgeir 8 років тому +110

      Your comment coupled with your profile pic is perfect!

    • @georgewashington6012
      @georgewashington6012 7 років тому +10

      +Real.Piece.Of.Work The laugh of loud.

    • @eboomer84
      @eboomer84 7 років тому +15

      It took me a minute or two using the Monte Carlo method he described first. Before I clicked, I was hoping there was some cleaver solution though, not just two obvious, conventional, brute-force methods.

    • @JohnDoe-kg5zm
      @JohnDoe-kg5zm 5 років тому +3

      I'll never [your weakness placeholder]. it took me [short period for micro despair] before I realised I could just close the video and not have to worry about it.

    • @fivish
      @fivish 5 років тому +1

      I guessed it was 0.5 and it was close to that.

  • @carryon5021
    @carryon5021 5 років тому +929

    "Did you figure this out?"
    -
    -
    I find this question to be mildly humiliating.

    • @joso5681
      @joso5681 4 роки тому +23

      "mildly"

    • @___kavistaan___440
      @___kavistaan___440 3 роки тому +2

      I found the answer in 3 minutes

    • @MaxGuides
      @MaxGuides 3 роки тому +5

      I mean... there are several approaches to the exact right answer on this problem.

    • @mihitmahanta1850
      @mihitmahanta1850 2 роки тому +1

      @@MaxGuides Hi I know i'm a year late, but could you briefly explain a few of the alternative approaches for this problem? I'd really appreciate it.

  • @666wurm
    @666wurm 4 роки тому +2296

    I immediately thought “about 0.5“. Turns out I was off only by

    • @jp4431
      @jp4431 4 роки тому +60

      High five bro

    • @barneybarney3982
      @barneybarney3982 4 роки тому +104

      I was like, well it something in between 0 and sqrt2 (so average is ~0.7) and smaller numbers should be more often, so lets multiply it by about 66%, and from head it was ~0.5

    • @DavyCDiamondback
      @DavyCDiamondback 4 роки тому +33

      And now the warranty period on your product is cut in half. I’m an actuary, so I profit and the customer is screwed by your laziness

    • @jaishkhan7442
      @jaishkhan7442 4 роки тому +7

      Lol same bruh
      I thought that since it has area of 1 so taking a line that divides it in two is 0.5

    • @heretolevitateme
      @heretolevitateme 4 роки тому +35

      Pretty sure a circle with a radius of 0.5 would be 0.5. A square needs to be slightly larger due to the corners.

  • @unvergebeneid
    @unvergebeneid 8 років тому +1558

    "This doesn't look too hard. I'll just have to ... wait ... ok, now this is a bit more complicated than I .... uh. Holy ..."

    • @ryanmike9833
      @ryanmike9833 8 років тому +67

      Every damn video... :P

    • @michaelbauers8800
      @michaelbauers8800 8 років тому +12

      I have a minor in math, and I found it quite tricky. You really have to ensure you follow each step. If you didn't understand a step, I would post your question to some of the online math forums. That way you can maybe figure out where you got lost. For example, while I understood the concept of converting from rectangular to polar coordinates, I did not quite follow how that allowed a single integral. So in this example, I would have to go back to that step I failed to connect to dots, and start trying to get from A to B. Another thing to know is that some integrals are very hard to derive - you will note he glosses over the integrals, by just saying they are well known. It's like that in math classes too - sometimes you just use known integrals and such and they don't prove them to you. That's about as complex of an integral as I would personally like to deal with, heh

    • @justanothergirl__
      @justanothergirl__ 8 років тому +4

      +Gearbox: Focus on just regular, single variable integral calculus for now. Build your foundation in that before looking at multiple variables (and multiple integrals) with Jacobian transformations (changing your coordinate system(s) mid problem).

    • @dejaimeneto6093
      @dejaimeneto6093 8 років тому +8

      you just have to type that on wolfram alpha.

    • @justanothergirl__
      @justanothergirl__ 8 років тому +1

      Dejaime Neto well, C's do get degrees, so if that's what you want to do then I won't stop you from not learning.

  • @ФилиппЛыков-д8е
    @ФилиппЛыков-д8е 5 років тому +468

    The quadrupe integral _is_ tractable but it took me five A4 pages. And I have miscalculated the coefficients somewhere. So yes, your solution is better than what I could figure out.

    • @General12th
      @General12th 5 років тому +17

      Why did you specify A4 paper? Do you often use other sizes?

    • @ФилиппЛыков-д8е
      @ФилиппЛыков-д8е 5 років тому +57

      @@General12th As a rule, I just snatch a couple of sheets from my home printer. And they happen to be A4 :)

    • @shyambuddh5546
      @shyambuddh5546 4 роки тому +82

      @@General12th without specifying A4 size we wouldn't have any idea of how much work it is. Of course, we still don't have the full idea because we don't know handwriting size and whether Filipp used both sides.. but we're a bit closer.

    • @ФилиппЛыков-д8е
      @ФилиппЛыков-д8е 4 роки тому +3

      @The Absolute Madman But what size is a "piece of mind", I wonder? ;)

    • @YOM2_UB
      @YOM2_UB 4 роки тому +18

      @@ФилиппЛыков-д8е A "Piece of Mind" is about 6 minutes 22 seconds.

  • @rohitg1529
    @rohitg1529 8 років тому +497

    0 < average distance < 1.414...

    • @mb98765
      @mb98765 8 років тому +5

      hahaha lol

    • @YmohTheFrog
      @YmohTheFrog 8 років тому +9

      wow your teachers must have been pretty generous. I would have never received half credit just for that. my math teacher all through high school would have called it "bare minimum".

    • @lawrence8299
      @lawrence8299 8 років тому +6

      that's if you only consider the points that lie on the diagonal

    • @YmohTheFrog
      @YmohTheFrog 8 років тому +10

      Lawrence Mok Hmmmm nope. Any two points inside a square will be at a distance between 0 and length of side multiplied by sqr(2)

    • @siddharthajain9978
      @siddharthajain9978 8 років тому +9

      Actually we can say 0

  • @sigitrendang5195
    @sigitrendang5195 4 роки тому +407

    No one:
    Automatic translator: *"Hey this is pressure locker"*

  • @geovaniraffaelli4508
    @geovaniraffaelli4508 7 років тому +813

    I lost you at ''Consider a square...''

  • @AltumNovo
    @AltumNovo 8 років тому +702

    Now do a cube.

    • @ewdlop1
      @ewdlop1 8 років тому +52

      It proably gets an extra intergal dz. The experission under sqrt becomes(x^2+y^2+z^2) and another factor of 2(1-z) inside this triple integral.

    • @renerpho
      @renerpho 8 років тому +84

      Thanks for the challenge, +Altum Novo.
      It turns out that the integrals get a lot more complicated.
      To allow the use of spherical coordinates, I place the cube centred at the origin. The first part of the problem is similar to the square case, and you get the integral over 8*sqrt(x²+y²+z²)(1-x)(1-y)(1-z) dx dy dz with limits -1/2

    • @renerpho
      @renerpho 8 років тому +4

      Oh, I was bet by half an hour... Well, still fun ;-)

    • @renerpho
      @renerpho 8 років тому +27

      Now, to answer that problem for any dimension:
      mathworld.wolfram.com/HypercubeLinePicking.html
      It turns out 7 is the lowest dimension where the answer is larger than 1. It actually goes to infinity with increasing number of dimensions.

    • @BenedictIrwin
      @BenedictIrwin 8 років тому +8

      The paper on box integrals in the references is a good read.

  • @FilipeSantos-wg9pd
    @FilipeSantos-wg9pd 6 років тому +733

    You know the maths are hard when Preshtal Walker stutters while explaining xD

    • @parikshitmusic510
      @parikshitmusic510 6 років тому +5

      Lol

    • @unknownknown347
      @unknownknown347 5 років тому +50

      It's Presh talwalker. Talwalker is an Indian surname.

    • @manumalhotra3520
      @manumalhotra3520 5 років тому +48

      you butchered his namd flip santa

    • @benoitschwob3498
      @benoitschwob3498 5 років тому +120

      Preshtal Walker ??? Do you know his brother Lukesky?

    • @bhojjadamotabanda
      @bhojjadamotabanda 5 років тому +27

      And Talwalkar is actually pronounced as Tull-vull-kurr, as in "hull" of the ship and the first "T" is pronounced as it is pronoucned in Spanish. Talwalkar's is a big health company in India with a chain of gyms and other fitness products. Named after its founder, Vishnu Talwalkar. "Kar" is suffix in the Marathi language which is preceeded by a place name, usually ancestral village and signifies a person from that place. Just like LondonER, New YorkER. Talwalkar is someone from "Talwal". People from Mumbai are referred to as Mumbaikars.

  • @HakanTheUltimateHoca
    @HakanTheUltimateHoca 6 років тому +590

    Just guessing before the video, is it
    (2+√2+5ln(√2+1))/15 ?

    • @commelinales
      @commelinales 6 років тому +39

      Hakan Çakıcı You're the Lottery Terminator.

    • @arthurg.machado6803
      @arthurg.machado6803 6 років тому +76

      Hakan Çakıcı pretty good intuition you've got there ,huh?

    • @アヤミ
      @アヤミ 6 років тому +88

      Jesus christ it’s Jason bourne.

    • @6subswith0vids80
      @6subswith0vids80 6 років тому +1

      Hakan Çakıcı u cheated

    • @bencasica4047
      @bencasica4047 6 років тому +2

      YipHyGaming - Minecraft Agario Cytus and more! goteem

  • @MindYourDecisions
    @MindYourDecisions  6 років тому +159

    I'm grateful whenever someone features my work. Now I'm returning the favor by featuring some of the places MindYourDecisions is showing up. I'm honored to be mentioned by Cleve Moler (creator of MATLAB) in this post: How Far Apart Are Two Random Points in a Square? Check it out! Link: blogs.mathworks.com/cleve/2017/09/25/how-far-apart-are-two-random-points-in-a-square/

    • @neelakshmishra9614
      @neelakshmishra9614 6 років тому

      MindYourDecisions it was a bounce..... I did not understand it 😅😅

    • @sanskaracharya3585
      @sanskaracharya3585 6 років тому

      Hi,presh ..I have a great question...How can I mail you?

    • @xyz.ijk.
      @xyz.ijk. 6 років тому

      He estimated >0.52 to start ... I thought it would be just over 0.6 based upon an average of the maximum diagonals and the maximum straights.

    • @ManHeyuan
      @ManHeyuan 6 років тому +1

      I beg to differ.
      Why is it so complicated, yet illogical?
      To calculate the average value of the distance between all the possible 2 random points, we first need to map out, a near infinite number of pairs of points.
      The closer the distance between any 2 points, the higher the chance of occurrence.
      This will logically produce a near infinite pairs of infinitely close points.
      Therefore, the principles of probability dictate that, the average distance between 2 random points in the square, should give an approximate value infinitely close to 0.
      The longest possible distance between any 2 points in the square, are the lengths between its diagonal ends.
      The points that produce the shortest possible distance (which is near 0), meanwhile, will fill up every space in the square.
      Final answer has to be close to 0. ☺️

    • @katzenMaul
      @katzenMaul 6 років тому +1

      Yi Jiun , I think that the reason why the result is not 0 is that, due to the uniform distribution of the points, the probability to get a very small distance for example < 0,002 = pi*0,002^2 is smaller than to get an more bigger distance 0.002< 0.5 = pi*0,5^2 - pi*0,002^2

  • @MathAdam
    @MathAdam 5 років тому +49

    4:21 Simplifies into a double integral. This is going to be a long haul.

    • @andrewmurphy5310
      @andrewmurphy5310 3 роки тому +4

      This is the point I started reading the comments.

  • @Toopa88
    @Toopa88 8 років тому +1181

    my guess was 0.5 without watching

    • @petethewrist
      @petethewrist 8 років тому +49

      Me two but, those corner got me..

    • @Trias805
      @Trias805 8 років тому +78

      My guess was ~0.7 (square root of 0.5)

    • @PickyMcCritical
      @PickyMcCritical 8 років тому +17

      My guess is 1/3 of sqrt(2)
      EDIT: Yep, wasn't even close lol

    • @mrigayu
      @mrigayu 8 років тому

      same

    • @SeanR794
      @SeanR794 8 років тому +18

      ToFu right? Just say the longest distance possible was 1 and the smallest distance possible is really minute and is practically 0. So it's about .5 or just a little over since you know the distance could never be exactly 0.

  • @whozz
    @whozz 8 років тому +621

    What is the average distance between two random points in a unit circle?

    • @Robobrine
      @Robobrine 8 років тому +108

      0.905

    • @whozz
      @whozz 8 років тому +34

      Robobrine How did you calculated that? 128/(45pi)

    • @Robobrine
      @Robobrine 8 років тому +247

      I wrote a small program to brute force calculate it.

    • @carlossoto9511
      @carlossoto9511 7 років тому +19

      I calculated the integral (probably wrong), and it yielded pi / 4

    • @whozz
      @whozz 7 років тому +75

      Unfortunately, you're wrong. The answer is 128 / (45 * Pi) ~ 0.9054147...

  • @flamingpaper7751
    @flamingpaper7751 5 років тому +99

    I mean I dont get what happened but it looked cool and seems real

  • @_bender4143
    @_bender4143 8 років тому +65

    That was interesting.
    Here is a much simpler version:
    what is the average length between two points on a line segment length 1?

    • @xXxBladeStormxXx
      @xXxBladeStormxXx 8 років тому +5

      1/3 and that one is only much simpler as a mechanical calculation.
      There, you have to think about which domain is the absolute value |x1 - y1| positive / negative and split the integral accordingly.

    • @BurninAss
      @BurninAss 8 років тому +1

      Can you explain this in a little more detail? I don't really understand your explanation.
      My numerical approach to solving this sees everything as absolute values and still spits out 1/3 as an answer.

    • @xXxBladeStormxXx
      @xXxBladeStormxXx 8 років тому +8

      BurninAss Well, you have two random variables X and Y ~ Uniform(0, 1) distributed as uniform between the range 0 and 1.
      What you wanna find out is the expected value (average) of the random variable say S = |X - Y|.
      To get this average distance, you integrate over |x-y| dx dy with limits of double integration being x going from 0 to 1 and y going from 0 to 1.
      To do this integral, you have to get rid of the absolute value bars.
      |x-y| is just (x-y) for all values of y x.
      So you split the double integral into these two parts (or just 2 times the first part since it's symmetric), and change the limits for y integral from y = 0 to 1, to y = 0 to x (since this is the region where y (x-y)).
      From there onward it's an easy double integral. It will make a lot more sense if you just write the steps down on a piece of paper.

    • @BurninAss
      @BurninAss 8 років тому

      wow that was fast! Having to get rid of |x-y| for an integral was the part that I was missing. Thanks.

    • @_bender4143
      @_bender4143 8 років тому +12

      xXxBladeStormxXx I actually worked it completely different:
      If we divide the segment to N equal segments, say 10, and the points can only be between segments - the expected value is 2*1 + 2*0.9*0.1 + 2*0.8*0.2 +2*0.7*0.3 ...(combinatorics)
      Now, if When N approaches to infinity this sum becomes the integral 2*x*(1-x) dx from 0 to 1 which is 1/3.

  • @Kenlimepie
    @Kenlimepie 8 років тому +84

    "Did you figure it out?" What am I? Einstein?

  • @majorinconvenience
    @majorinconvenience 5 років тому +229

    LMAO when the question was posed I said to myself: “About 0.5?” Then after complex mathematical disambiguation it turned out to be just ABOUT that

  • @BixbyConsequence
    @BixbyConsequence 7 років тому +66

    "Did you figure it out"? Yeah, I did it in my head.

  • @tennicktenstyl
    @tennicktenstyl 8 років тому +654

    I came here just to watch some smart numbers popping on the screen lol.

  • @arrogantuser
    @arrogantuser 5 років тому +12

    This exact problem was a question on a homework set in my probability theory course. Our textbook covered a similar problem that I referenced heavily while working on it and it still took a good part of an hour to finish. This video makes it seem so simple, well done.

  • @10jelliclecats
    @10jelliclecats 8 років тому +77

    "Did you figure it out?" Really... you actually asked that question?

  • @AnstonMusic
    @AnstonMusic 8 років тому +86

    I thought that there have been too many easy questions in the past weeks, but this was really top notch!
    Loved every moment of it.
    I'm gonna miss maths a little going to Med School, but hey, I'll find my own problems that need mathematical modeling. Thanks for quenching my thirst and keeping up the drive!

    • @AnstonMusic
      @AnstonMusic 8 років тому

      Never mind, I apparently forgot about the harder ones. Whoops.

    • @strangelic4234
      @strangelic4234 8 років тому +4

      Please defend your lust for math recklessly. I don't know how often I had to explain the rule of three to a "doctor", when I used to work as an EMT.

    • @carsonbarlow348
      @carsonbarlow348 8 років тому

      That was a bit sadistic.... Good thing I'm a bit masochistic. ;)

    • @lagalil
      @lagalil 8 років тому

      Medicine has maths.

    • @strangelic4234
      @strangelic4234 8 років тому +1

      lagalil Many physicians haven't.

  • @onenameleft
    @onenameleft 6 років тому +33

    Wow.. Even when I don't come up with the answer myself, I can usually follow your explanations. this one was just beyond. I took Calculus in college 20 years ago, but I'm clearly rusty. I understood the estimate process, but the double integrals and how you got the numbers you did when you switched to absolute values of delta instead of calculating distances between all points... that was beyond me. I guess that happens when you take something that could be a class long lecture and instead of having time to teach it, you have to condense it down to a 10 minute follow me while I do the problem. It's still enjoyable to watch. And it make sense to me that the average would be lose to .5. I'm not sure i can explain why, but i just expected the average to be close to half the distance of the lengths of the legs. since the hypotenuse of a right triangle with sides 1 is only 1.4 does that help the average stay closer to half the legs. Would the average distance of a square with sides 3 be way larger than 1.5? and would it get further away from the middle as the sides got bigger because distances can go diagonally?

    • @christyjestin
      @christyjestin 2 роки тому +7

      No, I think the answer for a square with side length n should just be n times Presh's answer. Suppose we gave this problem a concrete unit like yards. The average distance should be x yards where x is the value Presh found. Now if we instead considered each side as being 3 feet = 1 yard, we'd have the problem you asked about. The side length hasn't actually changed, so the answer should still be x yards and when we convert that to feet, we get 3x feet. Since this logic works for any two units of measurements (w/ any ratio), the average distance should always be nx for a square with side length n.

    • @電腦騙徒剋星
      @電腦騙徒剋星 2 роки тому +1

      I think the hard part here is not even the integral , it is how you break down the problem of doing expected values

  • @nicholasw996
    @nicholasw996 8 років тому +378

    Please do more videos like this, not the primary school level mathematics in many recent videos.

    • @afrofaust1913
      @afrofaust1913 8 років тому +22

      Then he'd just be doing videos for math-heads, and that's a terrible viewerbase ;)

    • @Czeckie
      @Czeckie 8 років тому +4

      I agree with you! I've considered to unsubscribe before watching this new video.

    • @empmachine
      @empmachine 8 років тому +1

      i 2nd that.. drop the easy ones, this video was awesome! it's been awhile since I've been totally stumped by MYD. normally i either get it, or fall for the trick.. i guess i did realize the numerical brute force approach, but that doesn't really count. geeze I forgot a lot of calc. Thanks again MYD for the fantastic puzzle!

    • @dropyghost
      @dropyghost 8 років тому +1

      Maybe he should have two separated channel. I understand like 30% of the mathematics. Wasnt really that fun.

    • @kckcmctcrc
      @kckcmctcrc 8 років тому +2

      lol...I was just thinking the exact opposite of what you posted. This was way over my head. I am however glad there are bright math folks like you.

  • @mrWade101
    @mrWade101 8 років тому +168

    This is my math skills:
    Shortest length 0
    Longest length Sqrt 2
    so sqrt 2 / 2 ? (≈0.707106781)

    • @96hugoS
      @96hugoS 8 років тому +35

      But there's only 2 ways of making a length of sqrt 2 and many more for other combinations

    • @HYEOL
      @HYEOL 8 років тому +4

      but is the distribution of lengths bell shaped?

    • @parkers.8748
      @parkers.8748 8 років тому

      That's what I thought

    • @victor6543211
      @victor6543211 8 років тому +156

      in the lottery you eitheir gain 1 million dollars or 0 dollars, so, in average, you gain 500k dollars. Congrats!

    • @GraveUypo
      @GraveUypo 8 років тому +7

      this would only work for a sphere.

  • @koldovalnya
    @koldovalnya 4 роки тому +100

    Max: Root of 2
    Min: ~ 0
    Avg: ~ r2/2

    • @cbmajor6017
      @cbmajor6017 4 роки тому +17

      that what i did lol

    • @mrsamsun912
      @mrsamsun912 4 роки тому +18

      Unfortunatly for...all of us, maths do not work like that. Damn.

    • @paolofederici
      @paolofederici 4 роки тому +6

      I also thought in this way
      There are infinite points, so infinite distances between two points.
      The max is root of 2 ... agree
      The min is 0,0000000000000000....1
      So that (root of 2 plus 0,000000000... 1) / 2 should be the answer.
      1,41421356237 + 0,00000000001 = 1,41421356238 : 2 = 0,7071 ...

    • @nikitakipriyanov7260
      @nikitakipriyanov7260 4 роки тому +4

      0.707, too bad estimate

    • @MottBotMinecraft
      @MottBotMinecraft 4 роки тому +6

      I also jumped to root(2)/2 but I believe the min could be zero if the two points you generate have the same coordinates

  • @VivekSingh-ts1ec
    @VivekSingh-ts1ec 5 років тому +208

    First i thought that its a tough question......
    Soon i realized that i can't even understand the solution part

  • @zixuan1630
    @zixuan1630 5 років тому +43

    So infinite many possibilities, I'm going to use calculus. (a few minutes later) Ugh, this is hard.

  • @TaleshicMatera
    @TaleshicMatera 3 роки тому +12

    My first guess was about 0.561 so I'm pretty happy with that
    My solution, vaguely, was that the answer had to be bounded between 0 and sqrt(2), but more realistically, between 1/2 and sqrt(2)/2
    Since those two extremes were when my line crossing the square was horizontal (theta=0) or diagonally (theta=45 degrees), I just averaged them according to theta
    (integral 0.5/cos(x) dx from 0 to pi/4)/(pi/4 - 0) = about 0.5611....
    I only swept out 1/8th of the square because all the other 8ths would've been the same.

    • @newplayer3259
      @newplayer3259 2 роки тому +1

      I got same answer by imagining. I imagined a square with 16 points in he shape of a square and drew a diagonal cutting the square into 2 triangles and I chose one of it, starting at one of its vertex there are 9 outcomes and 9/16 tuns out to be 0.5625. Idk why but it worked that way.

    • @newplayer3259
      @newplayer3259 2 роки тому +1

      As the points keep increasing in the shape of a square that is 16, 25, 36 the answer by this method is approaching 0.52

  • @matejljubicic6370
    @matejljubicic6370 8 років тому +6

    This is what happens when people in the comments complain... GREAT JOB, PRESH! I LOVE THIS!

  • @ximecreature
    @ximecreature 8 років тому +134

    Well, mentally I got this :
    Minimal distance : 0
    Maximal distance : Sqrt (2) (the diagonal)
    Average?
    Sqrt(2)/2
    Which is within boundaries.
    Then I saw your video and felt stupid. Someone with me?

    • @holonaut
      @holonaut 8 років тому

      I think this would be correct for a line of the length sqrt(2).

    • @superdau
      @superdau 8 років тому +11

      I started with that as well, but then immediately saw that the number of "possibilities" increases the shorter the distances are.

    • @ximecreature
      @ximecreature 8 років тому

      Indeed. I think this is were I missed the point of the question and the "very hard" pqrt

    • @1Joren
      @1Joren 8 років тому +2

      Started with sqrt(2)/2 as well. Didn't imagine the problem to be this complicated

    • @ramacanda
      @ramacanda 7 років тому +1

      PositiveANegative i thought the same as you. i got 0.7

  • @HaynerVideos
    @HaynerVideos 5 років тому +3

    One method to estimate the answer is to divide the square into n = 2x2 = 4 blocks and then consider only the center points of the blocks. The average distance between the center points is about 0.57 - a pretty good estimate for not much work! The estimate can be refined by increasing the number of n blocks with (n-1)*n/2 unique distances to average.

  • @christianbarnay2499
    @christianbarnay2499 8 років тому +5

    Reduction from quad integral to double using p.d.f. is thrown without a single explanation as to why it works.
    One important thing I've learned in my school days (before and after graduation) is that reducing nested integrals is never trivial.
    This seems like someone did all the computation the hard way, then found out a simpler similar looking integral leading to the same result, and then gave the name p.d.f. to the factor that converts one to the other. So this video is just reversed reasoning using a fact as proof of it's own definition.

  • @dreadpiratetjoris
    @dreadpiratetjoris 3 роки тому +5

    “With just horizontals and verticals, it’s going to be 0.5 , but there’s also diagonals so it’s going to be a bit more” is what I thought. No idea if that makes sense but it’s close enough to the answer to make me feel happy.

    • @combatwombat8581
      @combatwombat8581 Рік тому

      The average distance between 2 random points on a line with length 1 would be 1/3, not 1/2 in fact. But good try ;)

  • @Icenri
    @Icenri 3 роки тому +3

    Method to avoid using distributions:
    Any two points from S=[0,1]x[0,1] define a distance vector V of modulus D with D^2 = |Dx|^2 + |Dy|^2.
    Let's also define an associated rectangular area A=[1-|Dx|, 1-|Dy|] for any of these vectors.
    All possible origin points of vectors parallel to V, Vi = Pi + V = (x+Dx, y+Dy) are contained in an area with the size of A. Take into account that flipping the origins and ends of these vectors yields a similar set with the area on the opposite corner.
    For any pair of positive deltas that define D in the formula above, there are four combinations of Dx and Dy due to signs and absolute values. We've taken already two of these combinations already and there are two more that can be obtained by reflecting horizontally or vertically our original vector V.
    This means that for any pair of positive deltas that yield these sets of vectors, there are 4 copies of the same area.
    With all this all possible vectors are now taken into account.
    To get the average distance, we want to add up the distance D of any of these vectors with positive deltas, so it will be D times A for each vector, hence integrate 4DAdA over S.

    • @ultimatedeatrix9149
      @ultimatedeatrix9149 2 роки тому

      very neat! thanks for the alternate explanation, i didn't get the probability density function part in the video.

  • @andrasfogarasi5014
    @andrasfogarasi5014 8 років тому +29

    Since I have no idea on how to approach this problem, so I wrote a python script that calculates the avarage of random arrangements. I've got 0.52.

    • @rspandit4786
      @rspandit4786 6 років тому +3

      I wrote a PHP script that iterated through every line in an n x n grid and came out with 0.5214575816589 (for n=9999) - higher values of n would give me higher accuracy but not a great deal of point due to the time it takes to brute force this. Would never have been able to do that integral

  • @Jotakumon
    @Jotakumon 8 років тому +31

    Figured it out until the quadruple integral. Then got stuck. Also had the idea of using the Delta(x) and Delta(y) as variables, but I thought that would just give me much more work, finding the distribution etc., but it turns out to be easier.

    • @5eurosenelsuelo
      @5eurosenelsuelo 8 років тому

      Could explain me why using that integral? Or tell me a webpage with related information. I'm looking forward to understand it

    • @Jotakumon
      @Jotakumon 8 років тому +8

      5eurosenelsuelo I used a result from probability. We have that tge average of the value of an event is the sum of all the possibilities times their respective probabilities.
      For instance the average when you throw a die is:
      1/6*1 + 1/6*2 + ... + 1/6*6 = 7/2
      Now this is for a discrete space, i.e. we can count those events. The problem above is that the points can be everywhere in the square, and their coordinates a real, so they coule be any irrarional number.
      But the idea is basically the same. You take the sum of all possible values times their respective probability. In this case it will be an infinite sum of infinitely small terms (as the probability of getting one point among infinitely many is infinitesimally small). So we'll get an integral.
      Here the event is getting two points P and Q, and the value is the event. The probability of getting two particular P and Q is infinitesimally small.
      But we have discretisise the square. We can draw a grid that splits it into n columns and n rows. Each intersection of the grid is the possible points that we could get randomly. In that case we get the same problem, but with a finite number of points for a fixed n. So we can use our formula for the average in discrete spaces, i.e. the sum of all possible values times their probabilities.
      Then we let n tend to infinity and we get our result. If we fix the point P and the first coordinate of Q, then we just move the second coordinate of Q. Then we'll get a sum from k= 0 to n of terms dependent on n (and k). By rewriting it a bit, we can use Riemann integration to write the limit of a sum as an integral, namely:
      lim (n->0) 1/n*sum(k = 0 to n) of f(k/n) = integral (from 0 to 1) of f(x)dx.
      The 1/n will come from the probability of the second coordinate of Q being one of the n possible values, f will be the length of the segment [PQ]. So you get the first integral.
      By doing that now for each coordinate we get four of these.
      There are some other ways to explain it, the same principle though. The second method he uses after realising that 4 integrals is a lot is actually the same. Just now he takes the different lengths Delta(x) can have instead of the different values the coordinates can have. All he has to do is to adapt the probability, namely adding the probability that the segment has length Delta(x). And same for Delta(y).

    • @5eurosenelsuelo
      @5eurosenelsuelo 8 років тому +1

      That's a nice explanation
      You helped me so much. Thank you:)

    • @5eurosenelsuelo
      @5eurosenelsuelo 8 років тому

      All right I thought I got it but when I tried in a paper I realizided I can't yet.
      The example with the die is nice and I totally understand it. I'll try to write with math but it's very hard here
      (value of the event 1)*(prob of the event 1)+(value of the event 2)*(prob of the event 2)+etc
      In this case the event is the distance between PQ which numerical value can be calculated by pythagoras and can take any value from 0 to sqrt2 for this square. Then I have to multiply each event by its probability and here is when I get lost and mad. I see I'll need to integrate to do that multiplication because we're working with infinite values but I just don't see how to know what's the probabilitie of each event.
      I understand you already tried to explain to me so if you think you did all you could is totally perfect if you redirect me to some book or webpage. Thanks anyway:)

    • @Jotakumon
      @Jotakumon 8 років тому

      5eurosenelsuelo I'll try to write it mathematically.
      Imagine you have split the square into n rows and n columns, by painting a grid into the square. Now you don't accept all points on the square, but only the intersections of the grid. So you get (n+1)² points, or n² or (n-1)², depending on whether you take the the border of the square into consideration. To make it easier let's say we have n² points, that is if we take the points on the left and bottom border, but not the ones on the right and upper one.
      So the points have for x-coordinate one of the following: 0/n, 1/n, 2/n, 3/n, ... (n-1)/n; and for y-coordinate: 0/N, 1/n, 2/n, 3/n, ... (n-1)/n. For instance points on that set would be (1/n, 5/6), (0,2/6) for n = 6. Points that are *not* in that set would be for example: (0, 2/5), (3/6, pi), (0,1). Let's call that set A_n.
      So here you have finitely many points: n² to be precise. I name you any two points B and C. What is the probability, if you take two random points of that set A_n, to get B and C? That's 1/n² * 1/n² = 1/n⁴ (B and C can be equal).
      We have that A_n² ist the set of all pair of points in A_n, right? For any pair in A_n², we have consider it's length, i.e. the distance between the two points. So now to calculate the average length, we can take the sum of the lengths of all pairs in A_n² times the probability that they appear, which is 1/n⁴.
      So the average would be:
      sum over all pairs p of A_n² of [1/n⁴ * length(pair)]
      = 1/n⁴ * sum over all pairs p of A_n² of length(pair)
      Now we can split that into 4 encapsulated sums, the 1st sum makes varying the x-coordinate of the point A, the 2nd sum makes varying the y-coordinate of the point A, the 3rd sum makes varying the x-coordinate of the point B, and the 4th sum makes varying the y-coordinate of the point B.
      Eventually we can split the 1/n⁴ into four 1/n, each one will be put in front of a sum. So the inner sum will be:
      1/n * sum 0 to n of [lenght(pair)] and the length of the pair can be described by the coordinates of the points. This will give us a Riemann integral if we let n tend to infinity. So we'll get the integral from 0 to 1 of the length(pair)dy_B . Then by doing the same with the other sums we will get the four integrals and dy_B*dx_B*dy_A*dx_A in the end.
      Another way, and maybe an easier one too, is to see this it the following way:
      Let be A the set of all points in the square (so [0,1]²), then A² is the set of all pairs of points in the square ( = [0,1]⁴).
      Let be p in A² a pair of points. Let d be the distance function, so d(p) gives the distance between the two points that form p.
      You see that we don't really talk about distance of two points (which are two objects), but length of a pair p (one only object) in A².
      The average length in the square is then given by:
      integral over A² of [d(p) (dμ)] (dμ defines the measure, not important for now, it's like the dx in a one-dimensional integral).
      That's a result from probability. Actually it derives directly from the definition of the average in probability (in continuous spaces).
      So you go over all A² and integrate the length. You can also take you variables x_1,x_2,y_1,y_2 to describe the points (x_1,y_1) and (x_2,y_2). So to go over all A² = [0,1]⁴, you can go for x_1 over [0,1], then for x_2 over [0,1], for y_1 over [0,1] and y_2 over [0,1], and your dμ will become dx_1*dx_2*dy_1*dy_2. So you'll get the integral that we looked for.

  • @thelightningwave
    @thelightningwave 5 років тому +2

    He glossed over all of the hard stuff not even trying to explain any of the hard stuff and went into super hard detail of all the stuff. This a great example of what not to do if you plan on teaching to somebody.

  • @FelixNielsen
    @FelixNielsen 8 років тому +343

    Did I figure it out? Who do you think I am? Stephen Hawking?

    • @justunderreality
      @justunderreality 8 років тому +16

      This is much lower level then Stephen Hawking

    • @FelixNielsen
      @FelixNielsen 8 років тому +14

      That wasn't really the point was it?
      For many people, myself included, even though I'm actually rather good at math, integrals and differentials is advanced stuff.
      Personally I've had the opportunity to learn at least, but there's simply too much to remember for my defective memory. It's not simply a matter of understanding the concepts, like with say trigonometry.

    • @justunderreality
      @justunderreality 8 років тому +10

      Felix Nielsen
      For some people this level of problem is as "simple" as trigonometry (whether due to trigonometry being foreign or a comfort with calculus). You comparing this problem to Stephen Hawking level analysis insults all those that are ambitiously attempting to solve his standard problems but sometimes falling short.
      It's like saying "everything you've done before is SO SIMPLE (and those that haven't gotten them are dumb)... but NO ONE can get this one because I can't. So stop teaching us and give us more problems that make me feel good about myself!"
      In the end, I just found your opening post a bit insulting.

    • @FelixNielsen
      @FelixNielsen 8 років тому +8

      You're not listening. You made something big out of something small, and I explained why it is in fact objectively very difficult. That's that. There's nothing else to is.
      Furthermore you proclaim that I'm insulting people, when nothing could be further from the truth. That in itself is an insult. You then go on to tell em what to do and not to do, and implying that I'm stupid.
      You can't put it however you like. It is you who are in the wrong and it is you who have made an insult.
      As for the problem, I have no issue with it on it's own, but asking "Did you figure it out?" as that is in anyway likely, is rather stupid I think, though that was not at all why I posted what I posted. It was simply a proclamation that I didn't have a chance in hell of figuring it out. I wouldn't even know what to Google for, and though you obviously will find it hard to believe, I am actually rather intelligent, I simply don't have the ability to remember a bunch of complicated formulas that have no use in everyday life.

    • @justunderreality
      @justunderreality 8 років тому +3

      Felix Nielsen
      As a comparison, I found it fairly simple... so how would you like it if this was his standard difficulty (my guess is you wouldn't watch his videos then) and you still tried them to further your mind, but then at some point someone (me for an example) wrote "this puzzle is ridiculous!" even after he explained it.
      You can take offence to my description or the fact that I called you out... honestly I don't care. I'm just trying to inform you that your comment could be taken offensively (although I was trying to do that discretely to begin with.. but you didn't seem to understand).

  • @slateflash
    @slateflash 8 років тому +44

    "did you figure it out?"
    *HEEEELLLL NOOOO*

  • @billak0s1
    @billak0s1 2 роки тому +2

    As an ECE student, i first thought how simple it is to just generate numbers and provide the average of distance. However, geometrically my initial thought was that we can draw a circle inscribed to the square so the majority of points are going to have an average distance of 0.5. I loved the integrations' solution and how helpful polar coordinates were.

  • @natevanderw
    @natevanderw 3 роки тому +7

    Perfect video for the next time I teach a senior level probability course! I will make sure to read the top rated comments out during class for extra humor.

  • @bjrnarflate5884
    @bjrnarflate5884 3 роки тому +13

    "I'm guessing it's about 0.5, but a bit off"
    "This probably has some analytical solution I would not think of in a hundred years"
    "Eh, just simulate the thing numerically"

    • @gertoppermann9230
      @gertoppermann9230 3 роки тому +1

      True, I knew I couldnt solve that Problem but 5 lines of python and a 2-minute wait gave an even more accurate solution :)

    • @asiamies9153
      @asiamies9153 3 роки тому

      What is your reasoning for the "a bit off" part, though?

    • @asiamies9153
      @asiamies9153 3 роки тому

      @@gertoppermann9230 How many simulations did you do?

    • @gertoppermann9230
      @gertoppermann9230 3 роки тому

      @@asiamies9153 I think for about 100 million. After that the average was steady enough that i concluded the result should be very close to the real answer, which was enough for me.

    • @asiamies9153
      @asiamies9153 3 роки тому

      @@gertoppermann9230 okay

  • @Tomahawk1999
    @Tomahawk1999 5 років тому +28

    Did you figure this out?
    Me: .... only part i figured out is i cant figure it out

  • @TheDeadlyPeadle
    @TheDeadlyPeadle 7 років тому +4

    I tried it in a very different way,...
    I just calculated the average distance from one x1 to another x2 point, which is 0,36- ignoring y completly. This is very easy to do, just calculate the average of each point to another.
    So for example if your x1 is 0, the average to a random x2 is 0,5 -> (0+0,1+0,2+0,3+0,4+0,5+0,6+0,7+0,8+0,9+1)/11 , go on with x1 is 1 and so on,
    in the end it's ((0,5 + 0,418 + 0,354 +0,309 +0,281)*2 +0,272)/11 = 0,36.
    Since this is a square, the average distance from one y1 to another y2 point is also 0,36.
    Now we have an triangle with the points A, B and C.
    The distance from A to B is 0,36 - the distance from A to C is also 0,36. We now have to figure out the distance from B to C - which is our end result.
    So sqrt(2*(0,36^2)) = 0,513
    which is kinda close to the result from this video.
    I'm not very good in math, so I'm not quite sure why this isn't the exact same result. If someone can enlighten me, please do it!
    Also sorry for my bad english, I'm from germany.

    • @shahtamzid
      @shahtamzid 7 років тому +1

      I think you're getting only an approximate value because x1 and x2 are continuous variables, i.e., they can take any value from 0 to 1, not just 0.1, 0.2, 0.3 etc, but also something like 0.123011345 and so on. You treated them as discrete variables, hence you get an approximation, which is close, but would improve if you included more values in the interval 0 to 1.

    • @robinsuj
      @robinsuj 6 років тому +2

      He basically just "integrated". But using a poor approximation. More points would (probably) give a better result, and the integral is exactly THE result.

  • @NotYourAverageNothing
    @NotYourAverageNothing 8 років тому +16

    I understood everything, except 4:04 and 6:50.

  • @morning5tarr
    @morning5tarr 4 роки тому +26

    Imagine this question being asked in Computer science interview.

    • @bennettkrack9247
      @bennettkrack9247 4 роки тому +18

      The Monte Carlo solution he showed first would probably be the correct answer in any CS interview.

    • @peterpan408
      @peterpan408 3 роки тому +1

      Agree, keep iterating until the result stabilizes to the desired precision.

  • @Mobin92
    @Mobin92 8 років тому +40

    I guessed 0.5 at the beginning.... That totally counts ._.

    •  8 років тому

      I gussed a littlebit over 0.5 :D

    • @HubrisInc
      @HubrisInc 8 років тому +2

      Yeah, gut instinct lead me to .5 as well.

    • @CloudeAytr
      @CloudeAytr 8 років тому +2

      No, no it doesn't.

  • @AlchemistOfNirnroot
    @AlchemistOfNirnroot 8 років тому +261

    Just gonna guess sqrt(2)/2

    • @AlchemistOfNirnroot
      @AlchemistOfNirnroot 8 років тому +28

      Yh, I had no chance :P I can do integration for basic functions using rudimentary methods(IBP,u-sub etc), but chancing coordinates for a quadruple integral? Nah.

    • @TheDGomezzi
      @TheDGomezzi 8 років тому +17

      This was my guess too! Did you get this by starting from the 1 dimmensional version and putting that into the distance formula?

    • @pimakpimak
      @pimakpimak 8 років тому +2

      I estimated that by doing what you just said

    • @muriloferreira6307
      @muriloferreira6307 8 років тому +2

      But is it right? That was also my guess o/

    • @kennethfuher1686
      @kennethfuher1686 8 років тому +48

      I thought root(2)/2. What I did is I said: What's the maximum possible distance? Well that'd be 1 squared plus one squared and then the sqrt of that. So root(2) is the maximum distance. If the minimum possible distance is zero, just average them out. root(2) plus zero is root(2), then divide it by two.

  • @icarofreire7963
    @icarofreire7963 6 років тому +1

    I kind of figured it out... but, instead of paper and pencil, I wrote a Python program that generates 2 random points in the square, calculates the distance between them and then finds the average distance. It's amazing how it matches exactly the same value :)

  • @ElitAcilan
    @ElitAcilan 7 років тому +20

    I set up the quadruple integral and then let computer solve it for me :D

  • @igxniisan6996
    @igxniisan6996 3 роки тому +5

    I rly love how the subtile always says something like, “Hey this is pressure Locker...”

  • @uelssom
    @uelssom 4 роки тому +1

    You know? I really paused the video and went to try it myself. FOR FOUR YEARS.
    Ok, i just actually worked on it every now and then. I knew it would come down to a complicated integral, but i wasnt very interested in that.
    Actually, i was more interested in how many ways this could be approached, by geometric constructs, by intuition, by a "lazy statistical" approach, and of course, by programming a bunch of random points and averaging (though i wanted to leave this option to be the last as it would give me the number and interfere with my intuitive methods i was constructing)
    I got some interesting results out of these methods, which im much more proud than the more precise number i got from the simulation and from the exact calculus.

  • @neptez
    @neptez 8 років тому +200

    Somehow i felt intuitively that the answer is 0.5...

    • @Uranya7x
      @Uranya7x 8 років тому +3

      the SAME

    • @rinthh5477
      @rinthh5477 8 років тому +1

      Me to!

    • @turun_ambartanen
      @turun_ambartanen 8 років тому +52

      nice, but it isn´t

    • @kotzzz9
      @kotzzz9 8 років тому +2

      if you model it with continuous uniform distribution thats the answer you ll get but its too simple unfortunately

    • @kotzzz9
      @kotzzz9 8 років тому +1

      +kotzzz9 since its assuming that the points are across a line rather than along a square

  • @kyc269
    @kyc269 7 років тому +14

    "We have now simplified the integral" I have no idea what's going on.

  • @2robotguy
    @2robotguy 5 років тому +1

    If the box size changes what happens to the average length? Fox example what is the average length between two random point in a 5X5 box and a 5x8 rectangle? Is the average length a linear solution as the box size increases?

  • @FireyDeath4
    @FireyDeath4 3 роки тому +7

    Right, this went so completely far over my head that I don't even care at this point.

    • @PaulSmith-pr7pv
      @PaulSmith-pr7pv 3 роки тому

      Yeah it relied on a lot of background knowledge. A university mathematics course helps, though you can always teach yourself. 3brown1blue channel has a load of great videos.

    • @asiamies9153
      @asiamies9153 3 роки тому

      @@PaulSmith-pr7pv Which courses would be enough? calc 1, 2, 3?

  • @KeyserSoseRulz
    @KeyserSoseRulz 7 років тому +10

    You should have labeled this video with WARNING GRAPHIC VIDEO instead of very difficult.

  • @5gonza541
    @5gonza541 5 років тому +1

    My though procces (before seeing the vide, probably wrong lol)
    -The maximum distance posible is the square root of 2, and the minimal is (in a proctical sense) 0
    -There can be done an infinit amount of lines of sizes [square root of 2 to 0[
    -Intuatively as smaller lines require less space to be put, there should be more small lines. But as the amount of any line is infinit, I’ll consider the amount of small lines to be equal to big ones. This logic aplies to everything in between, as the distribution should ve equal theought the possibilities.
    -To simplifie the problem I’ll do the average distance in a circle of a diameter of 1:
    - In this case as the max is 1 and the least is basically 0 the averige distance should be: (1+0)/2= 0.5. Also as the distribution of values should be equal above and bellow the average we can ignore those values.
    -To answer the circle problem we can subtract the area of the circle to the area of the squre
    Area of square = 1
    Area of circle = 0.785398...
    1-0.785398...= 0.214621...
    I’ll treat this new area as a circle to get it’s average length
    First I’ll calculate the diameter of it using a bit of algebra and the area formula (I’ll skip that part cause it’s kind of long, the diameter is:
    0.26136160043...
    Now, using the knowledge of how to get the average distance of a circle we can know that the average distance of this one is:
    0.13068080021
    So now we need to add this to the average length of a line in a circle (0.5)
    0.5+0.13068080021= 0.6306808002
    So my final answer is that the average length of a square of side length 1 is 0.63068080021...
    Also, sorry for my grammar I’m not native English lol
    Edit: I was wrong lol

  • @firelow
    @firelow 8 років тому +28

    How the fuck am i supposed to know how hard this is for regular people if its not written in the title?

    • @androidkenobi
      @androidkenobi 8 років тому +4

      you flip to the back pages in your Book of Life for the answers, duhhhh

    • @ar_xiv
      @ar_xiv 8 років тому +2

      I guess you have to watch the video while being a regular person

    • @TechnoCreeper2016
      @TechnoCreeper2016 8 років тому +4

      You should know by now this is a channel for smart people.

    • @SOLAR_WillToWin
      @SOLAR_WillToWin 8 років тому

      Thinking about it is a good exercise even if you don't come up with the answer yourself.

    • @JohnAlexiou
      @JohnAlexiou 8 років тому +1

      I was wondering what percent of population could easily follow. I could, but I bet only a tiny fraction could even do the polar coordinate transform.

  • @architsrivastava203
    @architsrivastava203 5 років тому +11

    I got till integration. But that jump of logic to convert x1,y1,x2,y2 to del x del y and then to polar coordinates was pure genius. But to be honest, I am rather pleased with myself for reaching as far as I did.

  • @japeking1
    @japeking1 6 років тому +1

    I love it..."Did you figure it out?".... I didn't have a clue ( ok ...I did follow the random number crunching method ) and have decided to just die in ignorance rather than try to grasp what the heck you did with those integrals.

  • @monkeyCh27
    @monkeyCh27 5 років тому +16

    This doesn 't look that hard
    *sees solution*
    What the f...

  • @Fiyaaaahh
    @Fiyaaaahh 8 років тому +14

    I have no idea why you made things so complicated and did not map this onto the 1D variant. Let E(delta(x)) denote the expected difference between two points chosen at random in the interval [0,1]. If you know this value, and use the fact that E(delta(x)) = E(delta(y)) for the 2D variant, then the answer is simply sqrt((2*E(delta(x)))^2).

    • @Fiyaaaahh
      @Fiyaaaahh 8 років тому

      ***** The chance of randomly choosing two points in the [0,1] interval which lie distance 0 apart (i.e. exactly the same point, with infinite precision) is zero. Hence the expected difference -- which I called E(delta(x)) -- is definately > 0.

    • @Der1Metzler
      @Der1Metzler 8 років тому

      +AnotherBrickSPB
      I watched the video just now and used exactly the same approach. Can you tell me why this is wrong if you have figured it out by now?

    • @chrisquevedo1345
      @chrisquevedo1345 8 років тому

      Yes I figured if you knew the average value of deltax and deltay then you can just put those into distance formula and get an average distance but I guess not. Still can't wrap my head around why it doesn't work and why it's a bit smaller than the actual answer

    • @chrisquevedo1345
      @chrisquevedo1345 8 років тому

      Then again if the same idea is applied to average distance between two points on a line then the formula for that is just |x1-x2| and the average value of x1 or x2 would be .5 which would make the average distance 0 which is wrong. It's harder to see where it fails in the square but seeing it fail on the line it's not surprising that it gives the wrong answer

    • @Fiyaaaahh
      @Fiyaaaahh 8 років тому +1

      Except it is not 0.5. The expected distance of a single point to 0 (or 1) is a half, but the expected distance of 2 random points *to each other* is a completely different number.

  • @MichaelShebanow
    @MichaelShebanow 6 років тому +2

    I had a similar problem given to me as an interview question for a job. You have a sheet of ruled paper and are given a pin that exactly fits between the ruled lines vertically. If the pin is randomly dropped from some height above the paper, what is the probability that the pin will straddle one of the ruled lines?

  • @Epoch11
    @Epoch11 8 років тому +7

    You seem to go from puzzles that are incredibly easy to ones that are nearly impossible.

  • @nikolaytsvetkov4661
    @nikolaytsvetkov4661 8 років тому +17

    I don't know the answer yet but would like to solve it for the circle (with a d=1) as well.

    • @Vladislavchooo
      @Vladislavchooo 8 років тому +4

      fellow bulgarian :?

    • @pairot01
      @pairot01 8 років тому +2

      r=1 *

    • @Nivaldo85
      @Nivaldo85 8 років тому

      I tried the spreadsheet method, for a circle of radius 1 or diameter 2, and i got about 0.72, so for a circle of diameter 1, from my calculations, it should be 0.36.
      Not really sure 100%.

    • @DC-wv2zg
      @DC-wv2zg 8 років тому +1

      Hm, I tried something with MatLab and got 0.453.
      I created to sets of Points with coordinates between -0.5 and +0.5 and then removed all points with a distance to the origin greater than 0.5. After that I calculated the distance between two points, one from each set, and took the mean. But maybe I'm wrong.

    • @pairot01
      @pairot01 8 років тому

      11011100DC Seems like you only used points a line (a diameter of the circle) and not the whole space of it

  • @hungdoan6062
    @hungdoan6062 7 років тому +2

    I love how he just put out all of the crazy math and he asked did you get the solution

  • @xyz.ijk.
    @xyz.ijk. 6 років тому +5

    That was an amazing solution. Thanks! I was looking for something much more mundane.

  • @jonathanfowler2932
    @jonathanfowler2932 8 років тому +5

    Wow. This sure was a good one. I have to admit, this was way beyond me. Do you think it would be a good idea to have like a difficulty rating at the start so that people with less classroom experience could pick out the ones which have emm... fewer quadruple integrals? I absolutely loved the video and that such a simple problem can have such a complex solution, but when the easier problems come along, I'm never sure if I want to even start in case it's like impossible.

  • @donaldbiden7927
    @donaldbiden7927 5 років тому +2

    His probability videos are truly amazing

  • @orngng
    @orngng 6 років тому +14

    7:30
    Well
    UUH
    I would never thought of that.

  • @okrajoe
    @okrajoe 6 років тому +38

    The dreaded polar coordinates.

  • @niall__
    @niall__ 6 років тому

    Brute force solution for n-dimensions in Javascript:
    function averageDis(dimension) {
    const iter = 10000000;
    let a = [];
    for (let i = 0; i < iter; i++) {
    let sum = 0
    for (let d = 0; d < dimension; d++) {
    let d0 = Math.random(),
    d1 = Math.random();
    sum += (d1 - d0) * (d1 - d0);
    }
    a.push(Math.sqrt(sum));
    }
    return a.reduce((t, n) => t + n, 0) / iter;
    }

  • @oscartiny9919
    @oscartiny9919 5 років тому +3

    @mindyourdecision, sir please help me understand the substitution at 4:22, I cannot find a derivation for it. Thanks in advance

  • @critical11creator
    @critical11creator 8 років тому +18

    I calculated it to be 0.527 from a different method. I was surprised I was off even though it was just by a bit. What I did was divide the triangle into 2 parts, 1 being 1 third and the other being 2 thirds. The average distance should be the max possible distance from the weight center of the square divided by two (aka all possible above half minus all possible under half). So it's sqrt (1^2 +(1/3)^2)/2 = 0.527

    • @richardaversa7128
      @richardaversa7128 8 років тому

      Mustang De Man efficient method well done

    • @mangekyoumusa
      @mangekyoumusa 7 років тому +4

      If u split the square by 106/300 and 194/300 u would’ve gotten 0.521

    • @Primitive_Code
      @Primitive_Code 6 років тому

      Mustang De Man how does the square root of "1^2" + anything equal to a number less than 1? Kids in Algebra 1 would prove you wrong.

    • @sonalidasgupta3562
      @sonalidasgupta3562 5 років тому

      Mustang....could you please elaborate the logic?...it sounds interesting 👏

  • @davidseed2939
    @davidseed2939 3 роки тому

    The figure at 5:12 might be misleading. There has been a change of coordinates so that this square is not the x and y of the original square but deltax and delta y. Also tge triangular distribution can be considered by looking at the difference in scores between two dice. The maximum distance can be acheived in two ways (6,1)(1,6). The minimum distance in 6 ways(pairs). So the pdf of the distance decreases with distance. Thus for an x separation of 1 we require the chosen points x1,x2 at the extreme left and right of the square. with a pdf of zero. This is where the factor (1-x) comes from.

  • @TheRocketRaider
    @TheRocketRaider 8 років тому +46

    Why am I watching this? I have to wite a paper for college... and I don't even know how to math

    • @Trynottoblink
      @Trynottoblink 8 років тому

      I hear you. One time I binge-watched math videos to avoid studying for a physiology exam.

    • @NicoA47
      @NicoA47 8 років тому

      Ah good, so I'm not the only one.

    • @hattenkofer
      @hattenkofer 8 років тому +24

      Luckily you know how to English.

    • @Reylaymon
      @Reylaymon 8 років тому +3

      i don't even know how i got to this video why am i here

  • @JasonKaler
    @JasonKaler 8 років тому +69

    If it was a circle and not a square, would the answer be 0.5 ?

    • @ophello
      @ophello 8 років тому +1

      Jason Kaler I wonder that same thing.

    • @iWinGamer
      @iWinGamer 8 років тому +9

      Jason Kaler yes

    • @Robobrine
      @Robobrine 8 років тому +33

      No, it would be ~0.453 for a d=1 circle.

    • @leavemealonedamnyou
      @leavemealonedamnyou 8 років тому +1

      Robobrine why is that

    • @Robobrine
      @Robobrine 8 років тому +13

      +djahid abdelmoumen because I tested it? You can also do it mathematically and you'll get the same result, but it's just way faster to write a short program to calculate it.
      For the why it's not 0.5: The chance of the points being closer together is higher than them being farther apart, so the result is

  • @promindplayer2468
    @promindplayer2468 4 роки тому

    Side length = 1
    Max length inside the square = diagonal (√2 or approx. 1.14)
    Min length = 0
    We then find the average of these two values.
    Therefore, the answer is approx. 0.57. And that's the perfect answer.
    Hetansh

  • @AltumNovo
    @AltumNovo 8 років тому +18

    What if it's a 1 by 1 by 1.... hypercube of infinite dimensions? What is the average length then? is it infinite?

    • @aless13260
      @aless13260 8 років тому +3

      that's creepy but it's a good question

    • @freshrockpapa-e7799
      @freshrockpapa-e7799 8 років тому +8

      Of course it isn't infinite. You will have a bounded region, and you are taking an average. There is no way it is going of to infinity...

    • @andrewmeyer8783
      @andrewmeyer8783 8 років тому +5

      Altum Novo the consensus online seems to be that as the dimension "n" goes to infinity the solution approaches sqrt(n/6), which would mean that the points would be "infinitely far apart," although this has no meaningful analog. This result is possible because an infinite dimensional hypercube is not "bounded space" in any conventional sense.

    • @AltumNovo
      @AltumNovo 8 років тому +6

      Yes unfortunately the average length for a hypercube of infinite dimensions is infinite because as long as 1 of the lines you can make inside the cube is infinite in length, then the average of all the lines has to also be infinite.
      The longest line you can make in the object is sqrt(n) = sqrt(infinity) = infinity.
      The hypercube of infinite dimensions all having length 1 is a very strange object, almost like an infintely spiky ball, a line from one side to the other equals 1, but going from corner to corner it equals infinity.

    • @freshrockpapa-e7799
      @freshrockpapa-e7799 8 років тому

      Altum Novo You know... Infinity isn't a number, right? So you can't use it like that in an equation.
      It doesn't matter how many dimensions you have, it will still be a region defined as [0,1]^n, which clearly is bounded, so there is no way that the distance between 2 points is infinite.
      Btw: The maximum distance between 2 points will be d=sqrt(n), which means that the average can't be infinity. It has to be less than d.

  • @finnkoepke2250
    @finnkoepke2250 8 років тому +38

    solved it using python
    am i good at maths now?

    • @112BALAGE112
      @112BALAGE112 8 років тому +26

      He's better than you cuz he solved it in Excel.

    • @richarddangle6516
      @richarddangle6516 8 років тому +13

      No, I'd definitely choose Python over Excel.

    • @yuvalgat4163
      @yuvalgat4163 8 років тому

      The question is, did you run a big test and took the average, or actually calculated the math?

    • @tinyman392
      @tinyman392 8 років тому

      How many repetitions did you run, and how did you come up with the number of religions to run?

    • @finnkoepke2250
      @finnkoepke2250 8 років тому

      i calculated the average using 2000 small tests.

  • @kentgladden4316
    @kentgladden4316 3 роки тому

    Square where sides each = 1. The greatest distance between points is the hypotenuse of a right triangle, corner to opposite corner. This right triangle has 3 known angles, & 2 known side lengths. 90/45/45. And 1 and 1. A(2) + B(2) = C(2). So 1(2) + 1(2) = 1 + 1. = 2. C(2) = 2. Hypotenuse = square root of 2. = 1.41421 . 1.4 for simplified illustration purposes. The least distance being just > 0. Divide 1.4 by 2 = "average" = 0.7 .

  • @SrikanthSrinivasamadhavan
    @SrikanthSrinivasamadhavan 3 роки тому +3

    Tough one. 👍. It will be interesting to know, the average distance between points across circle and regular n sided figures. How about a cube?

  • @mrvampire7577
    @mrvampire7577 8 років тому +7

    I concluded 0.6 in a (less than) 10 second estimate... close enough for a lazy man.

  • @Ensivion
    @Ensivion 6 років тому

    integrate (x-a)**2 + (y-b)**2 dx dy da db from 0 < x < 1 and 0 < y < 1 and 0 < a < 1 and 0 < b < 1 this is how I did the problem which gave 1/3 which is actually really close, can you spot the reason why it is incorrect. I know it computes the lengths twice but it doesn't matter since the integral is symmetric, to get the average, you divide by the area which is simply one so that doesn't change the answer.

  • @AnuragGuptainspired
    @AnuragGuptainspired 3 роки тому +3

    "Did you figure it out?"
    Me: "Absolutely not!"

  • @ophello
    @ophello 8 років тому +6

    "Did you figure it out?"
    FUCK no.

  • @matthewjames7513
    @matthewjames7513 5 років тому +1

    The distance between random points on a CIRCLE with area 1 is about 0.592. You have to use cylindrical coordinates and use the cosine rule.
    Matlab code:
    r1 = rand(100000,1)*1/sqrt(pi);
    r2 = rand(100000,1)*1/sqrt(pi);
    th1 = rand(100000,1)*2*pi;
    th2 = rand(100000,1)*2*pi;
    for i = 1:length(r1)
    d(i) = sqrt(r1(i)^2 + r2(i) - 2*r1(i)*r2(i)*cos(th2(i)-th1(i)));
    end
    avg = mean(d)

  • @megatabdullah4169
    @megatabdullah4169 6 років тому +7

    "give this problem a try and..." i was like , how to start

  • @dee_zzy
    @dee_zzy 5 років тому +14

    07:30 is that a rhetorical question 😂

  • @alejandroenciso9650
    @alejandroenciso9650 4 роки тому

    An easy and quick way can be done by considering 2 sqr triang. of side 1 & 1/n, and 1/n & 1/n, they will look after the slanted and parallel lines respectively. We will not use integrals but only sums (only approx. value will be enough). after simplifying we have: 1/4(Sum from n=1 to n=inf. of 1/n), we then calculate for only the first four values:
    1/4(1+1/2+1/3+1/4)=1/4(2.0833)=0.5208
    if we express that with only three decimal places, we have 0.521

  • @GermansEagle
    @GermansEagle 8 років тому +12

    Just use analitical geometry and make it so x+y=1. And (x1 - x2)squared + (y1 - y2)squared = (the result)squared. It's literally pitagorium, sorry for the awesome english, I am black.

    • @GermansEagle
      @GermansEagle 8 років тому +19

      Oh shit, he did that. Well goly, was that a waste of time... Oh boy, time to get the rope ready.

    • @ChrisJaesun
      @ChrisJaesun 8 років тому

      wait why would x+y=1

    • @michaelbauers8800
      @michaelbauers8800 8 років тому +1

      Because penguins don't play D&D. Do I have to explain everything to you Floradragon? ;)

    • @michaelbauers8800
      @michaelbauers8800 8 років тому

      hockey player or emperor?

  • @dhruvthakur1036
    @dhruvthakur1036 6 років тому +47

    *jumpscare warning*
    If you haven't watched the video
    Just go to 4:28 to have a jumpscare

  • @nomekop777
    @nomekop777 Рік тому

    What you're doing at 1:00 is something arbitrary we learned in high school that I never really figured we'd use. But if you're playing Minecraft and trying to find the distance between 2 spawners for a mob farm, you have to do this exact same thing but with a 3rd dimension. Fortunately you can solve one plane at a time, but it's still a fair amount of work

  • @HAPPYChaU123
    @HAPPYChaU123 7 років тому +27

    "Did you figured that out?"
    hmmm...dafuq?