Ray AB is the same as Ray BA

That is not true. Rays are directed. Ray AB starts at A, and goes through B.

Line segement AB is the same as line segment BA.

That is correct! Line segments AB and BA are indeed the same because they have the same endpoints, A and B. In geometry, a line segment is a portion of a line that connects two points. Unlike rays, line segments have a fixed length and do not have a specific direction. Hence, they can be written in either order (AB or BA) and still represent the same segment.

To determine if two line segments or rays are the same, you can simply compare their endpoints. If the endpoints are identical, then the segments or rays are the same.