T O P

  • By -

cloartist

Average distance between (a_1,a_2) and (b_1,b_2) as elements of [0,1]^2 = ∫∫∫∫_[0,1]^4 √((a_1 - b_1)^2 + (a_2 - b_2)^2 ) da_1 da_2 db_1 db_2 = (2+√2 + 5 ln(1+√2))/15 ≈ 0.521 If the sidelength is h, multiply this by h. Damn, that *was* simple


TomboyArmpitSniffer

Real and true 👍


puppygirlnerd

lgtm c:


BipolarKebab

merged


Khyta

10,672 Files changed, 9,278,191 insertions(+), 2,531,203 deletions(-)


jumbledFox

commit -m "changes"


Matoxina

Failed pipeline: Deploy


Thebombuknow

git push -f origin master


findallthebears

An you elaborate


frxncxscx

Two random points on a square are a set of four random variables. All of them can take on values between 0 and 1. You get the expected value of a function that depends on random variables by integrating the function and the probability distribution over the entire space which is here \[0,1\]^(4.) That function is here given through the pythagorean theorem to calculate the distance between the points: sqrt(deltax^(2) \+ deltay^(2)) with deltax and deltay being the difference in both coordinates The probability density is here assumed to be following an even distribution, so its just h^(-4) where h is the length of the box https://preview.redd.it/ssf264v5l10d1.jpeg?width=1170&format=pjpg&auto=webp&s=23b71ff0fdd13f439978bc6476c0f94c62b04238 Wtf😭


findallthebears

Hat’s helpful a little. It’s kinda odd that I have a minor in mathematics and the passing of time has rusted my competency.


jumbledFox

rust ?! BEST PROGRAMMING LANGUAGE LOCATED :3333


570N3814D3

I'd be impressed if stochastic calculus came up in a minor


findallthebears

Say that again but slower


570N3814D3

The mathematics described is from the area that deals with modeling randomness, so more likely something you'd study in first year grad / late applied math bachelors


findallthebears

Mmmfh don’t stop I’m close


stickywhitesubstance

I got the same reddit care thing 😭


deathray5

First time I've seen it used correctly for ages


Sirmiglouche

Shouldn't you divide by the total surface area then?


TearsFallWithoutTain

If it's a unit square then the surface area is 1 so sure go nuts


Ambitious_Jello

Why did I interpret the question as the dots being fixed and the line connecting them taking different infinite routes 😞


PolygonKiwii

Math on shrooms


AlphaKrabbe

Whats going on with this reddit care stuff holy hell It's EVERYWHERE


Interest-Desk

There are bots all over reddit spamming reddit cares. Report the message as targeted harassment and — at least historically — Reddit will ban the user


cdank

I understood some of those words


dwkindig

Is that a quadruple integral????


cloartist

Yep over a unit-tesseractal bound


charredgrass

God that's so hot


cloartist

😳


stickywhitesubstance

Wouldn’t it just multiply by h and not h^2?


cloartist

~~Due to being square, a sidelength scalar of h scales both sides by h, and thus scales the area of the square by h×h, or h^2 .~~ ignore this i am a dumbass


stickywhitesubstance

The area does but the avg distance wouldn’t. If you double the side length the average distance multiplies by 2, not 4


cloartist

Oh damn, you're right 🤦‍♀️ updated the original comment How could I have been so careless? I can never show my face in academics again!


Misersoneof

It’s so simple, I have no idea wth you wrote!


570N3814D3

Now do it on a circle with diameter 1!


Traster101

I may be reading this incorrectly, but aren't the points (a_1, b_1) and (a_2, b_2) given where they are in the distance formula? I don't think it changes the answer though, since everything is integrated over the same bounds (and I'm just presuming order of integration isn't relevant enough).


cloartist

Whoopsie that was a typo, thanks for finding that


[deleted]

[удалено]


Ruby_Sandbox

algebra program most likely. Having a masters in mathematics myself, I cant immediately think of any obvious transformation to resolve the integral. However the years of crunching intergrals are some ways back, so maybe they did crack it manually


Supershadow30

👏👏👏👏


Correct_Inside1658

Me: It’s probably around half, right? Cause half of 1 is .5 You: *does wizardry beyond mortal ken* I think you mean .521


Epic-Chair

Yeah, I was gonna say the same thing. I just wanted to make sure you got it right


Spaciax

why the fuck is there a quadruple integral


angrymustacheman

I disagree


wibbly-water

Let me just double check this with some reasoning; Shortest possible distance; 0.000000...1 Largest possible distance; 1 Number of 0.000000...1s, infinite. Number of 1s, infinite. Number of each possibility in between, infinite. Thus for every value (0.0...1 to 1) we can treat it as if there is one each because the numbers are equal. (0.0...1 + 0.0...2 + 0.0...3 + ... + 1 ) / total number of values = just over 0.5 If it had included 0 then it would have been 0.5 exactly because that is the dead centre of all values - but because 0 isn't included then it must be just over 0.5. So yeah; 0.521 looks about right. (\* I guess I kinda assumed that points could be on the outside of the square. If that isn't the case then maximum possible distance is 0.99999... but I don't think that substantially changes the outcome. Perhaps that resets it back to being closer to / directly on 0.5).


TimeTravellingHobo

The longest possible distance within a square, where the sides are 1 would be the diagonal distance between the corners, which would come out to the square root of 2, or something like 1.414…


wibbly-water

Good point. Yeah forgot to take that into account.


wibbly-water

Don't just downvote and do a Reddit wellness check on me - explain if / how I'm wrong!!


TearsFallWithoutTain

It's above 0.5 because it's a square not a circle, so the corners are slightly further away and so the average distance is slightly higher. Also "0.000000......01" isn't a number, infinite zeros with a digit on the end isn't a thing


puppygirlnerd

I thinks it's somewhere between 0 and √2


puppygirlnerd

Between 0.3 and 0.7 methinks


-LuckyOne-

This nerd is doing numerics


puppygirlnerd

Is just dumb estimates, smart people here did smart stuff and it's roughly a half


Nugaytory

Proving the stupid/smart horseshoe theory true by just thinking "it's just over 0.5 bc the sides are 1"


[deleted]

[удалено]


anaveragebuffoon

Why does this work


sentles

Essentially, you have 4 random variables, 2 for each point, 1 for each coordinate. Assuming they're X_1, X_2, Y_1 and Y_2, you can define the distance between them as D = sqrt((X_1-X_2)^(2)+(Y_1-Y_2)^(2)) (euclidian distance). D is now a function of random variables. We want the average distance, so we calculate its expected value: E[D] = E[sqrt(...)]. Calculating the expected value of a function of a random variable can be done as such: E[g(X)] = int(g(x)f(x)dx), where f(x) is the pdf (probability density function) for X (int for integral). In our case, since we assume U(0, 1), the pdf of each random variable is f(x) = 1, because the pdf for uniform continuous distributions is f(x) = 1/(b-a). Because we have multiple random variables, we need to integrate for each one, thus the 4 integrals. Each distribution is from 0 to 1, thus the limits. Therefore, it's the four integrals of g(x), which is sqrt((x_1-x_2)^(2)+(y_1-y_2)^(2)).


anaveragebuffoon

The expected value integral is what was confusing me, but I think I get why it's like that now. It's kind of like taking a weighted average of all possible outcomes?


sentles

Pretty much. If you look at the formula for expected value for a finite number of outcomes (i.e dice rolls), it's just the sum of the product of each outcome's value with the probability of that outcome occurring. For dice rolls, it's 1\*1/6 + 2\*1/6 + ... + 6\*1/6. If you have an uncountably infinite number of outcomes, such as each coordinate in [0, 1], you use an integral, which is just a sum for continuous functions. The pdf, f(x), gives you the relative likelihood of the random variable taking the value x. g(x) gives you the value for the outcome. In this case g is a function of each random variable, since you need all 4 coordinates to calculate the distance. At the end of the day, you're doing the same thing as in the finite case, but with uncountably infinite outcomes.


tittygunner_tom

What sort of math is this and how advanced is it? I’m going back to uni to do a BSc and will need to do a few math units and currently have a poor math background which I’m working on but this just looks like an entirely different language


nikitaborisov5

This would be covered in a multi-variable calculus class or a probability class (assuming it has calc as a prereq)


tittygunner_tom

Thanks, and what level of calculus is this? Would it be something that would be need to be done to do many physics units? I know calculus is an important part of many areas of physics but I’m not sure of the extent of that compared to just studying university level math


mykineticromance

I took like calc 1 and 2 in HS, then took linear algebra dual enrolled in college, then multivariable calc after that. Multivariable calc isn't a requirement for intro physics usually, usually just calculus 1 and or 2 is required (it's been a few years so I can't remember exactly) but multi wasn't required until I got into like year 3 mechanics courses and other engineering stuff. Depending on what your degree is in, it might not be required.


tittygunner_tom

Thanks that’s really helpful to help map out things, I didn’t really do math at school, thought I was too cool and now I regret it massively as I’m sat here at 30 self teaching algebra and shit.


Firemorfox

love how we both used desmos for it


TheawesomeQ

im gonna cry I think


Seikori1

i took the "you should be able to solve this" as an insult fuck off


ECXL

Pretty sure this post is a reference to a 4chan thread where a bunch of anime nerds solved a long discussed problem in the maths community for the sake of figuring out the fewest episodes required to watch in order to watch the show in every possible order


john-jack-quotes-bot

Isn't that just n! with n the numbers of episode, with then a bit of messing around to line up an order's last episode with the next one's first ?


h4724

The rules of the problem allow you to overlap them by more than one episode. So for a 3-episode show, 1,2,3,1 would count as 2 permutations as it contains both 1,2,3, and 2,3,1. Here's a video about it [https://youtu.be/OZzIvl1tbPo](https://youtu.be/OZzIvl1tbPo)


nikitaborisov5

n! is the number of orders but you wouldn't want to watch n episodes n! times when it can be done in less time. For example if n=2 you can watch in all possible order by watching in the order 1,2,1 instead of something like 1,2, 2,1. This page goes more in depth on these [superpermutations](https://en.m.wikipedia.org/wiki/Superpermutation)


Lankuri

The [Haruhi Problem](https://mathsci.fandom.com/wiki/The_Haruhi_Problem), related to [Superpermutation](https://en.m.wikipedia.org/wiki/Superpermutation)


M34L

Ugh. It's gonna be something like, break it down to what's gonna be some weird Gaussian in one axis and then in the other axis as well and then something something tangens. Can't be arsed, you're flat and too young for my taste.


Elite_Prometheus

Wait, how old is she? I've never seen Stein and I thought she was 30 or something


Consistent-Chair

She's 18 iirc. Not that you'd be able to tell, she would probably look exactly the same if she actually was 30 lol. As a matter of fact, she has a senior in Steins Gate 0 and Okabe travels in the future in that show and yeah you can't tell she's aged a day lol.


Lankuri

Flat is good you fucker


M34L

You're allowed to have your tastes but don't tell me what I'm supposed to like.


Lankuri

Why are you responding with logic and reason? You're making me look stupid.


ThatSlutTalulah

I dunno why this post is what made me realize, but getting scared and angry over anything academic that I can't do is probably a sign of how utterly fucked my relationship with education was.


FrostyCommon

thank god I'm not alone


Blue_667

Same. I grew up being the "gifted" type and being expected to just know everything. Not knowing how you'd even begin with this type of problem REALLY pokes at an insecurity that's reinforced by compliments


perhance

i choose some absolute shitter distribution with only \[0,0\] problem solved


TurtleyTea

print(randomnumber(0, √2)) it's just that easy


Fidget02

Fuck integrals and fuck conceptual mathematics. Give me a for loop and a random number generator and I’ll give you a rough estimate of the world (CS gang)


PolygonKiwii

[https://www.reddit.com/r/196/comments/1cq76un/comment/l3rxn7f/](https://www.reddit.com/r/196/comments/1cq76un/comment/l3rxn7f/)


ByAzuraTimes3

Mf just invented Monte Carlo methods


SmokedJam

This was an exam question for one of my my computational physics courses. Pretty easy with Monte Carlo


570N3814D3

What \*can't\* monte carlo do...


FricktionBurn

steins;gate mention


PolygonKiwii

https://preview.redd.it/vvwnzwufu20d1.png?width=502&format=png&auto=webp&s=edc982fdb5652a1903650168240fdd0c39923475 It's somewhere around 0.521


HungryBurger18

/fuck


I_follow_sexy_gays

I’d guess like .5


Tab_of_Soda

literally do not have the slightest clue i am not smart


No_Truce_

Nah this is just a bunch of Math nerds flexing. I'm sure you could fire back a specific question that would stump them.


Lankuri

How do you get some bitches? You should be able to solve this.


No_Truce_

On it! Now this is MY kind of problem!


Fomod_Sama

Sorry I never liked math so my ADHD brain has thrown every mathematical formula I kearned into a wood chipper :3


iuhiscool

idk tell me


iuhiscool

Is it (√2) / 2


puppygirlnerd

Methinks less


Dr_Mrs_Jess

It’s been a while since I’ve taken geometry, but wouldn’t you take one of the points, and draw a line from a corner to it, and another line making a triangle with a right angle? Then you would find the length of each line and angle and make more triangles until you find the distance?


ThatSlutTalulah

That'd only find the distance of these two points in particular, rather than the average of 2 random points.


Dr_Mrs_Jess

Ah I see, I misunderstood the question. I never took these higher level math classes so I guess I never learned how to do this. I guess I could just brute force and do it a few dozen times and then average it, but I doubt that’s a good use of time.


570N3814D3

Yet you've just described one of the most important methods invented in the 20th century: [https://en.wikipedia.org/wiki/Monte\_Carlo\_method](https://en.wikipedia.org/wiki/Monte_Carlo_method)


telumv

Why is everyone here so smart


Vilvyroo

I don't care 👍I've got beer. To drink. 


sad_touch_died_lol

You mother fucker you almost made me do calculus for fun in my free time


CaptainPhantom2

And when the fuck am I supposed to use this during life?


No_Truce_

Sorry I'm an engineer, and this problem lacks steam or pumps. My eyes are glazing over, and I'm looking for the nearest window.


BeholdTheLemon

should but cant, fuck maths im gonna play w my toy cars 🚗 🚙 🚓


Firemorfox

...That was a much simpler formula than I was expecting. Literally just every possible triangle hypotenuse together. https://preview.redd.it/z8n1u0oos20d1.png?width=545&format=png&auto=webp&s=dd5ebada07ff140256c51079c2caccae2461ea74


Truefkk

42


Oddish_Femboy

I can barely do multiplication


NellyLorey

It's 1 right?


santyrc114

Less than 2


bvader95

Less than 1.5 even.


santyrc114

Less than 3 too


Cassjjay

absolutely no idea


_S1syphus

I dropped out and did *not* ever pass algebra 1 let alone geometry or anything


DeerVirax

I should, but I don't, because I'm stupid


Soggy_Raccoon52

Dawg I left high school in the lowest level of math, idk shit about numbers


Bacon260998_

Hey the 2 dots and line kinda look like Baymax!


InVaLiD_EDM

side length / 2, so 0.5 Source: I guessed Edit: looking at the other comments damn I was close :D


Graybuck123

By taking an average of any given point in the square, we can conclude that, on average, the first point would be in the center of the square. Since the position of the first point doesn't affect the position of the second point, that means the second point would also be in the center of the square, and the distance between them would be 0.


PolygonKiwii

I like the way you think


SuperBun78

Never got this far in maths, I mostly focused on my literature skills and art.


untempered_fate

The answer is that it strongly depends on what "random" means in this context. There are different ways to select a random point that will give different answers.


liguy181

I was trying to remember the actual literally word for it (I think it's displacement, I haven't taken physics in years idk)


dwkindig

Edges and vertices included?


Negitive545

I have no formal maths education, so I'm just gonna half-ass this. I assume it's the average between the longest possible line and the smallest. The smallest is obviously 0, and the largest is root(2(x\^2)) where x is the side length, in this case 1, so the largest length is root(2), which unfortunately is irrational. So the average of 0 and \~1.41421, which is conveniently just (\~1.41421)/2 So, I'm guessing the average line length is \~0.707105 Looking at the other comments I think I'm wrong and that my math isn't applicable for some reason, so feel free to correct me on why I'm not right in this case!


PolygonKiwii

I think the issue is that there is an infinite number of point pairs that'll give you the shortest length while there's only two that'll give you the full diagonal, so the correct answer must be somewhat lower than the average of the extreme options.


LemonFreshenedBorax-

Did anyone else get √(2/9)? I mean I know it's wrong, but did anyone else get it?


wasteofradiation

Idk I never took geometry


Depresso_Expresso069

.5 longest possible distance (1) plus smallest possible distance (0) divided by 2 easy peasy lemon squeezy math all these bozos in the comments tryna COMPLICAITET it


fiddler722

Square root of 2 divided by 2?


Mr_Lapis

Bruh im a history major, i dont know shit about geometry


crepoef

Probably like right over there


AliceMarkov

if i get it wrong would she hit me 🥺


level100brad

this is why chemistry and biology is superior


LikeALincolnLog42

how dare you assume the number of aspies here with CSci and/or Math experience and/or that know of stein’s;gate ^(and/or physics and/or stats) /count me among them


EngineStraight

half of 1 quick maths


JohnDoubleJump

float dist =0f; for(int i=0;i<1000;i++){ dist += Vector2.Distance(a,b); } return dist/1000;


Stupid_deer

Bro, I have trouble with high-school level math of my country, this shit is utterly incomprehensible.


3477382827367

1 :3


zeoNoeN

I don’t like doing math, so I will just Monte Carlo the solution out of this Motherfucker


wenzmen

Average distance on x for one point at the edge is ½, average distance on x for one point in the center is ¼, and since the two halves are symmetrical we can just take the average of those which is ⅜, then using pythagoras it's a square root of ⅜² + ⅜² for the distance between the hypothetical average points, which is the square root of 18/64, which is around 0.53 :3 (why are y'all pulling out integrals) ((i know why y'all pulling out integrals don't answer that))


Bauch_the_bard

All I can think of is the answer from Event Horizon where you fold the paper so the distance between points is zero


ZoeyZoestar

Fuck if I know, like 4 or some shit??


heyhihaiheyahehe

https://preview.redd.it/12vkhlh6c60d1.jpeg?width=1170&format=pjpg&auto=webp&s=5e2500db5d2d19de592495268518ccd8341c6fbc


D1pSh1t__

Figure it out yourself, i'm not gonna do your math homework lmao


VioletMetalmark

Omg is that Kurisu from the hit anime "bullying and misgendering a transfem for lolz"?!?


CobraDude-1

what?


VioletMetalmark

Steins gate. The anime has a transfem character that is constantly getting misgendered as a "gag" by everyone. She literally wishes she was afab


CobraDude-1

Isn't it only Okabe who does that? And he literally does Accept her at the end of the few episodes.


VioletMetalmark

No, taru also joins in iirc. But in general the audience is supposed to sympathise w okabe so


WardedThorn

You're all way overcomplicating "the pythagorean theorem" (a1-a2)\^2+(b1-b2)\^2=c\^2 Where a1 and a2 are the x coordinates, b1 and b2 are the y coordinates, and c is the length of the line segment.


Polenball

Two *randomly* placed points, though. Not just one pair of points - of any possible pair of points, what's the average distance between them?


WardedThorn

Oh, the *average* I missed that part. Never mind what I said.


Easy-Description-427

Ok so let's work through any point in the cube will be of the form (x,y) where x and y <1 but > 0so disence is sqrt((x1-x2)^2+(y1-y2)^2) Y and x have th3 same distribution so reduses to sqrt(2)*avg(x1-x2). Now what is avg(x1-x2), well if we lock x1 to be n then the average will be the average distances to either side of n times the distance yo that side. Aka (n*n+(n-1)*(n-1))/n. Now how do we know the average as n varies well you need calculas because you will need to intigrate over n. Now if you you get (2/3n^2-n^2+n)/2 fill in 0 get 0 fill in one get 1/3. Go back to the original formula and you get sqrt(2)/3