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

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

Answers

Answer 1

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

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

Related Questions

Complete the table of values for this equation: y = 3x +10 Enter your answer by filling in the boxes. x y 4 5 6

Answers

x=4,5,6

x=4

[tex]\\ \sf\longmapsto y=3(4)+10[/tex]

[tex]\\ \sf\longmapsto y=12+10=22[/tex]

x=5

[tex]\\ \sf\longmapsto y=3(5)+10=15+10=25[/tex]

x=6

[tex]\\ \sf\longmapsto y=3(6)+10=18+10=28[/tex]

Step-by-step explanation:

y = 3x + 10

x = 4, 5, 6

Soo :

y = 3(4) + 10 = 12 + 10 = 22

y = 3(5) + 10 = 15 + 10 = 25

y = 3(6) + 10 = 18 + 10 = 28

A man is walking at 7km/hr. How long will he take to cover a distance of 42km?

Answers

[tex] \: \: \: \: \: \: [/tex]

1.75hrs

Step-by-step explanation:

it would take 1.75 hrs to cover a distance of 7 kilometres by walking 4 kilometres per hour

speed= Distance/Time

= 4/1 = 4

Time Distance/Speed

= 7/4 =1.75hrs.

hope it helps

[tex] \: \: \: \: \: \: [/tex]

Kenny has 8 red shirts, 12 blue shirts, and 10 white shirts in his closet. What is the probability that he would get a white shirt out of the closet?

Answers

Answer:

1/3 or 33.33 %

Step-by-step explanation:

this is because there is 30 shirts and all and 10 white. 10/30 is 1/3, or 33.33%

Answer:

likely

If there are 8 red shirts, 12 blue shirts, and 10 white shirts. The answer would be likely


9. Machine Trades Find the width X of the V-thread shown. (Round to the
nearest thousandth.)

Answers

Step-by-step explanation:

gjr      jrijtigjtitrg  rkgtrigjkjgkfrijr      l      

Find Y if f(x)=g(x),please help me to answer this problem.

Answers

If f(x) = g(x)

Then :

(x-4)/(x²+1) = (x² - 4) / (x²+ 1)

We can simplify on both sides by x² + 1 :

x - 4 = x² - 4

x = x²

x - x² = 0

x(1-x) = 0

So either x = 0, or x = 1

S = {0,1}

Good Luck

Answer:

Step-by-step explanation:

( x , y )

( 0 , - 4 )

( 1 , - 1.5 )

[tex]y_{1}[/tex] = - 4

[tex]y_{2}[/tex] = - 1.5

A plane is pointed S 15° E, with indicated speed 500 mph. It flies through a wind
blowing N 20° E at 55 mph. Find the resultant speed and direction of the plane.

Answers

Answer:

N 2.4 ∘ W  or Bearing  357.6 ∘

672.2x  km/hr

Step-by-step explanation:

Write an integer to represent each situation


1. walking to the track 6 feet ______
2. digging 10 holes a day _____
3. writing 5 papers ______


Find the absolute value

1. /-3/3 2. /+3/3 3. /-2/

4. /-6/ 5. /+9/ 6. /-15/

7. /=32/ 8. /+32/ 9. /-47/

10. /+78/​

Answers

Answer:

1. 6 2. 10 3. 5

for others see below

Step-by-step explanation:

1. 6 feet

2. 10 holes

3. 5 papers

1./-3/3=3*3=9

2. /3/3=3*3=9

3./-2/=2

4./-6/=6

5./9/=9

6. /-15/=15

7. /-32/=32

8. /32/=32

9. /-47/=47

10. /78/=78

P= $43,024, r= 0.0875 ? Per day , t= 90 days

Answers

Answer:

How many minutes in total did Mason spend practicing and studying? ... P= $43,024, r= 0.0875 ? Per day , t= 90 days.

Step-by-step explanation:

1. A bag contains red apples and yellow apples. The ratio of red apples to yellow apples in the bag is 9 to 4. How many apples are yellow.

Answers

Answer:

?

Step-by-step explanation:

You can’t know that, because you don’t know how many total apples there are.

Select the Ordered Pair which is a solution to the linear graph.

(8, 6)

(−8,−6)

(−8, 6)
Review the linear graph.

Answers

Answer:

point B (8, 6)

Step-by-step explanation:

Given the linear graph of a vertical line, x = 8:

The solution to the given linear equation is any ordered pair that is found along the line of the graph.

Out of the given options, point B, (8, 6) is located on the line. Therefore, it is one of the solutions to the linear equation, x = 8.

Help me answer 1c, thank you!

Answers

Answer:

bilmiyom bu kadar cevap

What is the area of a rectangle with a length of 88 inches and width of 56 inches

Answers

Answer: 4928

Step-by-step explanation:

Area= LxW

88 x 56= 4928

Becca hikes 9/10 mile in 5/3 hour.

Answers

Answer:

(9/10 mile)/(5/3 hour) = 27/50 miles/hour

Step-by-step explanation:

If you are looking for the speed, then speed = distance/time

speed = (9/10 mile)/(5/3 hour)

speed = 9/10 ÷ 5/3 miles/hour

speed = 9/10 × 3/5 miles/hour

speed = 27/50 miles/hour

Answer:

1. 9/10/3/5

2. 3/2

Step-by-step explanation:

Got it correct on iReady.

From his eye, which stands 1.62 meters above the ground, Amadou measures the
angle of elevation to the top of a prominent skyscraper to be 44°. If he is standing at a
horizontal distance of 164 meters from the base of the skyscraper, what is the height
of the skyscraper? Round your answer to the nearest tenth of a meter if necessary.

Answers

The height  of the skyscraper rounded to the nearest tenth of a meter is

160.0 meters.

The situation will form a right angle triangle.

The angle of elevation is 44 degrees. The horizontal distance of 164

meters from the base of the skyscraper is the adjacent side of the triangle.

Part of the height of the skyscraper is the opposite side of the triangle formed .

Using trigonometric ratio,

tan 44° = opposite / adjacent

tan 44° = h / 164

cross multiply

h = 164 × tan 44°

h = 158.372959068

Recall the angle of elevation was form from his eyes above the ground of

1.62 meters.

Therefore, the height of the skyscraper can be calculated below:

height of the skyscraper = 158.372959068 + 1.62 = 159.992959068

height of the skyscraper ≈ 160.0 meters

learn more: https://brainly.com/question/23910946?referrer=searchResults

Find the equation of the line

Answers

This should do… all steps explained in the picture

Solve for r.
4r–3r=20
r=

Answers

Answer:

20

Step-by-step explanation:

4r - 3r = 20

r = 20

There you go.

Answer:

r = 20

Step-by-step explanation:

Let's solve your equation step-by-step.

4r − 3r = 20

Step 1: Simplify both sides of the equation.

4r − 3r =20

4r + −3r =20

(4r + −3r) =20 (Combine Like Terms)

r = 20

Hope this helps

8.
Identify the point corresponding to Q.



A. Q′ (−4, 1)

B. Q′ (−1, −4)

C. Q′ (−3, −4)

D. Q′ (−4, −3)

Answers

Answer:

C. Q′ (−3, −4)  

D. Q′ (−4, −3)

Step-by-step explanation:

From looking at the graph it looks like the answer would be

Q= (3, -4) if the X-axis goes first

Q= (-4, 3) if the Y-axis goes first

calculate the length AB

Answers

Check the picture below.

What is the sum of the two expressions? (3/7x+4)+(1/7x-2)

Answers

Combine the like terms:

3/7x + 1/7x = 4/7x

4 + -2 = 4-2 = 2

Answer: 4/7x + 2

30 POINTS WILL MARK BRANLIEST FOR FIRST REPLY

find x using the pictures below

Answers

The left pic :

[tex]x = 46 \times \cos(70°) [/tex]

[tex]x = 46 \times 0.342[/tex]

[tex]x = 15.732[/tex]

_____________________________________________

The right pic :

[tex] \tan(18°) = \frac{15}{x} \\ [/tex]

[tex]0.325 = \frac{15}{x} \\ [/tex]

Thus :

[tex]x = \frac{15}{0.325} \\ [/tex]

[tex]x = 46.1538[/tex]

There u go ...

Have a great day ❤

1/2(-4+6x)=1/3x+2/3(x+9)

Answers

Answer:

X=4

Step-by-step explanation:

1. Simplify the expression

2. Multiply the fractions:

3. Break up the fraction:

4. Find the greatest common factor of the numerator and denominator:

5. Factor out and cancel the greatest common factor:

6. Simplify the fraction:

7. Multiply the fractions:

8.Solve by distributing:

9. Simplify the arithmetic:

10.Break up the fraction:

11. Find the greatest common factor of the numerator and denominator:

12. Factor out and cancel the greatest common factor:

13.Combine the fractions:

14. Combine the numerators

15. Find the greatest common factor of the numerator and denominator:

16. Factor out and cancel the greatest common factor:

17. Simplify the right side:

Which expressions have a value that is greater than 1?

Answers

Answer:

Im not sure about A but other then that B and D have greater values then one

Step-by-step explanation:

[tex]~\hspace{7em}\textit{negative exponents} \\\\ a^{-n} \implies \cfrac{1}{a^n} ~\hspace{4.5em} a^n\implies \cfrac{1}{a^{-n}} ~\hspace{4.5em} \cfrac{a^n}{a^m}\implies a^na^{-m}\implies a^{n-m} \\\\[-0.35em] \rule{34em}{0.25pt}\\\\ \boxed{A}\qquad \cfrac{3^{-2}}{3^3}\implies \cfrac{~~\frac{1}{3^2} ~~}{3^3}\implies \cfrac{~~\frac{1}{3^2} ~~}{\cfrac{3^3}{1}}\implies \cfrac{1}{3^3\cdot 3^2}\implies \cfrac{1}{3^5}\implies \cfrac{1}{243}\qquad \textit{\large \checkmark}[/tex]

[tex]\boxed{B}\qquad \cfrac{5^3}{5^2}\implies 5^3\cdot 5^{-2}\implies 5^{3-2}\implies 5^1\implies 5\qquad \bigotimes \\\\\\ \boxed{C}\qquad 9^0\implies 1\qquad \bigotimes \\\\\\ \boxed{D}\qquad \cfrac{(2^3)^2}{2^2}\implies \cfrac{2^{3\cdot 2}}{2^2}\implies \cfrac{2^6}{2^2}\implies 2^6\cdot 2^{-2}\implies 2^4\implies 16\qquad \textit{\large \checkmark} \\\\\\ \boxed{E}\qquad \cfrac{2^3}{2^8}\implies 2^3\cdot 2^{-8}\implies 2^{3-8}\implies 2^{-5}\implies \cfrac{1}{2^5}\implies \cfrac{1}{32}\qquad \bigotimes[/tex]

Jay has written 24 songs to date. He writes an average
of 6 songs per vear. Jenna started writing songs this
year and expects to write about 12 songs per year.
How many years from now will Jenna have written
as many songs as Jay Write and graph a system of
equations to find your answer.

Answers

Step-by-step explanation:

I'm sorry could you maybe send more information so I could help you

Solve the equation for y. 5x+2Y=9

Answers

Answer:

y = 9/2 - 5/2(x)

Step-by-step explanation:

I think this is right


STRUCTURE Tell whether the triangles are similar.

Answers

Answer:

If two triangles have two pairs of sides in the same ratio and the included angles are also equal, then the triangles are similar.

Have a nice day and I hope this helps!

rewrite 12/12 as a whole number

Answers

9514 1404 393

Answer:

  1

Step-by-step explanation:

Any (non-zero) number divided by itself is 1.

_____

This is a fact that has many uses in problem solving and units conversion.

Simplify the expression. w+w+5w

Answers

Answer:

w+w+5w = 7w

Step-by-step explanation:

Answer:

7w

Step-by-step explanation:

Brooklyn has two summer jobs. During the week she works in the grocery store, and on the weekend she works at a nursery. She gets paid $20 per hour to work at the grocery store and $21 per hour to work at the nursery. How many total hours does she work if she does 5 hours at the grocery store and 11 hours at the nursery? How many total hours does she work if she does gg hours at the grocery store and nn hours at the nursery?

Answers

Answer:

~$331 - *16 hours

Step-by-step explanation:

~ $20x5=$100

~ $21x11=$231

~ $231+$100=$331

* 5+11=16

Math expert please simplify this I am confuse thanks you

Answers

Answer:

11

Step-by-step explanation:

39 - 6 / 3

= (39 - 6) / 3

= 33 / 3

= 11

Answer:

a-2

Step-by-step explanation:

(3a-6)/3 You can factor the numerator to 3(a-2) so you have

[tex]\frac{3(a-2)}{3}[/tex]

simply divide by the 3->

a-2

M<1=m<5 true or false

Answers

Answer:

True

Step-by-step explanation:

Since m<1 and m<7 is equal to m<3 and m<5, therefore m<1 is also equal to m<5

Other Questions
13. Rachel is building a book shelf. The wood she is using is sold in sections that are 8 feet long and 16 incheswide.All of the boards Rachel needs will be 16 inches wide.She needs 5 boards that each measure 48 inches long,She needs 2 boards that each measure 32 inches long.What is the minimum number of 8 foot sections of wood Rachel will need to make the book shelf?..A. 3B. 4C. 6D. 7 which country has a province with a name meaning new scotland in latin? Why were the Alien and Sedition Acts created? nervous system.What is the purpose of the Nervous System? Explain the difference between the Central and Peripheral Nervous System.I Plz I need help with this what can be prepared ahead of time for thanksgiving Consider the domestic market for Good X in Country A, graphed above. P0=$5, P1=$25, P2=$10, P*=$15, Pw=$20, Q1=40, Q*=80, Q2=120. The world market outside country A observes a price Pw for Good X. When international trade is allowed, what is the total producer surplus? (Do not include the dollar sign $ in your answer) You and your friend are selling magazine subscriptions for a fundraiser after W weeks if you have sold (4w+1) subscriptions and your friend has sold (8w+6) subscriptions why Miranda is considered one of the most important cases in the history of our legal system Correct the misspellings in these sentences. PLS HELP I NEED THIS IN 1 HOUR 50 POINTS!!!!!!Read the chart carefully then answer the questions located beneath:Green block organization chart with Introduction, Hippopotamuses are the most dangerous animals in Africa, Main Fact 1 brackets body paragraph brackets, topic sentence, yellow block, supporting details, Jaws can bite with one ton of pressure. Teeth are stronger than elephant tusks. Runs faster than 30 mph. Yellow block Main Fact 2 brackets body paragraph brackets, Hippopotamuses have been known to cause death in many different ways. Yellow block, support details, Blue block Conclusion thesis recapBased on the topic sentence for main fact 2, which supporting details would you expect to read in the paragraph? Hippos capsize boats. They trample people. They bite to protect their young. Hippos drown hunters. They drown tourists. They drown natives. Hippos kill more than elephants. They kill more than lions. They kill more than snakes. Hippos weigh a lot. They can hide underwater. They can climb small hills. Select the correct answer.In the image, the dots show the locations of earthquakes and volcanoes that have occurred. Where are earthquakes and volcanoes most likely to occur?A. AB. BC. CD. DReset Next To reach his office on time, Mr Chin usually drives to work at an average speed of 75 km/h. However, if Mr Chin increases his average driving speed by 5 km/h, he will reach his office 10 minutes earlier. If the distance Mr Chin needs to travel to reach his office is represented by x km, form an equation in x and solve for x. what is data and why do we need data.explain three approaches of data collection.please A patient comes to you with complaints of intense headaches on the left side of his head just behind his eye. He also tells you that lately he has had trouble concentrating and feels unusually angry and confused. You ordered a variety of diagnostic tests and have the following results: Patients speech, hearing, and vision appear normal. Patients ability to perform memory tasks is less than expected for his age. Patients ability to control movement and balance appear normal. Due to these symptoms, you suspect an issue with his central nervous system. What additional abilities would be affected by this part of the brain? *10 pointsBehavior and personality, such as planning, initiated movements, social and emotional processing, and attention.Sensing touch, spatial processing, language, and memory.Visual perception and some forms of visual short-term memory.Processing smell and sound, and the ability to recognize and understand words and language. A is the point with coordinate (2,10)B is the point with coordinate (5,d)The gradient of the line AB is 4Work out the value of d Tex's Taco Truck serves tacos on either hard or soft shells. Yesterday, Tex's Taco Truck sold 5 hard-shell tacos for every 2 soft-shell tacos. If Tex's Taco Truck sold 39 more hard-shell tacos than soft-shell tacos yesterday, how many hard-shell tacos did it sell? Jason gets 15 gallons of gas at $3.90 a gallon. 15 gallons gives him 20 miles to the gallon. How many miles can Jason travel on 1 tank of gas? Cules de las caractersticas que destacan a la burguesa media consideras negativas? Por qu? Most Incan poeple wereOAO A) weaversB) shepherdsC) farmersOD nobles New Day Vitamin Company's __________ relies heavily on advertising, personal selling, and a limited use of product sampling.