12:03 AM
͟Ͼ ͟ᕍ ͟Ͼ

Mini-math puzzle: given two gravitational bodies of masses m1 and m2, separated by r units, what's the "halfway" point where the gravitational force is 0?

`(m1+m2)/(2r)`?
:3

`0`?
:4P
Can you un-onebox something

`space onebox`

I just realized that I beat Pyth again. Ignore the answer that uses the bonus.

12:12 AM
@CᴏɴᴏʀO'Bʀɪᴇɴ It's actually independent of r.

@El'endiaStarman `(m1+m2)/2`?

nope
Actually do the math.

I don't know physics

Isn't it the product of the masses divided by the radius squared times some constant? I think I remember seeing that on a science bowl question before

`d(m1,m2)/2`?

12:15 AM
@CᴏɴᴏʀO'Bʀɪᴇɴ Gravitational force is F = G*m1*m2/r^2. G is a constant and can be ignored here. The mass of whatever object at the midway point doesn't matter.
@Ampora That's the gravitational formula, yes.

Yay Science Bowl

I've known it since I started programming. I remember a couple of my first programs were related to gravity and charge attraction/repulsion.

-2

(Not sure why this was downvoted and flagged, as this comes DIRECTLY FROM A PROGRAMMING CONTEST.) found a cool problem on an algorithmic site and I describe it here. https://www.reddit.com/r/programmingchallenges/comments/3z3g23/problem_with_cars_and_queries_details_within_too/ If anyone has a...

Physics ;-;

12:18 AM
It's simple!
You have to do a little algebra and that's it!

The only real science is hard integrals

haha

@El'endiaStarman are we assuming its on a line?

The midway point is colinear with the gravitational bodies, yes.

I know it's scratch (I did it when I was 10) but it's relevant ish

12:26 AM
nice

@El'endiaStarman I got it to be dependent on r

I have my answer as a ratio of r.

`sqrt(m1*m2)r/(sqrt(m1*m2)r+1)`

interesting
We should try an example.
Mass 4 at x=0, mass 1 at x=4.

I said the position is x
and mass1 at 0, m2 at r
and got m1/x^2=m2/(r-x)^2

12:28 AM
uh-huh
r-2?

r-x
oops

To all vote-to-close people: it appears that the crux of the problem with my Egg drop challenge is that my challenge doesn't have an upper limit, and therefore every entry must target the given input

@FlagAsSpam

that gave `sqrt(m1)/sqrt(m2)=rx-x^2`
x^2-rx+sqrt(m1/m2)=0

I get `sqrt(m1)/sqrt(m2) = x/(r-x)` going that route.

12:32 AM
you're right
I'm stupid

Did I ever tell you about the time I had 2^3 = 4 in an intermediate step on a calculus test?

sqrt(m2)/sqrt(m1) = r/x-1

not me
story time with @El'endiaStarman!

`x=r*sqrt(m1)/sqrt(m2)+1`
is that right?

Funny thing is, two other students (out of five) also got that problem wrong, and also for simple algebra/calculation errors, and yet all three mistakes were different!

12:35 AM
whoa

@NathanMerrill It's actually not because it doesn't have an upper limit, it's because it doesn't have a finite mean.

@Maltysen Not quite.
I get `r/(sqrt(m2)/sqrt(m1) + 1)`.

fine, i'll get a piece of paper

haha
I've got a little whiteboard in my lap. :D

x=r/(sqrt(m2/m1)+1)
yay I got it
that was fun

12:40 AM
I'll post a regex that matches my answer: `.*`

I actually just did a bit more algebra and proved that your answer and my answer are equivalent. :D

yeah, I just combined the sqrt's right?

Well, yours was in terms of position, mine was in terms of ratio.
But I rationalized the numerator and got the same answer! :D

oh, what was yours?

@PhiNotPi well, not having an upper limit means that there isn't a finite mean.
but yeah

12:42 AM
`(1-sqrt(q))/(1-q)` where `q = m2/m1`.

cool
do you have any other one's?

Multiply by `(1+sqrt(q))/(1+sqrt(q))` and you get your answer, basically.
Other solutions?

problems

oh, lol
um

@NathanMerrill It could follow a geometric distribution and have finite mean: en.wikipedia.org/wiki/Geometric_distribution

12:44 AM
1,2,3,4,5,6...to infinity is geometric right?

hellooo

The key being that lower numbers are more frequent than higher numbers.

@NathanMerrill I'm guessing you didn't click the link PhiNotPi provided.

I did

@El'endiaStarman that's nothing i once did 35+15=45

12:45 AM
they provide the classic examples

1,2,3,4,5,6... is arithmetic
1,2,4,8,16,32,... is geometric

Different kind of geometric.

Neither of those are really related to what I am talking about, a probability distribution.

his is 1, .5, .25, .125

That's still geometric'

12:46 AM
but isn't 1,2,3,4,5 geometric?
maybe I'm thinking backwards

@Maltysen: Here's another one: figure out what it means to feel the same amount of gravitational influence from two bodies...in 2D space.

Whoops

Actually, wait, that's not hard.

1, .5, .25, .125... is geomtric: first term 1 and common ration .5

So really, this is the problem: calculate all 2D positions where the gravitational force from both bodies is the same.

12:47 AM
1,2,3,4,5 has no common ratio

@BlockCoder1392 That's a geometric sequence, PhiNotPi is talking about a geometric probability distribution.

> For example, suppose an ordinary die is thrown repeatedly until the first time a "1" appears. The probability distribution of the number of times it is thrown is supported on the infinite set { 1, 2, 3, ... } and is a geometric distribution with p = 1/6.
that describes it pretty well

> only discrete memoryless random distribution
Wat.
From Wolfram MathWorld

@El'endiaStarman so I have to find the stationary points?
wait no that would be points where they are opposite

@Maltysen They're not stationary.

12:51 AM
@El'endiaStarman Figure out what gravity means in -2D space: en.wikipedia.org/wiki/Negative-dimensional_space

Wat.

@El'endiaStarman am I solving for when the magnitude is equal, or the actual vectors are equal

@PhiNotPi negative two d?

@Maltysen Magnitude of the force vectors.

@CᴏɴᴏʀO'Bʀɪᴇɴ :)

12:52 AM
@PhiNotPi Holey stuff. Should be right up my alley! :P

@El'endiaStarman `m1/m2 = (x-x1)^2+(y-y1)^2 / (x-x2)^2+(y-y2)^2`
I have to solve for y now

[erases whiteboard] :P

but that means that the distance from one point^2/over the other is constant
the ratios of the distances is equal to the square root of the ratios of the mass
am I right?

Not sure yet.
@Maltysen I don't think that's right. Consider the equilibrium point we found earlier and its corresponding point on the opposite side of the smaller mass.
Well, maybe it is.

the two points aren't on the circle

1:04 AM
If we talk in ratios of distance, however...
`1/(1+sqrt(q))` is what I found earlier, and its antipode is `1/(1-sqrt(q))`. These are not equal to `q`, `sqrt(q)`, `1/q`, or `1/sqrt(q)`.

wait what is that
there is only one point?

what is `1/(1+sqrt(q))` referring to

There's only one equilibrium point, yes, but there's another point that's colinear with the gravitational bodies where the forces are equal, but in the same direction.

awwww man... I was really hoping to get to +100/-0 with a zero-byte answer, and then someone downvoted me from 99 down to 98 o.O

1:07 AM
ah I see

Someone add "Great minds waste time alike" to Many Memes of ppcg
Hi @quartata

@El'endiaStarman I wonder where the stationary points are in 2D space

### blank message

Dec 1 '15 at 21:52, 34 minutes total – 223 messages, 14 users, 17 stars

Bookmarked Dec 2 '15 at 1:21 by BlockCoder1392

wait no, there's only one

What how did I post 21% there

1:11 AM

@Maltysen If you actually consider the gravitational bodies to be moving, and if the second is significantly smaller than the first, then those would be the Lagrangian points.

@BlockCoder1392 not that difficult to make a blank message

Well, I guess the gravitational bodies could be the same size, actually.

Yes I know
Without Copy/paste?

oh that's how you do it
@El'endiaStarman how does L2 work?
oh relative to both bodies

1:15 AM
Same way geostationary satellites maintain the same position with respect to the Earth's rotation.

is L2 the -(1-sqrt(q))/(1-q)

Maybe. I'm not sure.
My formula ignores velocity entirely.
Actually, they need not be the same.

L1 is, right?

It's not necessarily the place where the gravitational force is equal from both the Earth and the Sun. Only the place where the combined force and sideways velocity correspond.

I see
so centripetal motion is R(sin(wt)i + cos(wt)j)
we have to solve for the R where the w of the earth = the w of the object

1:19 AM
What do each of those terms mean? R = radius, sin and cos I know, t is time, i and j are - I assume - the basis vectors (+x and +y, respectively), and w is period?

its omega = rot/time

ah-huh, okay
Do you know derivatives?

yeah
I did basic multivar

Sweet.

@Doorknob冰 How many characters have been submitetd?]

1:20 AM
that's where I remember the derivation for centripetal

So we can differentiate with respect to....time? Twice, to get acceleration.
ahh, cool

yeah and that's proportional to force

yeah

if you defrentiate once, you get v
a cool thing is v dot r = 0

yeah
They're orthogonal.
a x r = 0 also.
(Where x means cross product.)

1:21 AM
yup
and a = Gm1m2/|r|^2 u = Gm1m2/|r|^3 r

Okay, so...`X = R(sin(wt)i + cos(wt)j)`, `V = X' = R(w*cos(wt)i + w*-sin(wt)j)`, `A = V' = X'' = R(w^2*-sin(wt)i + w^2*-cos(wt)j)`.

yeah
but notice A in terms of X
A = -Rw^2 X
and what is |v|

yeah

Rw

@El'endiaStarman Not only is it not necessary, I'd say it's impossible for that to be the case.

1:24 AM
yep

so |A| = |v|^2X / R

@PhiNotPi You're probably right.

Are you just working out the equations of gravity on celestial bodies in chat?
Nerds.

I, happily, am one too, but prefer the label `geeks`.

1:26 AM
I'm gonna use what we figure out for this.

@El'endiaStarman Agreed.
Fixed now. :P

w = sqrt(A/-RX)
so sqrt(A/RX) for both equal each other

@Maltysen I think you lost me here.

1:28 AM
for the earth and the satellite

A = -Rw^2 X, so |A| = R^2 w^4 X^2, right?
|V| = R w, so |V|^2 = R^2 w^2?

Come play minecraft. The server is woefully lonely

@Calvin'sHobbies Okay!
be right there

@Calvin'sHobbies Sure! After the math. :P

you don't need to use the || formula

1:30 AM
okay

I got `w = sqrt(A/-RX)` from `A = -Rw^2 X`

@Maltysen What's the `u`?

oh r/|r|

@PhiNotPi To me, nerds simply memorise useless information, whereas geeks can offer practical help in useless situations.

ahhh, okay

1:31 AM
@trichoplax Yes, I like being somewhat practical. :P

What do you prefer?

@El'endiaStarman I didn't do the math after `A = -Rw^2 X` before, so check if I'm making mistakes

(hint: geeks are better)

golf.shinh.org is being weird

1:31 AM
`w=sqrt(A/-RX)` is correct, right?

"test.js: alert is not defined" wat
same with console
.log

@RikerW I don't think I'm practical enough to be labelled a geek, but maybe one day...

@Maltysen Why can we take out the minus sign?

oops

@trichoplax Good for you. You admit it, whereas I am in denial. :P

1:33 AM
Okay, yes, I think that's correct.

@RikerW I must admit, I don't always correct people when they call me a geek - sometimes I accept the false praise quietly...

And `A = G m1 m2 / R^2` also.

Me too. :D

yeah

So we substitute that in...

1:34 AM
so w_earth is `Gm_sun m_earth / R^2 / -Rr`

`w = sqrt(G m1 m2 / ( (-R^3) X ))`

that makes it `
w = sqrt(G m1 m2 / ( (-R^4) ))`

We can assume wlog (without loss of generality) that the whole system is on the x-axis.
Yep.
Now, why the heck can we sqrt a negative number?!
OH.

no actually F=-Gm1m2/r^2 u

Acceleration is negative!
So it's just `w = sqrt(G m1 m2 / R^4)`!

1:36 AM
@trichoplax I always considered it the other way around
But eh

so what is now the `w_object` in terms of some distance `x` from the sun

@quartata Mine definitely isn't an official definition...

I don't think there should be an official definition :P

`sqrt(A/-xX_ob)`

@Maltysen Calculate `w_earth`, then calculate the barycenter of Sun and Earth and base the calculation of `w_satellite` off of that.

1:38 AM
what is a barycenter?

The equilibrium point, in fact.
It happens to be inside the Sun in this case.

oh
we can assume sun is stationary right
no need for barycenter

And I think the Sun is so much more massive than the Earth that we can basically neglect the effect of the Earth.

so then barycenter = center of sun?

Well, but then the point that the object orbits around moves.
Which is true...from a certain point of view. ;)

1:39 AM
if the sun wasn't stationary then it would be a lot harder

Well, what are their relative masses?
Okay, the Sun is about 333,000 Earth masses. Welp.

uh yeah, let's go on with `sqrt(A/-xX_ob)`
but A is based on the sum of both earth and sun
were we saying `m2` is the earth?

Yeah, I think m2 should be the Earth.
What's the difference between `x` and `X_ob`?

=|X|
the point we're solving for

okay

1:44 AM
if so, its A = `m2/(R-x)^2 - m1/x^2`
did I get that right?
but wait, we were saying that the earth's attraction was negligible right

I'm thinking that maybe it's not quite as negligible as we would like.

0

Golfscript and J are long-known, well-discussed, and accepted: fine, so if you want to understand the top submission to every challenge, you'll need to learn these two. Then CJam and Pyth turned up. Oh well. But it doesn't end there: we now see Jolf and Matl and Vitsy and whatnot. Nobody can be ...

eh dupe
we've gone through this enough times already
I'm sick of seeing the same damn meta discussion every month
I'm actually secretly hoping that someone designs a golfing language so good that the usage of the other golfing languages dies down and people would stop complaining about all the answers being in different golfing langs
(I'm also hoping that language is pl)

so this time, I have the 2017 problem typed up already
so I won't be left dry next year
can't reveal it for another 364 days, though :P

well assuming it is, w = `sqrt(Gm1 ms /x^4)`

1:54 AM
Seriously? lol

@CᴏɴᴏʀO'Bʀɪᴇɴ is there a jolf variable pre-initialized to 0

G m1 ms / x^4 = G m1 m2 / X^4
ms/x^4 = m2/X^4
I probably messed up. That simplified too well
@El'endiaStarman oh you're right

or 16

we tried to solve to solve for the trojan points assuming that the earth mass was negligible