Math-wise, this is probably counting combinations ie asking: In a group of **12** stations, how many unique **pairings** of stations are there? ie **12** choose **2** aka C(12,2).
Formula for n choose k C(n,k) is n! / k!(n-k)!
In this case **n** is 12 and **k** is 2, so 12 choose 2 is 66.
**irrespective of the direction of travel** likely is meant to communicate that the *order* of the stations doesn't matter (ie count *combinations* not *permutations*). You only need 1 ticket to go from New York to Boston or Boston to New York rather than 1 ticket NY to Boston and 1 ticket Boston to NY.
​
IRL one way is do not show destination: 1 ticket timestamped to avoid re-use that gets punched for each step in a journey, and you charge based on that when you get off.