To compare the cost of the memberships for one year, we need to convert the given durations to 12 months.
For Gym A: $50 for 5 months, so $50 * (12 months / 5 months) = $120 per year.
For Gym B: $40 for 3 months, so $40 * (12 months / 3 months) = $160 per year.
Let's represent the cost of the membership for Gym A as y = kx, where y is the total cost and x is the number of months. For Gym A, we have y = kA, where A represents the number of months.
Similarly, for Gym B, we have y = kB, where B represents the number of months.
From the given information, we know that kA = 120 and kB = 160.
To find the value of k for the cheaper membership, we need to compare the values of kA and kB.
120 is less than 160, so kA is the smaller value. Therefore, the value of k for the cheaper membership is 120.