Coding the given algorithm in python 3, the <em>greatest</em> <em>common </em><em>divisor</em><em> </em>of the values (124 and 244) and (4424 and 2111) are 4 and 1 respectively.
The program implementation goes thus :
def gcd(a, b):
<em>#initialize a function named gcd which takes in two parameters</em>
if a>b:
<em>#checks if a is greater than b</em>
return gcd (b, a)
<em>#if true interchange the Parameters and Recall the function</em>
elif a == 0:
return b
elif a == 1:
return 1
elif((a%2 == 0)and(b%2==0)):
<em>#even numbers leave no remainder when divided by 2, checks if a and b are even</em>
return 2 * gcd(a/2, b/2)
elif((a%2 !=0) and (b%2==0)):
<em>#checks if a is odd and B is even</em>
return gcd(a, b/2)
else :
return gcd(a, b-a)
<em>A</em><em> </em><em>sample</em><em> </em><em>run</em><em> </em><em>if</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>on</em><em> </em><em>the</em><em> </em><em>values</em><em> </em><em>given</em><em> </em><em>:</em>
print(gcd(124, 244))
print()
<em>#leaves a space after the first output</em>
print(gcd(4424, 2111))
Learn more :brainly.com/question/25506437
A) two ordered pairs: (51,3) and (59,5)
y=mx+b
m= vertical change / horizontal = 5-3 / 59 - 51 = 2/8 = 1/4 = 0.25
y=0.25x+b
51=0.25*3+b
b=51-0.75
b=50.25
y=0.25x+50.25
where y = speed, x = time
b) we have 2 poits (51,3) and (59,5) so there is no problem to sketch the graphy passing though those points :)
The difference is 0.68 meters per minute. 102.62-101.94=0.68
1. 6(5g) +12g = 21 30g + 12g = 21 42g = 21, therefore g = 21/42 = 0.5 liters p = 5 * 0.5 = 2.5 liters
2. 20 - 12 = 8 oranges;11 - 6 = 5 pears;
8 oranges costs as much as 5 pears;
But, 5 pears costs 5 × 0.80 = $4;
Then, an orange cost 4 ÷ 8 = $0.5
3.Let one pipe be x
The other pipe is 7 times as long = 7x
When he cuts 2.2 m from the longer pipe the remaining length is = 7x – 2.2 (7x is the longer pipe of x and 7x!)
When he cuts 2.2 m from the longer pipe the remaining length is 3 times that of the shorter pipe.
7x-2.2 is 3 times x
7x-2.2 = 3x
7x-3x = 2.2
4x = 2.2
X= 2.2/4 = 0.55 m (this is the length of the shorter pipe in meters)