1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mote1985 [20]
2 years ago
9

Using pseudo-code, describe a recursive algorithm to find n! mod m, when m, n ? Z+.

Mathematics
1 answer:
Nadya [2.5K]2 years ago
3 0

Explanation:

A recursive algorithm has a terminating condition and a recursive rule.

The function "facMod" will terminate with an output of 0 if m ≤ n, because m would be a factor of n!. It will terminate with an output of 1 if n < 2.

Otherwise, it is the product mod m of n and the "facMod" of n-1.

  • facMod(m, n) : = If( m ≤ n, 0, If( n < 2, 1, Mod(n*facMod(m, n-1), m)))

__

In this code, the If(a, b, c) statement returns b for a=true, otherwise it returns c. The Mod(a, b) statement returns a modulo b.

You might be interested in
taki has her back to a wall. she starts to walk straight forward. she stops and turns 133° to the right and walks back in this d
Nikitich [7]
I'd like to assume that the triangle is a right triangle and you solve for x so...

133 + c = 180   (supplementary property to find one angle of triangle)
          c = 47

x = 180 - 90 - 47 (int. angles of triangle = 180)
   = 90 - 47
   = 43

Therefore, x is 43 degrees
6 0
3 years ago
A zombie apocalypse follows a/an ___________ pattern.Immersive Reader
MariettaO [177]

Answer:

B. Quadratic​​​​​​​​​​

8 0
2 years ago
N a? triangle, the measure of the first angle is twicetwice the measure of the second angle. the measure of the third angle is 1
Mrac [35]
Skip work! get some booty! don't care about skool
3 0
3 years ago
For the function defined by y = 1/x4, y varies inversely as what quantity
gregori [183]

ANSWER

y varies inversely as x exponent 4.

EXPLANATION

The inverse variation equation is given as:

y =  \frac{1}{ {x}^{4} }

We can see that there is an inverse relation between the quantity y and x.

If the it were y =  \frac{1}{ {x}^2 }, we say y varies inversely as the square of x.

Hence for the given relation,the precise definition is that, y varies inversely as x exponent 4.

6 0
2 years ago
Evaluate 4(x+3)(x+1)/(x+5)(x-5) for x =3. A. 3/2 B. -6 C. 6 D. -3/2
sergey [27]

Answer:

-6

Step-by-step explanation:

Reduce the expression by cancelling common factors

5 0
2 years ago
Other questions:
  • The variable z is inversely proportional to x. When x is 16, z has the value 0.9375. What is the value of z when x= 26?
    13·1 answer
  • A deli charges the same price, $5.40, for all of its different sandwiches. If a company ordered n sandwiches for a luncheon, whi
    11·1 answer
  • Can some help me, please? ​
    11·1 answer
  • Weighing about a ton on their 14th birthday, the average T-Rex grew 4.6 pounds per day from the age 14 to 18 years! Write a form
    6·1 answer
  • If bacteria took 20 minutes to double from 2 to 4, how many bacteria would there be after 1 hour
    8·2 answers
  • Tell whether the equation has one, zero, or infinitely many solutions 8(x – 5) + 36 = 7x – 2​
    15·2 answers
  • Order 4/5, 1/4, 6/8, 5/9 from least to greatest
    9·2 answers
  • What is the measure of each angle if x = 13?
    11·1 answer
  • What is the point and the slope in the equation y-3=7(x+5)
    6·2 answers
  • Find the values of x that make m parallel to n.<br> Please help!!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!