Ann and Bob are in an Italian restaurant. The owner offers them a free pizza under the following condition. Each…