Let the distance AB be D, making the total distance AC equal to 2D. The swimmer takes 4 hours to travel the 2D distance from A to C, so his downstream speed is 2D / 4 equals D / 2. The total time to travel from A to B and back to A is 10 hours, meaning the sum of the downstream time and upstream time is D / (D / 2) + D / u_up equals 2 + D / u_up equals 10, so his upstream speed is D / 8. The downstream speed equals the swimmer's speed plus the stream speed, and the upstream speed equals the swimmer's speed minus the stream speed, so adding them gives 2 times the swimmer's speed equals (D / 2 + D / 8) equals 5D / 8, making the swimmer's speed 5D / 16. Subtracting the upstream speed from the swimmer's speed gives the stream speed as 5D / 16 minus 2D / 16 equals 3D / 16, making the ratio of their speeds 5 to 3.