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
Lelechka [254]
3 years ago
15

A. Consider the following algorithm segment: for i := 1 to 4, for j := 1 to i, [Statements in body of inner loop. None contain b

ranching statements that lead outside the loop.] next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
b. Let n be a positive integer, and consider the following algorithm segment: for i := 1 to n, for j := 1 to i, [Statements in body of inner loop. None contain branching statements that lead outside the loop.], next j, next i. How many times will the inner loop be iterated when the algorithm is implemented and run?
Mathematics
1 answer:
yuradex [85]3 years ago
6 0

Answer:

(a) 4i times

(b) "i × n" times

Step-by-step explanation:

(a) Given the algorithm segment;

       for i := 1 to 4,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

       next i

The inner loop runs for i times, while the outer loop runs for 4 times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × 4

      = 4i times

(b) Given the algorithm segment;

     for i := 1 to n,  (Outer loop)

            for j := 1 to i   (Inner loop)

            next j,

      next i

Where n is a set of positive integers.

The inner loop runs for "i" times, while the outer loop runs for "n" times.

The total times the inner loop would run when the entire algorithm is run is:

      = i × n

      = "i × n" times

You might be interested in
Find the axis of symmetry of the graph of y=x^2+2x-4
Ludmilka [50]
X = -1 
(-1, -5) The line is horizontal.
:) <span />
6 0
3 years ago
5w²-5w=0 . -10n²+35n=0 . 2x²+15x=0 . 18c²+6c=0 . -32y²-24y=0
love history [14]

5 {w}^{2}  - 5w = 0\Leftrightarrow 5w(w - 1) = 0\Leftrightarrow w = 0 \: \vee \: w = 1 \\  - 10 {n}^{2}  + 35n = 0\Leftrightarrow  - 5n(2n - 7) = 0\Leftrightarrow n = 0 \: \vee \: n =  \frac{7}{2}  \\ 2 {x}^{2}  + 15x = 0\Leftrightarrow x(2x + 15) = 0\Leftrightarrow x = 0 \: \vee \: x =  \frac{15}{2}  \\ 18 {c}^{2}  + 6c = 6c(3c + 1) = 0\Leftrightarrow c = 0  \: \vee \: c =  -  \frac{1}{3}  \\  - 32 {y}^{2}  - 24y = 0\Leftrightarrow  - 8y(4y + 3) = 0\Leftrightarrow y = 0 \:\vee \: y =  -  \frac{3}{4}  \\ 3 {k}^{2}  = 6k\Leftrightarrow k = 0 \: \vee \: k = 2 \\ 6 {h}^{2}  = 3h\Leftrightarrow h = 0 \: \vee \: h =  \frac{1}{2}  \\ 4 {s}^{2}  = 10s\Leftrightarrow s = 0 \: \vee \: s =  \frac{5}{2}  \\  - 42 {z}^{2}  = 14z\Leftrightarrow z = 0 \:\vee \: z =  -  \frac{1}{3}

6 0
3 years ago
12n^2+12n+9=0<br> Please solve!
Bogdan [553]

Answer:

n = (1/2)(-1 ± i√2)

Step-by-step explanation:

Among the several ways in which quadratic equations can be solved is the quadratic formula.  Putting to use the coefficients {12, 12, 9}, we obtain the discriminant, b^2 - 4ac:  12^2 - 4(12)(9) = 144 - 432 = -288.  The negative sign of this discriminant tells us that the quadratic has two unequal, complex roots.  These roots are:

      -b ± √(discriminant)

n = ---------------------------------

                 2a

Here we have:

      -12 ± √(-288)           -12 ± i√2√144          -12 ± i12√2

n = ----------------------  =  ------------------------ =  --------------------

            2(12)                             24                           24

or:

n = (1/2)(-1 ± i√2)

5 0
3 years ago
HELP!     Mr johnson needs a shelf to hold a set of textbooks, each <img src="https://tex.z-dn.net/?f=%201%5Cfrac%7B3%7D%7B4%7D%
inysia [295]
How many 1 3/4 inches are there in 35 inches?
Or in math talk:

35" ÷  1  3/4
The answer is that 20 books will fit on the shelf.
I used a calculator and used 1.75 instead of 1  3/4

  


6 0
3 years ago
What are the values of x and y?
mrs_skeptik [129]
I hope this helps. X=17 and y=5

3 0
3 years ago
Other questions:
  • How do I solve 1/3x=x-22
    5·1 answer
  • Simplify the following algebraic expressions.<br><br> -6x + 5 + 12x -6
    10·1 answer
  • There are 320 rods in a mile Find the length of a rod in feet
    10·1 answer
  • there are 150 students in the marching band, and 30 of them play the trumpet. Which number line represents the percent of the sr
    6·1 answer
  • I WILL GIVE BRAINLIEST FAST
    13·1 answer
  • 8c + c = what please help me i am doing test and need answer right now. like 4rl
    12·2 answers
  • A ___ problem is a mathematical problem dealing with the distance, rate, and time of an object traveling at a uniform rate of sp
    9·1 answer
  • What is the answer to 5x+2&lt;17
    14·2 answers
  • Of the 25 fish in a tropical fish tank, 10 are guppies, 4 are swordtails, and the rest are tetras. One fish is to be randomly se
    5·1 answer
  • What is the first step toward reconciling your checkbook register?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!