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]
3 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]3 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
If an angle of 11pi/30 radian is in standard position. What is the reference angle in radian?
bixtya [17]

Answer:

\frac{11\pi}{30}

Step-by-step explanation:

The reference angle is an acute angle that angle in standard position makes with the positive x-axis.

The given angle in radians is

\frac{11\pi}{30}

This angle is already acute and hence it is itself a reference angle.

The reference angle of any angle in the first quadrant is the same angle.

4 0
3 years ago
T-SHIRTS You can buy 3 T-shirts for $24. Write a proportion that gives the cost
GrogVix [38]

7:56

Figure out what 7/3 is so you can multiply 24 by that number. Is is 2 1/3 so when you multiply 2 1/3 by 24 it gets you to 56 so the proportion is 7:56

8 0
2 years ago
I need help asap. anyone?
Charra [1.4K]

Answer:

D

Step-by-step explanation:

Has the correct y-axis and has the graph going the correct way for both functions.

7 0
3 years ago
Read 2 more answers
PLS HELP ASAP!!!!!!!! 2 MORE DAYS OF SCHOOL LEFT ASAP HELP NOW!!!!!!!!!!!!!!!
Illusion [34]
I think maybe either B or C, ope I helped, sorry if I didn't!!
3 0
3 years ago
X/24 = 30/36 pls help i might know the answer but i want someone to confirm it
gavmur [86]

Answer:

Step-by-step explanation:

x/24 = 30/36 simplify

x/24 = 5/6 divide 24 by 6 is 4; multiply 4 by 5

x= 20

3 0
3 years ago
Other questions:
  • BEST ANSWER GETS BRAINLIEST!!! PLEASE HELP
    11·2 answers
  • To get to the park from her house, Rachel walked 4 kilometers due north and then 3 kilometers due west. On the way back, she cut
    11·1 answer
  • Solve 11 + 4x = 2x + 21 for x
    14·1 answer
  • What is 0.6 multiplied by 5
    5·2 answers
  • Find the value of y if given: 20y-2, 17y +3, 5x + 8, 21x
    9·1 answer
  • A student solved an equation for the unknown value of n as 0 =0. Which set represents all of the possible values of n?
    8·1 answer
  • A population of 65 foxes in a wildlife preserve triples in size every 13 years. The function y=65 x 3x, where x is the number of
    10·2 answers
  • What is the answer? ​
    11·1 answer
  • Which function is increasing?
    7·1 answer
  • Refer to the figure.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!