Comparing baskets of goods in this exercise
So we are told that bundle A (3,7) is optimal at prices p=(4,4) with wealth w=40

Consider bundle B (5,3) at prices (4,1.5) with wealth 24.5

By Weak Axiom of Revealed Preference (WARP), we know that if both bundles are affordable under both sets of prices and wealth, and we chose A when B was available, then A is revealed preferred to B.

Both A and B are affordable under those price wealth pairs, so B cannot be optimal. 

What you did graphically is equivalent to the math.