Number of intersection points when two string are wrapped around a Cylinder. We have a cylinder and two strings, one red and one blue. We pick a random point P on the bottom circumference of the cylinder and then start wrapping both the strings around the cylinder starting from point P so that it forms a uniform helix.
Case 1: Wrap red string in the clockwise direction and blue string in the anti-clockwise direction.
Case 2: Wrap both red and blue strings in the clockwise direction.
Now, we make X full rotations with red string and Y full rotation with blue string, where X and Y are co-prime numbers. After that, they will end up at the same point Q on the upper circumference of the cylinder, which will be directly above the initially chosen point P.
Our goal is to find the number of points where these two strings intersect excluding the first and last point for each case.
For e.g., if x is 3 and y is 5 then both the strings intersect at 7 points in Case 1 and they intersect at 1 point in Case 2.
See attached image for reference.
 A: You could think of the strings on the cylinder as a kind of graph of what happens when runners run around a circular track. Each vertical line on the cylinder's surface corresponds to a location on the track, and the distance from the bottom of the cylinder represents time elapsed since the runners started running.
The path of a string then represents the position of a runner at each time from the start to the end of the time period.
Then the problem turns out to be equivalent to asking how many times the runners meet as they go around the track.
This is a relatively well-studied kind of question.

For a somewhat more direct approach, let's suppose each string is replace by a line painted on the surface of the cylinder.
I suggest a painted line because I want to deform the cylinder and have the line "stick with" the surface of the cylinder rather than be concerned about a string hanging loose or breaking as its ends get closer or farther from each other.
Now let's suppose the cylinder is made of rubber or some other material that we can deform in a uniform way.
And for reference, let's paint a black line straight up the side of the cylinder, parallel to the axis, from a point at the bottom to a point at the top.
After painting the red line and the blue line, we twist the top of the cylinder while holding the bottom fixed, and the material of the cylinder between the bottom and the top twists gradually from bottom to top so that the black line is stretched into a helical shape around the twisted cylinder.
Let's suppose we twist in a direction opposite the way the red line is wrapped around the cylinder, and we keep twisting until the red line is straight.
So we twist the top through $X$ full rotations in a direction opposite to the original direction of the red line.
If the blue line was originally going around the cylinder in the same direction as the red line, this process removes $X$ full rotations from the path of the blue line,
which now makes $\lvert Y-X \rvert$ full rotations.
(We use the absolute value because in the end it will not matter which way the rotation goes.)
If the blue line was originally going around the cylinder in the opposite direction,
this process adds $X$ full rotations, so the blue line now makes $Y+X$ full rotations.
In the case where $X=Y$ and the lines are wrapped around the cylinder in the same direction, the two lines are the same as each other (and were the same as each other before twisting the cylinder) and there are infinitely many intersections.
In any other case, the red line is now straight up, the blue line is a helix wrapping around the cylinder one or more times, and each rotation of the blue line represents one intersection. In addition to the starting point (where the two lines meet), there is one more intersection for each rotation, including the intersection at the end point.
So if we count all intersections of the two lines (including at the top and bottom of the cylinder) we have either $\lvert Y-X \rvert + 1$ or $Y+X+1$ intersections,
depending on whether the lines originally went in the same direction or opposite.
If we exclude the intersections at the top and bottom,
we have $\lvert Y-X \rvert - 1$ or $Y+X-1$ intersections.
