#Problem 1: #1. Give an example of input to receive an output: YES #2. Give an example of input to receive an output: NO a=int(input("enter a ")) b=int(input("enter b ")) if(a%b!=0 and (a-b)>0): print("YES") else: print("NO") #Solution: #1. In order to get YES, this statement (a%b!=0 and (a-b)>0) #must be TRUE #since we have logical operator AND, both expressions must be TRUE #(a%b!=0 must be TRUE) and (a-b)>0 must be TRUE #a%b not equal 0 means what a is not divisible by b #(a-b)>0 means what a greater than b #we need to find two numbers, a and b, a must greater than b and not #divisible by b #One example: a=4 b=3 #Another example: a=10, b=7 #2. In order to get NO, this statement (a%b!=0 and (a-b)>0) must be #FALSE #since we have logical operator AND, it will be sufficient if at least #one expression is FALSE #(a-b)>0FALSE or a%b!=0 FALSE or both FALSE #a%b!=0 FALSE means what a is divisible by b #(a-b)>0 FALSE means a is less or equal b #Example: a=1 b=10 1%10=1!=0 TRUE but (1-10)>0 FALSE #Example: a=10 b = 2 10%2=0!=0 FALSE #Example: a=10 b=10 10%10=0!=0 FALSE and 10-10=0>0 FALSE #Problem 2: #1. Give an example of input to receive an output: YES #2. Give an example of input to receive an output: NO #3. Give an example of input to receive an output: MAYBE a=int(input("enter a ")) b=int(input("enter b ")) c=int(input("enter c ")) if(c%2==0 or b*a>c): print("YES") elif(a>b): print("NO") else: print("MAYBE") #Solution: #To get YES c%2==0 or b*a>c must be TRUE, it is sufficient that at #least one expression is TRUE #c%2==0 means c is EVEN #b*a>c means product of a and b greater than c #a = 3 b = 4 c = 10 #10 is even and also 3*4=12 >10 true #To get NO, (c%2==0 or b*a>c) must be FALSE and a>b must be TRUE #(c%2==0 or b*a>c) be FALSE only if BOTH are FALSE #c must ODD and product of a and b must be less or equal c #a>b must be TRUE #a = 2 b = 1 c = 5 #5 is odd, 5%2==0 is FALSE, 1*2>5 FALSE, 2>1 TRUE #a = 5 b = 2 c = 13 #13 is odd, 5*2>13 FALSE, 5>2 TRUE #To get MAYBE #(c%2==0 or b*a>c) must be FALSE and a>b must be FALSE #Example: a = 0 b = 0 c = 3 #3 is odd, 0*0>3 FALSE, 0>0 FALSE #Example: a = 1 b = 1 c = 1 #1 is odd, 1*1>1 FALSE 1>1 FALSE