Mathematical method to find user's selected card