<p>I thought it was a fun question, I gave it some thought.  Layman's version, so corrections are welcome.</p>

<p>The <a href="https://en.wikipedia.org/wiki/Chronology_of_the_universe" rel="nofollow noreferrer">very early universe</a>, the first few seconds or so, it was quite dense.  This is fairly well publicized and the specifics and details don't really matter for this question, but the energy and stuff in the early universe that later formed the Milky-way and the energy and stuff that formed Andromeda were cosmic neighbors and in the first seconds of the universe, quite close to each other.  The basic Hubble rule is that things that are close (in cosmological terms) were always close, like the dots on a balloon that gets blown up.  Everything moves away from everything else, but things that were next to each other were always next to each other.  On smaller scales, like stars within galaxies or planets, this isn't true because of gravitational assists and different orbital paths, but its true for galaxies.   (there might be some small variation on this with "orbiting" dwarf galaxies, but it's still by and large, true).</p>

<p>Another important point to make about the early universe is that it was much more uniform, so, because of the uniformity, gravity was pulling nearly equally in all directions.   The nearby somewhat more massive clouds of matter and energy didn't dominate gravitationally because there was similar mass in all directions.    You might think that a denser universe means stronger gravity in the direction of nearby matter, but that doesn't happen if the matter is spread evenly enough in all directions.   </p>

<p>So, generally speaking, in the very young universe, the stuff that became the Milky way and the stuff that became Andromeda started out much closer, but they didn't pull each other much early on because of uniformity.</p>

<p>Over time, local gravity overcame uniformity.  I couldn't tell you when that happened (maybe someone here can), but it took some time before the makings of galactic groups and clusters began to form.   We know from the background radiation map that the Universe was still quite uniform as late as 380,000 years after the big bang.   See picture: </p>

<p><a href="https://i.sstatic.net/3IQX4.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3IQX4.jpg" alt="http://abyss.uoregon.edu/~js/images/Full_m.jpg"></a></p>

<p>(Edit due to correction).  And at 380,000 years, the known Universe is thought to be about 1/1100th it's current radius.   We know from the cosmic background radiation that at that time, the Universe was still largely uniform, though non-uniformity did lead to the formation of galaxies, clusters and super-clusters, so it was important, but it still took some time for local groups and galactic clusters to form.   </p>

<p>See <a href="http://wmap.gsfc.nasa.gov/universe/bb_cosmo_fluct.html" rel="nofollow noreferrer">here</a>.</p>

<blockquote>
  <p>On this map, the hot regions, shown in red, are 0.0002 Kelvin hotter
  than the cold regions, shown in blue.</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>These cosmic microwave temperature fluctuations are believed to trace
  fluctuations in the density of matter in the early universe, as they
  were imprinted shortly after the Big Bang. This being the case, they
  reveal a great deal about the early universe and the origin of
  galaxies and large scale structure in the universe.</p>
</blockquote>

<p>But once local gravity overtook uniformity, then galaxies can start drawing each other together more efficiently.   The spiderweb pattern of galaxies shows that there is a tendency for this to happen, as galaxies draw other galaxies towards them, even as space expands, so you get lines of more dense regions with more galaxies and pockets of empty space, mostly free of galaxies.</p>

<p><a href="https://i.sstatic.net/lFnDf.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lFnDf.jpg" alt="enter image description here"></a></p>

<p><a href="https://physics.stackexchange.com/questions/198138/is-most-of-the-matter-in-the-observable-universe-within-galaxies">Source of picture for further reading</a>.</p>

<p>So, what basically happened with Andromeda and the Milky-way is that expansion combination with uniformity set them fairly far apart even as they were still forming, but they were still next door neighbors as far as galaxies go.</p>

<p>Both the Milky-way and Andromeda have absorbed smaller, closer dwarf galaxies, perhaps many times, so they weren't the closest 2, but they were the closest 2 non dwarf galaxies (at least, that we know of).</p>

<p>You might think that galaxies could orbit other galaxies, but the nature of Hubble expansion doesn't give galaxies much tangential velocity towards other nearby galaxies, so basically, 2 galaxies are either moving towards each other due to mutual gravity or away from each other due to expanding space.   Now in a 3 or more galaxy system with similar masses, they can get some tangential velocity, but generally speaking, the direction between any 2 large galaxies is mostly either towards or away, not an orbit.  </p>

<p>Another thing to keep in mind, once the uniformity effect is overtaken by local gravitation of local groups or clusters, is that massive objects at these distances don't exactly pull each other quickly.   It takes a long time for gradual acceleration to turn into relevant velocity.</p>

<p>At our current distance from Andromeda (about 2.5 million light years), and it's current mass (about 1.5 trillion solar masses), it's G force on us, using the formula below (Math can be added if needed):</p>

<p><a href="https://i.sstatic.net/RUpD3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RUpD3.png" alt="http://study.com/cimages/multimages/16/gravityequation.png"></a></p>

<p>comes to about 1/2.8 trillionths of a meter per second squared.  That's less than 1/20,000th the gravitational pull Pluto has on Earth.   A pull that small is going to accelerate things towards each other extremely slowly, so (I think) for the first billion or few billion years, the expansion of space between the Milky way and Andromeda likely exceeded any gravitationally caused velocity between them.</p>

<p>The good news is, Andromeda and the Milky-way have had a long time to pull on each other.  About 13 billion years or so.   1/2.8 trillion m/s^2 over a billion years is works out to about 11 km/s.  Over 13 billion years, 143 km/s.   And, the actual velocity that the Milky-way is moving towards Andromeda isn't too far away from that, about 110 km/s.  That right there gives us a ballpark Netwonian estimate for how far apart they were when they started.   (Now, footnote, for objects of somewhat similar mass, you have to take the mass of both of them, not just the larger one, so it's closer to 15 or 16 km/s per billion years), but that doesn't change the overall numbers too much.</p>

<p>Dark Energy expansion (which currently, between the Milky-way and Andromeda is about 60 km/s), and that makes the calculations a bit more tricky, especially since dark energy expansion might not have been constant throughout the last 13 billion years.  Related article <a href="http://www.universetoday.com/118367/why-is-andromeda-coming-towards-us/" rel="nofollow noreferrer">here</a>.</p>

<p>At the current rate they are moving together, about 110 km/s or, 250,000 mph or 1/2,680 c, In one billion years at current velocity Andromeda will be 375,000 light years closer (and, in reality, a bit more as it will continue to accelerate by mutual gravity and dark energy expansion will be reduced as they get closer).</p>

<p>And if we work backwards, a billion years ago it was a bit less than 375,000 light-years further away than it's current 2.5 million light year distance, with diminishing distances further away over previous billion year intervals.   The farther back you go, and difficulties with knowing how close they were when local gravity became a key factor over uniformity makes estimates pretty difficult, but they were probably never too much further apart than they are now.  Perhaps double, as a very rough guess.   Because gravitational acceleration drops off at the square of the distance, I find it hard to believe that Andromeda was ever much more than twice as far as it is now.</p>

<p>I would imagine, based on my assumptions above, that by the time the galaxies were recognizable as galaxies, say, when the universe was a billion or 2 billion years old (give or take), Andromeda and the Milky way were probably moving away from each other initially, but over time, the gravitational attraction was able to overcome overcome the expansion of space.  </p>

CC BY-SA 3.0
2016-09-07T12:12:44.510Z
Nice answer, but note that the CMB was emitted at $z=1100$, i.e. when the Universe was $a = 1/(1+z)\simeq1/1100$th its current size, not 1/10th. And that's the linear relation; in terms of volume it was $1/(1+z)^3 \simeq$ a billionth its current size.
pela
CC BY-SA 3.0
2016-09-07T12:16:06.083Z
@pela  Thanks for that.   That's a pretty big error.  It also changes the assumption I made on expansion to uniformity.   Fixing that part might be over my skillset.
userLTK
CC BY-SA 3.0
2016-09-07T10:08:23.593Z
2016-09-07T12:23:14.263Z
2017-04-13T12:40:15.377Z
userLTK
<p>Most people underlined the role played by the expansion of the universe, however, this expansion is not actually 'pushing' Andromeda away, it is only changing the frequency of the light emitted by Andromeda, so that we can associate a speed that would give the same Doppler effect (when an object is emitting a wave, like a fire truck, and going away, the received wave is at a lower frequency than the emitted one).</p>

<p>The more correct answer would be that the two galaxies are the result of a long accretion (of gas) and merging history (with another now disappeared smaller galaxy). Each of this event changed the speed of Andromeda and the Milky Way relative to a rest frame, so that the speed nowadays is the result of these numerous interactions, the gravitational pull of one on each other as well as the gravitational potential created by the local group (the group of galaxies in which belongs the Milky Way and Andromeda, containing for example the Great Magellanic Cloud). </p>

<p>If you want an illustration of what the formation of a galaxy look like, you can take a look at a simulation, like the Horizon-AGN simulation. There is a video (here: <a href="http://www.horizon-simulation.org/movies/horizon-AGN_denseproj.avi" rel="nofollow">http://www.horizon-simulation.org/movies/horizon-AGN_denseproj.avi</a>) in which you can see galaxies forming within a cosmological framework. In the movie, each bright dot is a forming galaxy. You can see many very complicated interactions, so that two galaxies close to each other today may have formed very far away and were brought close by.</p>

<p>In the case of our two galaxies, because we are located in a group of galaxies you can expect that the initial locations of our two galaxies were actually very different compared to nowadays. The reason for that is that in the past, as very correctly explained by userLTK, distances were smaller so that the gravitational pull of objects was (in average on the local group) stronger than today. Therefore, the interaction of the matter that is now forming the group of galaxy in which lay the MW and Andromeda had  gravitational interactions somehow stronger so that the relative speed was higher. Because of that, our two galaxies have been traveling for 14 Gyr from some remote location to their current location, where they happen to be going one toward each other.</p>

CC BY-SA 3.0
2016-09-08T08:53:05.060Z
2016-09-08T08:53:05.060Z
cphyc
<p>The short answer is:</p>

<pre><code>Inflation
</code></pre>

<p>The two galaxies formed a great distance apart from one another, almost a billion years after the big bang. They are as close today as they have ever been.</p>

<p><a href="https://i.sstatic.net/VwRBt.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VwRBt.jpg" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-09-07T04:50:30.647Z
While that's basically correct, I think this answer should be fleshed out a bit.  "A great distance" is quite relative.  For large galaxies, they've probably always been neighbors.
userLTK
CC BY-SA 3.0
2016-09-07T05:05:04.733Z
That is just semantics then, because there is no way to quantifiably state a number that would mean anything regarding the distance between M31 and our galaxy at the time of their formation. Therefore "a great distance" is exactly correct, it is referred to as a theoretical definition, and means exactly what it states. (a distance not so far as to be unreasonably far, yet not close enough that it could ever be considered close)
LaserYeti
CC BY-SA 3.0
2016-09-07T04:47:09.970Z
2016-09-07T04:47:09.970Z
LaserYeti
<p>How did the Milky Way and Andromeda Galaxy separate before they began their collision course?</p>

<p>I understand that gravity is pulling together the two galaxies, but what separated them in the first place while gravity is pulling them together?</p>

<p>Thank you for your consideration.</p>

CC BY-SA 3.0
2016-09-08T03:41:18.000Z
A very good answer has been provided by @userLTK. However, I just want to make a point that while matter that is present in the two galaxies has been very close to each other before, I reckon the galaxies would have started out separately, and so the galaxies themselves weren't separated from each other at any point in time, as such.
nataliaeire
<gravity><galaxy><cosmology><milky-way>
How did the Milky Way and Andromeda Galaxy separate before they began their collision course?
James Goetz
# How did the Milky Way and Andromeda Galaxy separate before they began their collision course?

(Asked by: username_0 on 2016-09-07)

How did the Milky Way and Andromeda Galaxy separate before they began their collision course?

I understand that gravity is pulling together the two galaxies, but what separated them in the first place while gravity is pulling them together?

Thank you for your consideration.

**Tags:** gravity, galaxy, cosmology, milky-way

> **Comments:**
> **username_1**: A very good answer has been provided by @username_2. However, I just want to make a point that while matter that is present in the two galaxies has been very close to each other before, I reckon the galaxies would have started out separately, and so the galaxies themselves weren't separated from each other at any point in time, as such.  

---

## 3 answers

### Answer by username_2 on 2016-09-07. Score: 7

I thought it was a fun question, I gave it some thought. Layman's version, so corrections are welcome.

The [very early universe](https://en.wikipedia.org/wiki/Chronology_of_the_universe), the first few seconds or so, it was quite dense. This is fairly well publicized and the specifics and details don't really matter for this question, but the energy and stuff in the early universe that later formed the Milky-way and the energy and stuff that formed Andromeda were cosmic neighbors and in the first seconds of the universe, quite close to each other. The basic Hubble rule is that things that are close (in cosmological terms) were always close, like the dots on a balloon that gets blown up. Everything moves away from everything else, but things that were next to each other were always next to each other. On smaller scales, like stars within galaxies or planets, this isn't true because of gravitational assists and different orbital paths, but its true for galaxies. (there might be some small variation on this with "orbiting" dwarf galaxies, but it's still by and large, true).

Another important point to make about the early universe is that it was much more uniform, so, because of the uniformity, gravity was pulling nearly equally in all directions. The nearby somewhat more massive clouds of matter and energy didn't dominate gravitationally because there was similar mass in all directions. You might think that a denser universe means stronger gravity in the direction of nearby matter, but that doesn't happen if the matter is spread evenly enough in all directions.

So, generally speaking, in the very young universe, the stuff that became the Milky way and the stuff that became Andromeda started out much closer, but they didn't pull each other much early on because of uniformity.

Over time, local gravity overcame uniformity. I couldn't tell you when that happened (maybe someone here can), but it took some time before the makings of galactic groups and clusters began to form. We know from the background radiation map that the Universe was still quite uniform as late as 380,000 years after the big bang. See picture:

[![http://abyss.uoregon.edu/~js/images/Full_m.jpg](https://i.sstatic.net/3IQX4.jpg)](https://i.sstatic.net/3IQX4.jpg)

(Edit due to correction). And at 380,000 years, the known Universe is thought to be about 1/1100th it's current radius. We know from the cosmic background radiation that at that time, the Universe was still largely uniform, though non-uniformity did lead to the formation of galaxies, clusters and super-clusters, so it was important, but it still took some time for local groups and galactic clusters to form.

See [here](http://wmap.gsfc.nasa.gov/universe/bb_cosmo_fluct.html).

> On this map, the hot regions, shown in red, are 0.0002 Kelvin hotter
> than the cold regions, shown in blue.

and

> These cosmic microwave temperature fluctuations are believed to trace
> fluctuations in the density of matter in the early universe, as they
> were imprinted shortly after the Big Bang. This being the case, they
> reveal a great deal about the early universe and the origin of
> galaxies and large scale structure in the universe.

But once local gravity overtook uniformity, then galaxies can start drawing each other together more efficiently. The spiderweb pattern of galaxies shows that there is a tendency for this to happen, as galaxies draw other galaxies towards them, even as space expands, so you get lines of more dense regions with more galaxies and pockets of empty space, mostly free of galaxies.

[![enter image description here](https://i.sstatic.net/lFnDf.jpg)](https://i.sstatic.net/lFnDf.jpg)

[Source of picture for further reading](https://physics.stackexchange.com/questions/198138/is-most-of-the-matter-in-the-observable-universe-within-galaxies).

So, what basically happened with Andromeda and the Milky-way is that expansion combination with uniformity set them fairly far apart even as they were still forming, but they were still next door neighbors as far as galaxies go.

Both the Milky-way and Andromeda have absorbed smaller, closer dwarf galaxies, perhaps many times, so they weren't the closest 2, but they were the closest 2 non dwarf galaxies (at least, that we know of).

You might think that galaxies could orbit other galaxies, but the nature of Hubble expansion doesn't give galaxies much tangential velocity towards other nearby galaxies, so basically, 2 galaxies are either moving towards each other due to mutual gravity or away from each other due to expanding space. Now in a 3 or more galaxy system with similar masses, they can get some tangential velocity, but generally speaking, the direction between any 2 large galaxies is mostly either towards or away, not an orbit.

Another thing to keep in mind, once the uniformity effect is overtaken by local gravitation of local groups or clusters, is that massive objects at these distances don't exactly pull each other quickly. It takes a long time for gradual acceleration to turn into relevant velocity.

At our current distance from Andromeda (about 2.5 million light years), and it's current mass (about 1.5 trillion solar masses), it's G force on us, using the formula below (Math can be added if needed):

[![http://study.com/cimages/multimages/16/gravityequation.png](https://i.sstatic.net/RUpD3.png)](https://i.sstatic.net/RUpD3.png)

comes to about 1/2.8 trillionths of a meter per second squared. That's less than 1/20,000th the gravitational pull Pluto has on Earth. A pull that small is going to accelerate things towards each other extremely slowly, so (I think) for the first billion or few billion years, the expansion of space between the Milky way and Andromeda likely exceeded any gravitationally caused velocity between them.

The good news is, Andromeda and the Milky-way have had a long time to pull on each other. About 13 billion years or so. 1/2.8 trillion m/s^2 over a billion years is works out to about 11 km/s. Over 13 billion years, 143 km/s. And, the actual velocity that the Milky-way is moving towards Andromeda isn't too far away from that, about 110 km/s. That right there gives us a ballpark Netwonian estimate for how far apart they were when they started. (Now, footnote, for objects of somewhat similar mass, you have to take the mass of both of them, not just the larger one, so it's closer to 15 or 16 km/s per billion years), but that doesn't change the overall numbers too much.

Dark Energy expansion (which currently, between the Milky-way and Andromeda is about 60 km/s), and that makes the calculations a bit more tricky, especially since dark energy expansion might not have been constant throughout the last 13 billion years. Related article [here](http://www.universetoday.com/118367/why-is-andromeda-coming-towards-us/).

At the current rate they are moving together, about 110 km/s or, 250,000 mph or 1/2,680 c, In one billion years at current velocity Andromeda will be 375,000 light years closer (and, in reality, a bit more as it will continue to accelerate by mutual gravity and dark energy expansion will be reduced as they get closer).

And if we work backwards, a billion years ago it was a bit less than 375,000 light-years further away than it's current 2.5 million light year distance, with diminishing distances further away over previous billion year intervals. The farther back you go, and difficulties with knowing how close they were when local gravity became a key factor over uniformity makes estimates pretty difficult, but they were probably never too much further apart than they are now. Perhaps double, as a very rough guess. Because gravitational acceleration drops off at the square of the distance, I find it hard to believe that Andromeda was ever much more than twice as far as it is now.

I would imagine, based on my assumptions above, that by the time the galaxies were recognizable as galaxies, say, when the universe was a billion or 2 billion years old (give or take), Andromeda and the Milky way were probably moving away from each other initially, but over time, the gravitational attraction was able to overcome overcome the expansion of space.

> **Comments:**
> **username_3**: Nice answer, but note that the CMB was emitted at $z=1100$, i.e. when the Universe was $a = 1/(1+z)\simeq1/1100$th its current size, not 1/10th. And that's the linear relation; in terms of volume it was $1/(1+z)^3 \simeq$ a billionth its current size.  
> **username_2**: @username_3  Thanks for that.   That's a pretty big error.  It also changes the assumption I made on expansion to uniformity.   Fixing that part might be over my skillset.  

---

### Answer by username_4 on 2016-09-08. Score: 0

Most people underlined the role played by the expansion of the universe, however, this expansion is not actually 'pushing' Andromeda away, it is only changing the frequency of the light emitted by Andromeda, so that we can associate a speed that would give the same Doppler effect (when an object is emitting a wave, like a fire truck, and going away, the received wave is at a lower frequency than the emitted one).

The more correct answer would be that the two galaxies are the result of a long accretion (of gas) and merging history (with another now disappeared smaller galaxy). Each of this event changed the speed of Andromeda and the Milky Way relative to a rest frame, so that the speed nowadays is the result of these numerous interactions, the gravitational pull of one on each other as well as the gravitational potential created by the local group (the group of galaxies in which belongs the Milky Way and Andromeda, containing for example the Great Magellanic Cloud).

If you want an illustration of what the formation of a galaxy look like, you can take a look at a simulation, like the Horizon-AGN simulation. There is a video (here: <http://www.horizon-simulation.org/movies/horizon-AGN_denseproj.avi>) in which you can see galaxies forming within a cosmological framework. In the movie, each bright dot is a forming galaxy. You can see many very complicated interactions, so that two galaxies close to each other today may have formed very far away and were brought close by.

In the case of our two galaxies, because we are located in a group of galaxies you can expect that the initial locations of our two galaxies were actually very different compared to nowadays. The reason for that is that in the past, as very correctly explained by username_2, distances were smaller so that the gravitational pull of objects was (in average on the local group) stronger than today. Therefore, the interaction of the matter that is now forming the group of galaxy in which lay the MW and Andromeda had gravitational interactions somehow stronger so that the relative speed was higher. Because of that, our two galaxies have been traveling for 14 Gyr from some remote location to their current location, where they happen to be going one toward each other.


---

### Answer by username_5 on 2016-09-07. Score: 0

The short answer is:

```
Inflation

```

The two galaxies formed a great distance apart from one another, almost a billion years after the big bang. They are as close today as they have ever been.

[![enter image description here](https://i.sstatic.net/VwRBt.jpg)](https://i.sstatic.net/VwRBt.jpg)

> **Comments:**
> **username_2**: While that's basically correct, I think this answer should be fleshed out a bit.  "A great distance" is quite relative.  For large galaxies, they've probably always been neighbors.  
> **username_5**: That is just semantics then, because there is no way to quantifiably state a number that would mean anything regarding the distance between M31 and our galaxy at the time of their formation. Therefore "a great distance" is exactly correct, it is referred to as a theoretical definition, and means exactly what it states. (a distance not so far as to be unreasonably far, yet not close enough that it could ever be considered close)  

---

