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

Q

1). 20² + 20^2

nt : I from is Indonesian ​

Answers

Answer:

[tex]\red{\rule{4pt}{700000pt}}[/tex]

Step-by-step explanation:

hi

There are 10 board members on the Community Arts Council. In how many ways can a president and treasurer be chosen

Answers

Answer:

45

Step-by-step explanation:

This is a combination question: how many ways can you pick 2 people from a group of 10?

Using the notation C(10, 2) for the number of combinations of 10 things chosen 2 at a time...

[tex]C(10, 2)=\frac{10!}{2!(10-2)!}=\frac{10!}{2!\cdot 8!}=\frac{10\cdot 9}{2\cdot 1}=45[/tex]

p l s… h e l p… m e…

Match the unknown entries in the two matrices with their correct values

Answers

Answers:

v = 54y = 0u = 6w = -48x = -1

===================================================

Explanation:

The left hand side is

[tex]-6\begin{bmatrix}3 & -1 & 3\\8 & x & -9\\4 & -1 & y\end{bmatrix}[/tex]

That -6 outside the matrix is multiplied with each item inside the matrix. This is known as scalar matrix multiplication. Effectively, it's very similar to the idea of the distributive property.

So for the first row, we have the three columns of: -6*3 = -18 and -6*(-1) = 6 and -6*3 = -18

The other two rows are handled the same way. This is what should result:

[tex]-6\begin{bmatrix}3 & -1 & 3\\8 & x & -9\\4 & -1 & y\end{bmatrix}= \begin{bmatrix}-18 & 6 & -18\\-48 & -6x & 54\\-24 & 6 & -6y\end{bmatrix}[/tex]

From here, you'll then match up the terms in the given right hand side matrix. The top row has the variable 'u' in the middle, which matches with the '6' in the middle of the top row shown. Therefore, u = 6.

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

Now to the second row.

The -48 in the first spot pairs up with the w in the other matrix. So we can see that w = -48. Similarly, we have v = 54.

Also, we have -6x in the middle which matches with the 6 in the same corresponding spot. Solving -6x = 6 leads to x = -1.

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

Finally, the third row.

There's only one variable here and that's the variable y in the bottom right corner. It pairs up with 0 in the same corresponding spot for the right hand side matrix. Therefore, y = 0.

please i need help

How many rows of seats are inside the theater? Enter your answer in the box.

Answers

Answer:

24 rows

Step-by-step explanation:

384 seats in total, and 16 chairs in a row, so 384/ 16=

24 rows

Hope this helps!

LMK if it does

Samuel wants to use his earnings from Monday and Tuesday to buy some batteries that cost 5.60 each how many batteries can samuel buy

Answers

How much did Samuel make I can answer it if you give me the number

Answer:

i cannot answer this because i do not know hw much money he has made.

Step-by-step explanation:

Determine whether the quadratic function shown below has a minimum or maximum, then determine the minimum or maximum value of the function.
f(x)=2(x−8) ^2−3

Answers

Answer:

It's a minimum, at (8, -3)

Step-by-step explanation:

Option 1: you unwrap the square , add like terms, and then recognize it's a parabola and find the coordinates of the vertex.

Or look at it as -3 + something ^2. It means you are adding something positive to -3, so the sum is greater or equal to -3, that is the definition of a minimum. At that point you find the minimum by setting that something equal to 0 (which gives you x = 8) and the value is -3 + 0 = -3

You need 1 1/4 cups of sugar to make 20 cookies. To make 16 cookies you will need how much sugar?

Answers

Answer:

You need 1 cup of sugar.

Step-by-step explanation:

16/20 = 4/5

1 1/4 = 5/4

5/4 x 4/5 = 1

You need 1 cup of sugar.

The table shows a linear relationship between x and y.
x
-6
-3
1
4
Y
21
13.5
3.5
-4

What is the slope of the line represented by the values in the table?

Answers

The slope of the line is: 5/6


Hope this helps!! :)


Please help if you can!

Answers

Answer:

-3

Step-by-step explanation:

that’s where the line intercepts with the y axis

Answer:

-3,0 is y intercept good luck

A car is traveling at a speed of 54 kilometers per hour. What is the car's speed in meters per second? How many meters will the car travel in 10 seconds? Do not round your answers.

Answers

we would convert this using conversions. multiply 54 times 1000 to get your work into meters and 1 times 3600 to get hours into seconds. divide the 2 answers to get 15 m/s.

Emily sells her books through Amazon. She makes a profit of $3 per book sale, however, she needs to pay $6 to Amazon Pay in fees for using their app. How many books would she need to sell to make a profit of at least $120 per day?

Answers

Answer:

Step-by-step explanation:

ASSUMING the usage fees are daily fees

120 = 3x - 6

126 = 3x

x = 42 books

Math experts please simplify this thank you

Answers

Answer:

t+4 / t-4

Step-by-step explanation:

(t^2 - 16) / (t^2 -8t +16)

=( t^2 - 4^2) / (t^2 - 2*4*t + 4^2)

by formula a^2 - b^2 = (a+b)(a-b)

= (t+4)(t-4)  / (t-4)^2

= (t+4)(t-4)  / (t-4)(t-4)

= t+4 / t-4

Question 19
A game consists of black and white pieces. The number of black pieces is 5 more than 3 times the white pieces. Seven white and 15 black pieces are removed each round. After several rounds, there are 3 white and 56 black pieces left. How many pieces were there in the beginning?
A. 52
B. 158
C. 210
D. 213
E. 218

Answers

Answer:

D. 213

Step-by-step explanation:

The number of black pieces is 5 more than 3 times the white pieces:

b = 3w + 5

Let the number of rounds is x.

Initial number of white nd black pieces:

w = 7x + 3b = 15x + 56

Substitute the values of b and w into first equation and find the value of x:

15x + 56 = 3(7x + 3) + 515x + 56 = 21x + 146x = 42x = 7

Find the number of pieces:

w = 7*7 + 3 = 52b = 3*52 + 5 = 161w + b = 52 + 161 = 213

Correct choice is D

Answer:

A game consists of black and white pieces. The number of black pieces is 5 more than 3 times the white pieces. Seven white and 15 black pieces are removed each round. After several rounds, there are 3 white and 56 black pieces left. How many pieces were there in the beginning?

A. 52

B. 158

C. 210

D. 213

E. 218

100÷5+25×3=



AYUDAA ES PARA HOYYY​

Answers

Answer:

95

Step-by-step explanation:

100 divided by 5 plus 25 times 3 is 95 :)

100/5=20

25x3=75

75+20=95

95

I need a help.... thankyouu to those who can ans. this:))

A. BSA Method
B. Clark's Rule

(20 points)​

Answers

A

Step-by-step explanation:

just trust me that is the correct answer

Convert 101100 2 to decimal

Answers

Answer:

The answer is 101100

If x^2 - (3x-a) (bx-1) = c, where a, b, and c are constants, what id the value of c?
A. 9
B. 7
C. 13
D. 2

Answers

A is the correct answer

Let f(x)= – 2x-1, h(x) = - X+2.
Find (f o h)(-1).

Answers

f(x) = -2x - 1 h(x) = -x + 2

(f o h)(-1) = ...

= f(h(-1))

= f(-1 + 2)

= -2(-1 + 2) - 1

= 2 - 4 - 1

= -2 - 1

= -3

A sunflower is 13 inches tall and grows 41 inches each month. The
sunflower's height is a linear function of time. Which statement best
describes the rate of change and initial value of this function?
A. The rate of change is the number of inches grown per month, and
the initial value is the first month.
B. The rate of change is the number of inches grown per month, and
the initial value is the starting height.
C. The rate of change is the starting height, and the initial value is the
number of inches grown per month.
D. The rate of change is the number of months per inch grown, and
the initial value is the first month.

Answers

Answer:The rate of change is the number of inches grown per month, and

the initial value is the starting height.

Step-by-step explanation:

The rate of change is the starting height, and the initial value is the

number of inches grown per month.

What is slope intercept form of line?

The slope intercept form of a line is y=mx+b, where m is slope and b is the y intercept

Given,

A sunflower is 13 inches tall and grows 41 inches each month.

The sunflower's height is a linear function of time.

A linear function is a function whose graph is a straight line, that is, a polynomial function of degree zero or one.

y=13+41x.

Here x represents the number of months

13 is the initial height of the sunflower.

In the given options, The rate of change is the starting height, and the initial value is the number of inches grown per month is the statement best describes  the rate of change and initial value of this function

Hence, The rate of change is the starting height, and the initial value is the number of inches grown per month

To learn more on slope intercept form click:

https://brainly.com/question/9682526

#SPJ2

F(x) = x - 3√×
graph this function​

Answers

Slop1
Y intersects: (0, -square root of 3)

An electrician charges a rate of $60 per hour plus a fee of $35 per job. Which expression represents the electrician's hourly rate?

60 + 35h

Answers

The hourly rate is 60, so multiply 60 by the number of hours (h) and add the fee:

Answer: 60h + 35

What is the proper order of function of 2+5(8-5)

Answers

Answer:

17

Step-by-step explanation:

2+5×3

2+15

17

7x+3y=m, solve for y

Answers

Y= (m-7x)/3

We need to subtract 7x on both sides
Then divide the entire thing by 3

What is the answer I’m so stuck on this one

Answers

the answer is B

P/s : i use my calculator

ok done. Thank to me :>

Option A is the answer

d = 10.2 ft, r = 0.5 ft/h​

Answers

Answer:

20.4

Step-by-step explanation:

If you are using D = r × t

                         10.2 = 0.5(t)

                          10.2/0.5 = t

                           20.4 = t

Answer:

20.4

Step-by-step explanation:

reposting this again because the first time didn’t work (please help!)

Answers

Answer:

I still can't open the file or I can't see it

Step-by-step explanation:

To find the equation of a regression line, ý = ax + b, you need these formulas:
8=13
--
b= y - az
S
A regression line has a slope of 2.334. If the mean of the x-coordinates of the
data points is 6.607, and the mean of the y-coordinates is 10.738, what is the
y-value of the y-intercept of the line to three decimal places?
A. -18.455
B. -4.683
C. 4.683
D. 18.455

Answers

Answer:-4.683

Step-by-step explanation:

Took the test

What is the simplified form of the expression? 7r - 8r + 13 -2r + 5? Please help me

Answers

Answer:

- 3r + 18

Step-by-step explanation:

7r - 8r - 2r + 13 + 5 = 7r - 10r + 18

Identify this function
f (x) =x

Answers

Answer:

linear

Step-by-step explanation:

PLEASE HELP WITH THIS ONE QUESTION

Answers

Answer:

(x-1) (x-4) is the answer

Other Questions
What is the Definition of Tenure? An equilateral triangle and a rectangle have the same perimeter. How do you find the side lengths of the equilateral triangle and the rectangle? Which sentence from the speech best supports the answer in Part A? *A. Solemn renunciation of violence (not only with respect to means of mass destruction) is undoubtedly necessary.B. The armament race between the U.S.A. and the U.S.S.R., originally supposed to be a preventive measure, assumes hysterical character.C. Even a declaration of the nations to collaborate loyally in the realization of such a "restricted world government" would considerably reduce the imminent danger of war. D. The idea of achieving security through national armament is, at the present state of military technique, a disastrous illusion. Which of the following planned a survey of the Western lands and proposed a plan to sell portions of land to raise revenue?A. Treaty of ParisB. Land Ordinance of 1785C. Articles of ConfederationD. Northwest Ordinance of 1787 **PLEASE ANSWER OMG LITERALLY EVERY TIME I TRY POSTING A QUESTION NO ONE EVER ANSWERS** The rectangle below is dilated by a scale factor of 3/2. Find the area of the dilated rectangle. On the following set of axes, create the graph of a function f (x) with the following characteristics:Passes through the points,(-8,0), (5,-2) and (8,3) Tissue between bones that acts as a cushion and allows for smooth mvoement.Question 5 options:cartilageskeletal musclessmooth musclesjoints Socialization is a method of cultural _ S dng php tnh mnh (cc lut logic) chng minh cc biu thc sau l hngng:[p -> (q r)] ->[(p -> q) (p ->r)] Simplify the expression.x - 9 - 5x+7 - 2y The ________ value of a bond, also called the face amount or face value, is paid at a stated future date, known as the bond's maturity date. Multiple choice question. fair market value par selling price net realizable value to avoid any stereotypes associated with the term big band, duke ellington began calling his jazz band a/an __________. please help me solve this problem where is the thinnest layer of earths crust located? essay on the relationship between dance and self expression Jose dijo que se iba maana which museum was built upon excavated ancient ruins in athens? When exponential growth is graphed, the trend line created looks like what letter of the alphabet? help please A man is 32 years older than his son ten year ago he was three times as old as his son was then find the present age of each? What are the meaning of debit and credit in Principle of Account ?