An alternative strategy for the expo function uses the following recursive definition: expo(number, exponent) = 1, when exponent = 0 = number * expo(number, exponent – 1), when exponent is odd = (expo(number, exponent // 2)) ** 2, when exponent is even Define a recursive function expo that uses this strategy, and state its computational complexity using big O notation.

Answers

Answer 1

Answer:

The recursive function in Python is as follows

def expo(nmber, exponent):

   power = exponent

   if power == 0:

       return 1

   if power %2 == 1:

       power = power - 1

       return nmber * expo(nmber, power)

   else:

       power = power/2

       return expo(nmber, power) ** 2

The time complexity is O(log(n))

Step-by-step explanation:

See attachment for complete program where comments are used for explanation.

The Time Complexity

The function is then called power - 1 times for odd exponents or power/2 times for even exponents before it reaches the base case.

As the exponent is divided by 2, for even exponents; it means that the function tends to log(n). log(n), in this case represents the base case.

Since the function is repeated, then the time complexity is: O(log(n))


Related Questions

When a power is raised to a power we ______the exponents

Answers

Answer:

Multiply

Step-by-step explanation:

If the answer is correct you get brainly

Answers

Answer:

the answer is 2,800.

Step-by-step explanation:

5x5x2x7x8=2,800.


Chris is taking 50 pounds of old newspapers to the recycling center. He makes
8 bundles of equal weight. What is a good estimate of the weight of each
bundle?

Answers

Answer:

Just over 6 pounds each

Step-by-step explanation:

or exactly 6.25 pounds each

[tex]\huge{\textbf{\textsf{{\color{pink}{An}}{\red{sw}}{\orange{er}} {\color{yellow}{:}}}}}[/tex]

The estimate weight of each bundle is 6 pounds.

exactly it's 6.25 (bcoz 50 ÷ 8 is 6.25)

thanks hope it helps

ames, Sarah, and Danielle are all planting in a community garden. If each of their plots holds 7 rows and 13 columns, how many plants will they be able to grow all together?

Answers

Answer:

dude this is easy

Step-by-step explanation:

all you have to do is multiply; 7x13

in this case it equals 91.

=91

How many significant figures does 0.396 have?

Answers

Answer:

4

Step-by-step explanation:

0 is a significant figure and since there are no 0 in the number after the decimal point its 4 significant figures

3 because of the amount of numbers after the decimal point

Can someone help me with this? Thank you so much! I mark as brainliest :)

Answers

9514 1404 393

Answer:

x = 9y = 45z = 9 root 2

Step-by-step explanation:

In this isosceles right triangle, the acute angles are equal and the side lengths have the ratios 1 : 1 : √2

  y° = 90° -45° = 45°

  9 : x : z = 1 : 1 : √2 = 9 : 9 : 9√2

  x = 9; z = 9√2

All of the following should be considered when designing a study except __________. A. the type of research method to use B. how to interpret collected data C. who the participants will be D. the type of measurement to use Please select the best answer from the choices provided A B C D

Answers

Answer:

b. How to interpret collected data.

Step-by-step explanation:

Answer:

All of the following should be considered when designing a study except __________.

( A.)  the type of research method to use

( B.)  how to interpret collected data (ANSWER)

( C.)  who the participants will be

( D.)  the type of measurement to use

six more than the product of a number and 7 is equal to 8 translate the sentence into an equation

Answers

Answer:

6+ x 7=8

Step-by-step explanation:

6 more product of a number and it equals 8

First step to solve this equation 5k+6=-9

Answers

Answer:

Subtract 6 from both sides of this equation.

Step-by-step explanation:

Answer:

subtract 6 from both sides of the equation.

What is 397 lb equal to in pounds and ounces

Answers

6352 oz is the answerrrr

Expand and simplify (2x - 3)(3x -5)​

Answers

Answer:

Step-by-step explanation:

Bonjour,

2x*3x =6x²

2x* -5 = -10x

-3 * 3x = -9x

-3*-5 = 15

=>

6x² -10x  - 9x +15 = 6x ² -19x  +15

Answer:

6x^2 - 19x + 15.

Step-by-step explanation:

(2x - 3)(3x -5)​

= 2x(3x - 5) - 3(3x - 5)

= 6x^2 - 10x - 9x + 15

= 6x^2 - 19x + 15.

Find mDF
Please help!!

Answers

9514 1404 393

Answer:

  72°

Step-by-step explanation:

The external angle E is half the difference of the intercepted arcs.

  44° = (CD -DF)/2

  88° = CD -DF

  DF = CD -88° = 160° -88° = 72°

Find the value of x in the triangle shown below

Answers

Answer:

A or 53 squared

Step-by-step explanation:

A or 53 squared is the answer

Can someone help ASAP

Answers

Answer:

There's only one answer, and that's x=0.

Step-by-step explanation:

Step 1: Simplify both sides of the equation.

3(3x−1)=6x−3

(3)(3x)+(3)(−1)=6x+−3(Distribute)

9x+−3=6x+−3

9x−3=6x−3

Step 2: Subtract 6x from both sides.

9x−3−6x=6x−3−6x

3x−3=−3

Step 3: Add 3 to both sides.

3x−3+3=−3+3

3x=0

Step 4: Divide both sides by 3.  

[tex]\frac{3x}{3}[/tex]=[tex]\frac{0}{3}[/tex]

x=0

hope this helps

Using the perimeter formula of a rectangle, P = 21+2w, find the perimeter of the rectangle giver
the length is 42 feet and the width is 26 feet
I

Answers

Answer:

-21

Step-by-step explanation:

the formula for the perimeter of a rectangle is 2l+2w. which means twice the length and twice the width added to together.

if you mean this:

x=21+2x

minus x on both sides

0=21-x

add 21 on both sides

21=-x

x=-21

than you subsitute

2×-21=-42

-42+21= -21

The perimeter is than -21

Answer:

-21

Step-by-step explanation:

the formula for the perimeter of a rectangle is 2l+2w. which means twice the length and twice the width added to together.

if you mean this:

x=21+2x

minus x on both sides

0=21-x

add 21 on both sides

21=-x

x=-21

than you subsitute

2×-21=-42

-42+21= -21

The perimeter is than -21

f(x)=- square root x-2. +3

Answers

Answer:

Hi, The.

The domain of a function is the set of all possible values for x. The range is all possible values for y.

You should be able to see these pretty easily from the graph. If I understand your function correctly:

f(x) = square root(x+2) - 3

then x cannot be less than -2. Your domain is x > -2. In interval notation [-2,∞)

The lowest value for y is -3 so the range is y > -3. In interval notation [-3,∞)

Hope this helps!

Plz help me fast!!! Plzzzz

Answers

Step-by-step explanation:

tan = opp/adj

tan B = x/y

hope this helps

is 1/3 a rational number?
can rational numbers be negative

Answers

1/3 is a rational number and rational number’s can be negative. explanation: a rational number is any number, positive or negative, that can be written as a fraction

Describe the transformation of f(x) = sin x to g(x) = sin (x-pi/4)

Answers

Answer:

A

Step-by-step explanation:

AP EX

The transformation of f(x)=sin(x) to g(x)=sin(x-π/4), means that the function f(x) is shifted to the right by (π/4) units.

What is a Function?

A function assigns the value of each element of one set to the other specific element of another set.

The transformation of f(x)=sin(x) to g(x)=sin(x-π/4), means that the function f(x) is shifted to the right by (π/4) units.

Learn more about Function:

https://brainly.com/question/5245372

#SPJ2

Macy washed her dirty clothes over the weekend. She used 1 1/3 scoops of detergent for her white load and 9/12 of a scoop for her color load. How much more laundry detergent did she use in the white load?

Answers

Im pretty sure she used 7/12 more!

g Farmer Violet wants to enclose one 990 square foot rectangular area of land using fencing. One side will use special fencing costing $12 per foot. The remaining three sides of fencing will be formed using standard fencing costing $10 per foot. Find the dimensions of the corral that would minimize the cost of the fencing required for this project, rounded (if necessary) to the nearest hundredth of a foot

Answers

Answer:

Sides of the rectangular area:

x =  30  f

y =  33  f

Step-by-step explanation:

Let´s call   x  and y the sides of the rectangular area

A = x*y  = 990          y  = 990/x

The function cost is:

C = Costs ( sides x)  + costs ( sides y )

Cost of sides x    =  12*x +  10x

Cost of sides y    =  10*y  +  10 *y   =  2*10*y  = 20*y

C = 12*x + 10*x + 20*y =  22*x  + 20*y

The function cost as function of x is:

C(x)  = 22*x + 20*(990/y)  =  22*x  +  19800/x

Tacking derivative on both sides of the equation:

C´(x)  = 22  + [ - 19800/x²]

C´(x) = 0       22  - 19800/x²  =  0

Solving for x

22*x²  - 19800  =  0

22x²  =  19800

x² =  19800/22 =  900

x₁,₂ = ± 30        We dismiss negative root ( we never have negative lenghts)

Then     x =  30 f

And  y  =  990 / 30      y  = 33  

To see if x = 30 is a minimum for function C(x) we evaluate the second derivative.

C´´(x) = 2*x* 19800/x⁴      

C´´ (x) = 39600/x³    so C´´ is always greater than 0 then C (x) has a minimum at x = 30

Sides of the rectangular area are:

x  =  30

y  =  33

Please answer this question

Answers

Answer:

1. 40 2. t/5 = d

Step-by-step explanation:

Every five minutes he travels 1 mile

200/5 = 40

After 200 minutes he travels 40 miles

t/5 = d

5=d......................

5. State the slope and y-intercept of the line 2x + y + 1 = 0.​

Answers

Answer:

2x+y+1=0

Step-by-step explanation:

this is a first degree equation with two unknown variables, x and y. they are referred to as linear equation and are typically represented in slope intercepts form, y=mx+b, where m is the slope of the line and b is the y intercept. So you want to set the equation equal to y by isolating it to one side of the equation.

Subtract all term other than y (in this case, 2x and 1) from both sides of the equation.

2x+y+1-2x-1=0-2x-1

y=-2x-1

Answer:

M=-2 & C=-1

Step-by-step explanation:

2x+y+1=0

The equation of a straight line is given as

y=mx+c

where, m is the gradient slope

c is y- intercept

from the equation 2x+y+1=0

make y subject of the formula

2x+y+1=0

y= -2x-1

Therefore, Slope (M)=-2 & y-intercept (c)=-1

When y= 35 , x= 2 1/2 . If the value of y varies directly with x, what is the value of y when the value of x is 3 1/4?

A. 113 3/4
B. 26 12/13
C. 227 1/2
D. 45 1/2

Answers

Answer:

D

Step-by-step explanation:

y is directly proportional with x with a constant value.

The constant value =y ÷ x =35÷2.5 =14

y=14x

y=14×3.25=45.5

I need help this is due today

Answers

Answer:

here ya go girly

Step-by-step explanation:

I hope it goes well and I hope u get the grade u want :)

Answer:

14.373 inc.sq

Step-by-step explanation:

Here's your solution

=> Area of cone = πr(r + l)

=> π = 3.14

=> radius = 1.9/2 inc

= l = 4.5 inc

=> putting value in formula

=> Area = 3.14*0.95(0.95 + 4.5)

=> Area = 2.983*5.45

=> Area of cone = 14.373 inc.sq

hope it helps

PLS HELPPP
find the volume.

Answers

Answer:

38

Step-by-step explanation:

A business suit that is regularly $250 is put on sale. They are reducing the price by
30% each day. How much will the suit be worth in 10 days?

Answers

Answer:

On the 10th day, the suit should cost around $11.38.

Step-by-step explanation:

It was a long process. Not sure if it is right because that price drop is very drastic, but these math problems are always extreme. LOL

Good Luck!!

Simplify.
1/4(16a - 4b) - (2a - b)

Answers

Answer:

2/4

Step-by-step explanation:

Answer:

2a

Step-by-step explanation:

1/4(16a - 4b) - (2a - b)

4a - b - (2a - b)

4a - b - 2a + b

2a

Paul is selling $2 raffle tickets for his baseball team. He needs to sell at
least $230 worth of tickets to earn a team jacket. If he has already sold
$50 worth of tickets, how many more raffle tickets, x, does Paul need to
sell to earn a team jacket?
a) x => 90
b) x <= 90
c) x => 180
d) x <= 180

helpppp

Answers

Answer:

answer is 90

Step-by-step explanation:

230 - 50= 180 divided by 2 =90

Plsssssss helpppppppppp

Answers

Answer: 336cm
4x6x14=336

Answer:

336cm²

Step-by-step explanation:

14×4×6=336cm²

hope this helps

plz can i get brainliest

Other Questions
Given the ordered pairs (1,8) and (2, 10), find the slope. Wood is ___. Light cannot pass through it. PLEASE HELP ME!!!!..... Solve the inequality for x.17 < x - 10Simplify your answer as much as possible. 5(x+3)+2=5x+17Solve for X Use the following information when answering the following question. In 1668, Francesco Redi performed a series of experiments on spontaneous generation. He began by putting similar pieces of meat into eight identical jars. Four jars were left open to the air, and four were sealed. He then did the same experiment with one variation: Instead of sealing four of the jars completely, he covered them with gauze (the gauze excluded the flies while allowing the meat to be exposed to air). In both experiments, he monitored the jars and recorded whether or not maggots (young flies) appeared in the meat. What hypothesis was being tested in the initial experiment with open versus sealed jars The Giver: What is sameness? Do you think it protects people from the consequences of making wrong choices by removing choice altogether? Does the lack of choice make life predictable and safe. Recently, a serious security breach occurred in your organization. An attacker was able to log in to the internal network and steal data through a VPN connection using the credentials assigned to a vice president in your organization. For security reasons, all individuals in upper management in your organization have unlisted home phone numbers and addresses. However, security camera footage from the vice president's home recorded someone rummaging through her garbage cans prior to the attack. The vice president admitted to writing her VPN login credentials on a sticky note that she subsequently threw away in her household trash. You suspect the attacker found the sticky note in the trash and used the credentials to log in to the network. You've reviewed the vice president's social media pages. You found pictures of her home posted, but you didn't notice anything in the photos that would give away her home address. She assured you that her smart phone was never misplaced prior to the attack. Which security weakness is the most likely cause of the security breach IBM stock currently sells for 64 dollars per share. The implied volatility equals 40.0. The risk-free rate of interest is 5.5 percent continuously compounded. If you shorted an option on 100 shares of IBM stock with strike price 69 and maturity 9 months, how many shares of stock would you have to buy (sell) to create a delta-neutral hedge DONT ANSWER IF YOU DON'T KNOW or I will report you, if you do know answer the question Change from present to the preterite tense: In the human body, one of the important organs is the heart. What is the function of the heart?to digest food in the bodyto remove waste from the bodyto pump blood through the body to send messages to other parts of the body Masse Corporation uses part G18 in one of its products.The company's Accounting Department reports the following costs of producing the 17,100 units of the part that are needed every year:Per UnitDirect materials $4.30Direct labor 5.00Variable overhead 8.00Supervisor's salary 8.70Depreciation of special equipment 9.30Allocated general overhead 6.30An outside supplier has offered to make the part and sell it to the company for $32.00 each.If this offer is accepted, the supervisor's salary and all of the variable costs, including direct labor, can be avoided.The special equipment used to make the part was purchased many years ago and has no salvage value or other use.The allocated general overhead represents fixed costs of the entire company.If the outside supplier's offer were accepted, only $23,100 of these allocated general overhead costs would be avoided.In addition, the space used to produce part G18 could be used to make more of one of the company's other products, generating an additional segment margin of $33,000 per year for that product.Required:1. Calculate the effect on the company's total net operating income of buying part G18 from the supplier rather than continuing to make it inside the company.2. Which alternative should the company choose?Buy or Make Suppose IQ scores were obtained from randomly selected couples. For 20 such pairs of people, the linear correlation coefficient is 0.939 and the equation of the regression line is y = -11 + 1.14x, where x represents the IQ score of the husband. Also, the 20 x values have a mean of 100.9 and the 20 y values have a mean of 100.9. What is the best predicted IQ of the wife, that the husband has an IQ of 100? Use a significance level of 0.05. The best predicted IQ of the wife is ______. (Round to two decimal places as needed.) How is a budget surplus different from a budget deficit? A budget surplus leads to an increase in the national debt; a budget deficit leads to a decrease in the national debt. A budget surplus happens when interest rates rise; a budget deficit happens when interest rates fall. A budget surplus is caused by an increase in mandatory spending at the federal level; a budget deficit is caused by an increase in discretionary spending at the federal level. A budget surplus occurs when revenues are greater than expenditures; a budget deficit occurs when expenditures are greater than revenues. describeswilteddormant111growth:: Plants change leaf hormones in response to light.:: Plants undergo transpiration:: Plants preserve their energy for growth How did slavery shape social and economic relations in the Old South? How was the North affected by this "Peculiar Institution"? Be specific Ill give you brainliest ......How did life change for eugene when the nazis occupied his country in 1944 PLEASE HELP I CANT FIGURE THESE OUT ... i put pictures AND I WILL GIVE BRAINLIEST How did some corrupt officials profit from the Catholic Church?They sold land belonging to the church and kept the profits. They charged church members a fee to own a Bible at home. They required people to pay money to receive indulgences. They kept tithes for themselves instead of sending them to Rome. Worth 20 points please answer