Total cost=Σnumber of attempts per mode times cost per attempt per mode.In matrix form it simply becomes,⎡⎢⎣40030010030025075500400150⎤⎥⎦⎡⎢⎣502040⎤⎥⎦=⎡⎢⎣300002300039000⎤⎥⎦.total cost in village X=30,000total cost in village Y=23,000total cost in village Z=39,000