5. The recursive algorithm given below can be used to compute gcd(a, b) where a and b are non-negative integer, not both zero.
procedure gcd(a, b)
if a b then gcd(a, b) := = gcd (b, a)
else if a = 0 then gcd (a, b) = b
else if a = 1 then gcd (a, b) :
:=1
else if a and b are even then gcd(a, b) 2gcd(a/2, b/2) := else if a is odd and b is even then gcd(a, b) := gcd(a, b/2)
else gcd(a, b) := gcd(a, b - a)
Use this algorithm to compute
(a) gcd(124, 244)
(b) gcd (4424, 2111).u
Implementating the given algorithm in python 3, the greatest common divisors of (124 and 244) and (4424 and 2111) are 4 and 1 respectively.
The program implementation is given below and the output of the sample run is attached.
def gcd(a, b):
#initialize a function named gcd which takes in two parameters
if a>b:
#checks if a is greater than b
return gcd (b, a)
#if true interchange the Parameters and Recall the function
elif a == 0:
return b
elif a == 1:
return 1
elif((a%2 == 0)and(b%2==0)):
#even numbers leave no remainder when divided by 2, checks if a and b are even
return 2 * gcd(a/2, b/2)
elif((a%2 !=0) and (b%2==0)):
#checks if a is odd and B is even
return gcd(a, b/2)
else :
return gcd(a, b-a)
#since it's a recursive function, it recalls the function with new parameters until a certain condition is satisfied
print(gcd(124, 244))
print()
#leaves a space after the first output
print(gcd(4424, 2111))
Learn more :https://brainly.com/question/25506437
A local hamburger shop sold a combined total of 387 hamburgers and cheeseburgers on Thursday. There were 63 fewer cheeseburgers sold than hamburgers. How many hamburgers were sold on Thursday?
Answer:
350 hamburgers
Step-by-step explanation:
Let x = the number of hamburgers sold
Let x - 53 = the number of cheeseburgers sold
x + x - 53 = 647
2x = 700
x = 350 hamburgers
A normal distribution of scores has a standard deviation of 10and a samplemean of 50. Find the probability corresponding to each of the following values:
a. a score of 67
b. a score that is below 36
c. a score that is greater than 78
d. a score between 52 and 67
Answer:
Step-by-step explanation:
o What proportion of normal distribution corresponds to z-scores < z = 1.00? o What is the probability of selecting a z-score less than z = 1.00? (A). (B). (C).
For each value of v, determine whether it is a solution to 59 = 3 - 7v.
Answer:
[tex]59=3-7v[/tex]
Subtract 3 from both sides:
[tex]59-3=3-7v-3[/tex]
[tex]56=-7v[/tex]
[tex]-7v=56[/tex]
[tex]v=-8[/tex]
-8 is the only solution.
Answer:
well I think it's -6
Step-by-step explanation:
7×-6=-42+3=39
8.2 is 2% of what number
Answer:
Step-by-step explanation:
If 2% × 410 = 8.2 => Divide 8.2 by 410And see if we get as a result: 2% Note: Multiply a number by the fraction 100/100, and its value doesn't change.
Answer:
m = 410
Step-by-step explanation:
Let the number be n. Then:
8.2
--------- = 0.02
n
Cross-multiplying yields 0.02n = 8.2, from which we find n = 410
Recall that a percentage, such as 2%, is equivalent to a decimal fraction, such as
2%
-------- = 0.02
100%
they are sixty four thousand people at a football game 80% of the people were supporting the home team how many people were supporting the home team
Answer:
51200
Step-by-step explanation:
64000×80%=51200
[tex]\huge\mathfrak{question}[/tex]
they are sixty four thousand people at a football game 80% of the people were supporting the home team how many people were supporting the home team
[tex] \huge \mathfrak step \: by \: step[/tex]
First we will look for how much 80% of 64,000 is.
Lets put our equation
[tex]64000 \times 80 \div 100[/tex]
solve it and we get
[tex]{{\boxed{{51200}}}}}[/tex]
as our answer
Joe is a photographer . For every 15 rolls of film he shoots, 10 are black and white. If Joe uses 57 rolls of film, how many rolls are in black and white?
Answer:
38 black and white rolls.
Step-by-step explanation:
15 rolls = 10 black and white
57 rolls = 57 divided by 15 multiplied by 10
57 rolls = 3.8 x 10 Leaving 38 Therefore there will be a total of 38 black and white rolls.
Need help please to this question
Answer:
c
Step-by-step explanation:
x=slope
y=intercept
The slope is put in front of the x and then you would add the y intercept.
Answer: c. y = -3x + 4
An expression is given.
6x (3x + 11)
Create an equivalent expression with the fewest terms possible.
HELP ASAP!!!!
Equivalent expressions are simply expressions that have the same value, irrespective of their form.
The equivalent expression of [tex]\mathbf{6x(3x + 11)}[/tex] is [tex]\mathbf{18x^2 + 66x}[/tex]
The expression is given as:
[tex]\mathbf{6x(3x + 11)}[/tex]
Start by opening the brackets; i.e. apply distributive property
[tex]\mathbf{6x(3x + 11) = 6x \times 3x + 6x \tiimes 11}[/tex]
Evaluate all products
[tex]\mathbf{6x(3x + 11) = 18x^2 + 66x}[/tex]
The expression cannot be further simplified.
Hence, the equivalent of [tex]\mathbf{6x(3x + 11)}[/tex] is [tex]\mathbf{18x^2 + 66x}[/tex]
Read more about equivalent expressions at:
https://brainly.com/question/15715866
whats the answer can someone answer please
Answer:
5. b and 6. c
Step-by-step explanation:
Answer:
5. b
6. c
Step-by-step explanation:
Jace's average gross pay is $1,450.00 bi-weekly. Determine how many years it will take Jace to earn his first million dollars.
a
27 years
b
26 years
c
14 years
d
13 years
Please Help!!!
it will take him 27 years
what is the trend of the graph of the equation y = 3x + 10
Answer:
3x+y-10
Step-by-step explanation:
please Mark my answer in brainlist
?
Which is the simplified form of n -6p3?
OPTION C
if any doubt leave a comment
Step-by-step explanation:
remember, a negative exponent means 1/...
like 5^-3 = 1/5³
once you understand this, it is totally easy to find the right answer : the third option p³/n⁶
because n has a negative exponent, p has a positive one.
A line with a slope of
–
1
8
passes through the points (4,
–
7) and (
–
4,k). What is the value of k?
Rationalize the denominator and simplify the following expression:
fraction numerator 4 plus square root of 2 over denominator 2 space minus square root of 2 end fraction
let's recall that the conjugate of say a + b is simply the same thing with a different sign in between, namely a - b, so let's use the conjugate of the denominator and multiply top and bottom by it.
[tex]\textit{difference of squares} \\\\ (a-b)(a+b) = a^2-b^2 \\\\[-0.35em] \rule{34em}{0.25pt}\\\\ \cfrac{4+\sqrt{2}}{2-\sqrt{2}}\cdot \cfrac{2+\sqrt{2}}{2+\sqrt{2}}\implies \cfrac{(4+\sqrt{2})(2+\sqrt{2})}{\underset{\textit{difference of squares}}{(2-\sqrt{2})(2+\sqrt{2})}}\implies \cfrac{(4+\sqrt{2})(2+\sqrt{2})}{2^2-(\sqrt{2})^2}[/tex]
[tex]\cfrac{8+4\sqrt{2}+2\sqrt{2}+(\sqrt{2})^2}{4-2}\implies \cfrac{8+4\sqrt{2}+2\sqrt{2}+2}{2}\implies \cfrac{10+6\sqrt{2}}{2} \\\\\\ \cfrac{~~\begin{matrix} 2 \\[-0.7em]\cline{1-1}\\[-5pt]\end{matrix}~~(5+3\sqrt{2})}{~~\begin{matrix} 2 \\[-0.7em]\cline{1-1}\\[-5pt]\end{matrix}~~}\implies \boxed{5+3\sqrt{2}}[/tex]
Lin's family has completed 70% of a trip. They have traveled 35 miles. How far is the trip?
Group of answer choices
24.5 miles
59.5 miles
200 miles
50 miles
Answer:
70x = 35
100
cross multiply
70x= 35 × 100
70x= 3500
divide both side by 70
70x = 3500
70 70
x= 50miles
Please help
Consider the graph of g(x)= 2-8x12. identify the y- intercept, the vertex, and the zero of the functions.
what is the slope of the line on the graph
Answer:
(6,0) (-6,0)
Step-by-step explanation:
sorry kung mali pero sana makahelp
biografía completa de Pitágoras
Answer:
hiiiiiiiiiíiiiiiiiiiii
Complete the table below by finding the unknown principal P, rater, time t, and interest /.
Principal P
(a)
480,000
250,000
980,000
Rate r
6%
(b)
5.5%
0.8%
Time t
10
15
(c)
3.5
Interest /
9,000
180,000
68,750
(d)
12
Answer:
use these formulas to solve
Step-by-step explanation:
Principal( P) = interest / rate x time
Rate (R) = intrest / principal x time
Intrest (I) = PRT
nesesito ayuda ..........4c`````````````````````````````````````````````````````z#DRsw
Answer: ???
Step-by-step explanation:
I need help as soon as possible please!!!!
Answer:
Which grade math is this? I haven't learned it
Which of the following tables does not represent a function?
Answer:
It's the 3rd option
Step-by-step explanation:
A function cannot have one value of 5 associated to more than one value on y
i dont know this question i will give you brainly
Answer:
11z/4+3/10
Step-by-step explanation:
Distribute first then combine like terms.
-
The sum of 2 and x is at least - 19.
2 + x = -19 <=> x = -19 -2 = -21
4. Find a value of x that is a solution to 5(x - 3) = x + 13. Describe how you found the solution
Answer:
x=7
Step-by-step explanation:
5(x - 3) = x + 13
Distribute the 5
5x-15 = x+13
Subtract x from each side
5x-15-x = x+13-x
4x-15 =13
Add 15 to each side
4x-15+15 = 13+15
4x= 28
Divide each side by 4
4x/4 = 28/4
x = 7
Answer:
x = 7
Step-by-step explanation:
First
5(x - 3) = 5x - 15 by distributing the 5 on each variable and number in the parenthesis.
Then
5x - 15 = x + 13 which you add 15 (or 5x - 15 + 15 = x + 13 +15) on both sides to have the numbers on one side because it must be the opposite to cancel out the 15 on the original/previous side.
Afterwards
5x = x + 28 now we must get the x to the other side and using the same logic as before you move the x to the other side by subtracting it (or 5x - x = x + 28 - x) to the other side equaling 4x = 28.
Finally
4x = 28 you need to divide each side by 4 to cancel out the 4 on the x since we must find out what x is (or 4x/4 = 28/4), and you should get x = 7.
What is the value of w in the equation? 7w + 4 = 16 + 9 A.7 B.25 C.3 D.21
Answer: C
Step-by-step explanation:
16+9=25 so 25-4 is 21 and 7 times 3 is 21. This means that 7(3) + 4 is 25
Hi! ❤️ , im looking for some (accurate) help here.
ill give brainliest if able to.
Answer:
A
Step-by-step explanation:
70000 is 100 times greater than 700
Look at the angle Z that is marked on the shape. Is this angle less than, more than or equal to a right angle?
Answer:
Less then a right angle
Step-by-step explanation:
It’s can’t be equal (looks at other examples of a right angle)
It can’t be more since that would bve more then a right angle and it certainly isnt more
it can only be less
James made $85.00 in 2 weeks mowing yards. He spent 20% of that buying new tools. How much did he spend on tools? *
10 points
A $15
B $20
C $17
D $14
Answer asap please!
Answer: c 17
Step-by-step explanation:
Easy
Answer:
C. $17
Step-by-step explanation:
85 x (1/5) = 17