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).

Answers

Answer 1

Coding the given algorithm in python 3, the greatest common divisor of the values (124 and 244) and (4424 and 2111) are 4 and 1 respectively.

The program implementation goes thus :

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)

A sample run if the program on the values given :

print(gcd(124, 244))

print()

#leaves a space after the first output

print(gcd(4424, 2111))

Learn more :brainly.com/question/25506437

The Recursive Algorithm Given Below Can Be Used To Compute Gcd(a, B) Where A And B Are Non-negative Integer,

Related Questions

Collect the like terms: 5a + 2b + b - 2a​

Answers

Answer:

5a+2b+b-2a

5a-2a+2b+b

3a+3b

3/8 + 1/8 + 2/3 - 1/2 =

Answers

Answer: 2/3 (answer in decimal form = 0.6)

Step-by-step explanation: The least common multiple (LCM) of two or more non-zero whole numbers is the smallest whole number that is divisible by each of those numbers. In other words, the LCM is the smallest number that all of the numbers divide into evenly. Then do the rest of the operations.

Can someone help me please I’ve been stuck for a week :(

Answers

Answer:

8/25.

Step-by-step explanation:

As a fraction it is 32/100 but simplified is 8/25 :)

the following points lies in the solution set of the system of inequalities shown graphed below?
A. (1, 0)
B. (2, 2)
C. (-4, 0)
D. (2, -4)

Answers

Option C would be the correct answer :)

Which inequality represents this sentence?
A number is no less than 48.
n < 48
n > 48
n < 48
n>48

Answers

The inequality that can be used to represent the information that a number is no less than 48 will be n > 48.

Inequality simply means a mathematical expression that is used in which the sides aren't equal to each other.

It should be noted that the expression that a number is no less than 48 means the number is greater than 48. Therefore, the inequality is n > 48.

Read related link on:

https://brainly.com/question/25701252

Answer: The correct answer is n≥48

Step-by-step explanation: Give me the brainiest

What is a variable in the expression below?

12+2.6z-2

A) z

B) 2.6

C) -2

Answers

A variable is a letter in the equation that can be replaced by a number.

In the equation shown the variable is the letter z.

Answer: A) z

Multiply. Write your answer as a fraction in simplest form.
2x7/16

Answers

Answer:

7/8

Step-by-step explanation:

7/16×2=7/16×2/1

          =14/16

          =7/8

Naomi can run 1/4 mile in 2 minutes. Does Amal or Naomi run faster? How do you know

Answers

Answer: Yes

Step-by-step explanation:

A: 12 minutesAnswer to B: 36 minutesAnswer to C:

soooooooooooooooooooooooo who wants to help with mah math

Answers

Answer:

t = c · (3.5)  

Step-by-step explanation:

The rate of change is 3.5.

So it takes three and a half mins to make one plane

So 3.5 times the number of planes equals the total time it takes to make them.

I really hope this helps!

find the slope from the pair of the points
(-3,-4) (1,5)

Answers

Answer:

2.25

Step-by-step explanation:

m = 9 / 4 = 2.25

points belong to an increasing, linear function.

Equation: y = 2.25x + 2.75.

BRAINLIEST?

Area of a circle
You might need:
Calculator
What is the area of the following circle?
Either enter an exact answer in terms of or use 3.14 for it and enter your answer as a decimal.
T = 1
units

Answers

Answer:

If the radius is 1, then the answer is pi.

Radius=r=1

Area

πr²π(1)²1ππ3.14 units²

Pre college need help

Answers

Answer:

C

Step-by-step explanation:

1.5 - x
0.4 = - 7.75

Answers

Answer:−0.6

Step-by-step explanation:

(-1).3/5=−0.6

help on 37 pleaseee (geometry)

Answers

Answer:

Step-by-step explanation:

x = 127

y = 5

z = 31

What is the domain of f(x)=(1/4)^x?

A. y > 0

B. x < 0

C. x > 0

D. All real numbers​

Answers

[tex] \huge \bf༆ Answer ༄[/tex]

The domain of given function is All real numbers

[tex] \sf \: f(x) = { \bigg( \dfrac{1}{4} \bigg) }^{x} [/tex]

For each value of x the function is defined.

Example -

For x = 1

The value is [tex] \sf\frac{1}{4}[/tex]

For x = -1

The value is 4

[tex]꧁ \: \large \frak{Eternal \: Being } \: ꧂[/tex]

Solve. 140% of 340 is what number?​

Answers

Answer:

The answer is 476

Step-by-step explanation:

hope this helps :)

Jamal cut a piece of wood that is 2 1/3 feet long into 1/6 foot sections. How many sections will he get

Answers

Answer:

14 sections

Step-by-step explanation:

2 1/3=7/3

7/3 divided by 1/6 is nothing but 7/3*6, which is just 14

Given slope of −25 with point (-5,3), write the linear equation in Slope-Intercept Form.

Answers

[tex]\\ \sf\longmapsto y=mx+b[/tex]

[tex]\\ \sf\longmapsto 3=-25(-5)+b[/tex]

[tex]\\ \sf\longmapsto 3=125+b[/tex]

[tex]\\ \sf\longmapsto b=-122[/tex]

Equation of the line

[tex]\\ \sf\longmapsto y=-25x-122[/tex]

Helmet Nemzek recieved a COLA of 2.3% on his weekly gross wages of $760 how much will helmet earn per week after the pay increase

Answers

Answer:

Step-by-step explanation:

$760(1.023) = $777.48

Answer the question based on this system of equations.

{x=y−5
6x−2y=22

Which of the following choices help to verify whether (7,12) is a solution to the system above?

Select all that apply.

Group of answer choices

1.) 7=12−5 is true.

2.) 7=12−5 is not true.

3.) 6(7)−2(12)=22 is true.

4.) 6(7)−2(12)=22 is not true.

Answers

Step-by-step explanation:

1.) 7=12 - 5 is true

4.) 6(7) - 2(12) = 22 is not true

pls help me i will give u thanks

Answers

(+6,+5)
Hope this helps!!

Answer:

c) (6,5)

Step-by-step explanation:

The horizontal axis represents x values

The vertical axis represents y values

Use the slope formula to determine the slope of the line containing the two points. Type your answer as an integer or reduced fraction in improper form if necessary.

Answers

Answer:

The slope is:

[tex] \binom{1}{2} [/tex]

In slope-intercept form the equation is:

[tex]y = \binom{1}{2} x - 3[/tex]

What are some of the consequences the employee face

Answers

Answer:

rude customers and complaints

Answer:

Ignorant managers.

Step-by-step explanation:

Ignore them

Find somewhere else to move.

A car of the year 2020 is topped with 25% of its price. If the list price says $ 25,000, what will the discounted price be?

Answers

Answer:

is he a business man or something

Please help. NEED THE ANSWER SOON AS POSSIBLE.

Answers

Answer:

y=4x-17

Step-by-step explanation: Distribute the 4(x-5)

4x-20

Then add three to both sides

y=4x-17

Two hundred fifty tickets are sold at a fund raiser. If Sarah buys 15 tickets, the probability that she will win the prize quilt is
.

Answers

Answer:

6%

Step-by-step explanation:

15/250=3/50   or 6%

The probability that Sarah would win the prize quilt given the tickets she bought  is 6%.

What is the probability?

Probability is how likely it is that a stated event would happen. The probability of the event happening lie between 0 and 1.

The probability that Sarah would win the prize quilt = number of tickets bought / total number of tickets

(15 / 250) x 100 = 6%

To learn more about probability, please check: https://brainly.com/question/13234031

#SPJ2

Help help math please help help help help

Answers

Answer:

Answered is x= 55x

Step-by-step explanation:

13x+10 * 12x+20

soln:

or, 13x+12x+10+20

or, 25x+30

:., therefore, x=55x

calc 3 iiiiiiiiiiiiiiiiiiiiiiiiiiii

Answers

Take the Laplace transform of both sides:

L[y'' - 4y' + 8y] = L[δ(t - 1)]

I'll denote the Laplace transform of y = y(t) by Y = Y(s). Solve for Y :

(s²Y - s y(0) - y'(0)) - 4 (sY - y(0)) + 8Y = exp(-s) L[δ(t)]

s²Y - 4sY + 8Y = exp(-s)

(s² - 4s + 8) Y = exp(-s)

Y = exp(-s) / (s² - 4s + 8)

and complete the square in the denominator,

Y = exp(-s) / ((s - 2)^2 + 4)

Recall that

L⁻¹[F(s - c)] = exp(ct) f(t)

In order to apply this property, we multiply Y by exp(2)/exp(2), so that

Y = exp(-2) • exp(-s) exp(2) / ((s - 2)² + 4)

Y = exp(-2) • exp(-s + 2) / ((s - 2)² + 4)

Y = exp(-2) • exp(-(s - 2)) / ((s - 2)² + 4)

Then taking the inverse transform, we have

L⁻¹[Y] = exp(-2) L⁻¹[exp(-(s - 2)) / ((s - 2)² + 4)]

L⁻¹[Y] = exp(-2) exp(2t) L⁻¹[exp(-s) / (s² + 4)]

L⁻¹[Y] = exp(2t - 2) L⁻¹[exp(-s) / (s² + 4)]

Next, we recall another property,

L⁻¹[exp(-cs) F(s)] = u(t - c) f(t - c)

where F is the Laplace transform of f, and u(t) is the unit step function

[tex]u(t) = \begin{cases}1 & \text{if }t \ge 0 \\ 0 & \text{if }t < 0\end{cases}[/tex]

To apply this property, we first identify c = 1 and F(s) = 1/(s² + 4), whose inverse transform is

L⁻¹[F(s)] = 1/2 L⁻¹[2/(s² + 2²)] = 1/2 sin(2t)

Then we find

L⁻¹[Y] = exp(2t - 2) u(t - 1) • 1/2 sin(2 (t - 1))

and so we end up with

y = 1/2 exp(2t - 2) u(t - 1) sin(2t - 2)

What's
9/10 + (-3) in simplest form​

Answers

Reduce the expression, if possible, by cancelling the common factors.

Exact Form: [tex] \:- \frac{3}{10} \\ [/tex]

Decimal form[tex] \: \:- 0.3[/tex]

Classify: −4m+21(m−1)≤15m+2(m−1).

Answers

Answer:

[tex]\boxed{\sf All\: real\: numbers}[/tex]

Step-by-step explanation:

[tex]\star \:\sf Classify\: -4m+21\left(m-1\right)\le \:15m+2\left(m-1\right)\: \star[/tex]

Apply Distribution law:

[tex]\sf -4m+21m-21\le \:15m+2\left(m-1\right)[/tex]

Combine like terms:

** [tex]\sf \hookrightarrow -4m+21m=17m[/tex]

[tex]\longmapsto\sf 17m-21\le \:15m+2\left(m-1\right)[/tex]

[tex]\sf 2(m-1)[/tex]

[tex]\hookrightarrow 2m-2[/tex]

-----------------------------------------

[tex]\longmapsto\sf 17m-21\le \:15m+2m-2[/tex]

Combine like terms:

** [tex]\sf 15m+2m=17m[/tex]

[tex]\longmapsto\sf 17m-21\le \:17m-2[/tex]

Add 21 from both sides:

[tex]\longmapsto\sf 17m-21+21\le \:17m-2+21[/tex]

[tex]\longmapsto\sf 17m\le \:17m+19[/tex]

Subtract 17m from both sides:

[tex]\longmapsto\sf 17m-17m\le \:17m+19-17m[/tex]

[tex]\longmapsto\sf 0\le \:19[/tex]

Therefore, the solution of the inequality: All real numbers

_____________________________________________

Other Questions
Drake bought a $110,000 life insurance policy at $12.95 for a 20 year term.What will he pay over 20 years for the premium? When using re-grouping to solve 25 x 45, what are the four problems that would be calculated to find the final answer?A.20 x 40; 5 x 40; 20 x 5; 5 x 5B.20 x 20; 40 x 40; 20 x 5; 5 x 5C.20 x 40; 20 x 5; 40 x 5D.20 x 40; 5 x 20; 20 x 5; 5 x 5 Potential energy depends onQuestion 2 options:Length and colorPosition or shapeDensity and volumeSpeed and velocity Which of the following statements is true of postmodern cultural spaces. (6.-1);y=-5x+3slope intercept form How do the oxygen (O2) and carbon dioxide (CO2) levels change over time? What is always true about the total amount of O2 and CO2 in the test tube? What happens when the CO2 reaches zero? magbigay ng halimbawa na nagpapakita ng pagkakaisa ng mga Pilipino at paano ito nakatulong sa bansa at sa mga mamamayang Pilipino?Need na po.. What is the length of the unknown side of the right triangle? A right triangle with hypotenuse x and legs 7 and 24 7 24 25 31 How is the music history of ancient Egypt and ancient Greece similar?They both used math to study sound waves.They both believed music was inspired by the gods.They both used paintings and other art pieces to symbolize music.They both used religious poems written by high priests to create music. how can you simplify 24 to 96 Lila collected 116gallons of honey. After using some of the honey she collected for baking, Lila found that she only had 34 gallon of honey left. How much honey did she use for baking? Find the greatest common factor of 27 and 46 guys help me, please help asap ill give brainliest I need help with this question! Whoever is correct, I will give brainliest! What is 10 - (-18) in a integer the table shows the price x (in dollars) of a product at several different stores and the profits y (in dollars) generated by seeing the product. use a graphic calculator to write a function that models the data. Round each value in your function to the nearest hundredth. The equation is y=___ How often a wave occurs is the waves A. crest. B. frequency. C. wavelength. D. amplitude Select two quotes from Passage 1 that advance the claim that the USA should be a world leader in furthering human rights around the globe. "...a new generation of Americans--born in this century, tempered by war, disciplined by a hard and bitter peace, proud of our ancient heritage..." (paragraph 1)"Since this country was founded, each generation of Americans has been summoned to give testimony to its national loyalty." (paragraph 4)"...a call to bear the burden of a ... struggle against the common enemies of man: tyranny, poverty, disease and war itself." (paragraph 5)"I do not believe that any of us would exchange places with any other people or any other generation." (paragraph 7)"My fellow citizens of the world: ask not what America will do for you, but what together we can do for the freedom of man." (paragraph 8)"The graves of young Americans who answered the call to service around the globe." (paragraph 4)"Can we forge against these enemies a grand and global alliance..." (paragraph 6)"The energy, the faith, the devotion which we bring to this endeavor will light our country and all who serve it..." (paragraph 7) Type your response in the box Read the excerpt from Lincoln's Second Inaugural Address again. What are the point of view and tone of the speech? Use evidence from the speech to support your answer.