Probably before 3083 B.C., before the Yellow King reigned in 2697 B.C., there was a wise person named Fu Xi who saw a wild horse with a weird diagram on its back that jumped out from the River. The diagram implied 5 and 10 in the center, 3 and 8 on the left, 4 and 9 on the right; 2 and 7 on the top, and 1 and 6 on the bottom.
The wild horse was called Dragon Horse. The diagram on the horse back was called River Diagram.

The legendary Fu Xi found the numbers in the diagram have the connection with the
stars in the evening. Every year,

Because the Four directions have a relationship with the Five Elements, Chinese named Venus, Mercury, Jupiter, Mar and Saturn as Metal, Water, Wood, Fire and Earth stars.


1, 3, 5, 7 and 9 are Yang (odd) numbers. 2, 4, 6 ,8 and 10 are called Yin (even) numbers. 5 is the center number.
1, 2, 3 and 4 are in the inner circle. 6, 7, 8 and 9 are
the outer numbers.
The inner numbers plus the center number 5 are equal to the outer numbers. Therefore 1, 2, 3 and 4 are called Heavenly Original Numbers; 6, 7, 8 and 9 are called Earthly Developed Numbers. 
The sum from 1 to 10 is 55, which is called Heavenly Number. 5 is the center number of 1, 3, 5, 7 and 9 yang numbers. Also, 5 connects with many arithmetic calculations, 5 becomes the secret index of Heaven from hint of the River Diagram. That's why the day system in the Chinese calendar used a cycle of 5 before.
After applying the Five Elements on the River Diagram, we
find the Five Elements Producing Relationship shows in
clockwise direction.
That's why the number relationships are applied on the Chinese Five Elements astrology by Five Element scholars later. 
I Ching Pa Kua (Eight Trigrams)
The River Diagram derived the PreHeaven Pa Kua.
Fu Xi thought that is one, stands for
sky; is two, stands for
earth.
One pluses two is three,
which can be the symbol of sky and earth.
We call this symbol Trigram. is three Yang, stands for Heaven on the top of sky. is three Yin, six bars, stands for earth on the ground bottom. 
6 stands for most Yin. Also, 6 is the center number of 2, 4, 6, 8 and 10 yin numbers. Therefore 6 becomes an index of Earth.

Base on the knowledge of astronomy and the River Diagram, Fu Xi created a diagram of Eight Trigrams, which is called the PreHeaven Pa Kua. 
Old Yang and Old Yin
The Yang and Yin combination makes Four phenomenon. The strongest Yang is 9, Old Yang. The weakest Yin is 6, Old Yin.
Four Phenomenon  Index Number  Completion Number  Make to 10  Yin/Yang Name 
1  9  Old Yang  
2  8  Young Yin  
3  7  Young Yang  
4  6  Old Yin 
Lo Shu, Turtleback Diagram and PostHeaven Pa Kua
The Origin of Chinese Yin Yang Symbol
River Horse Diagram, PreHeavenly PaKua