We can rewrite "the resistace R of a wire is directly proportional to its length" as R=αL where R is the resistance, α the proportionality factor, and L the length of the wire.
Since " R=40mohms for a wire 10 cm long", we can write the direct proportionality in Math form as (40mΩ/10cm). This means that we don't have to worry about α.
a) when the length decreases to 6cm, we can setup the following equation
Now, solving for x through cross multiplication, we get x=24mΩ
b) when the length decreases by 25%
Since the original length was 10cm, a 25% decrease means that the length was shortened by 2.5cm. So, the final length is now 7.5cm. Setting up a proportionality form as before, we get:
Solving for y through cross multiplication, we get y=30mΩ
Hope this helps!