Boffins find mathematical formula when it comes to wife that is perfect