We have a "rectangular" double loop, meaning that both loops go to completion.
So there are 3*4=12 executions of t:=t+ij.
Assuming two operatiions per execution of the innermost loop, (i.e. ignoring the implied additions in increment of subscripts), we have 12*2=24 operations in all.
Here the number of operations (+ or *) is exactly known (=24).
Big-O estimates are used for cases with a varying scale of operations, governed by a variable (usually n) to indicate the sensitivity of the number of operations relative to a change in the size of n.
Here we do not have a scale, nor n is defined. The number of operations is constant and known at 24. So a variable is required to find the big-O estimate.
You want to use PEMDAS for this.
<em>P</em>= arenthesis ( )
<em>E</em>= xponents a²
<em>M</em>= ultiply ×
<em>D</em>= ivide ÷
<em>A</em>= dd +
<em>S</em>= ubtract -
What you want to do is go in order and ask yourself as you go.
Are there any <u><em>Parenthesis</em></u>? <em>No
</em>Are there any <u><em>Exponents</em></u><em />? <em>No</em>
Is there any <em /><u><em>Multiplication</em></u><em />? <em>Yes
</em><em />Is there any <em><u>Division</u></em>? <em>No
</em><em />Is there any <em><u>Addition</u></em>? <em>No
</em><em />Is there any <em><u>Subtraction</u></em><u />? <em>Yes</em><em>
</em><em />Thats when you stop and you multiply what you have in the PEMDAS. Top to bottom. 3x5 which gives you 15. Now you equation is 45-15. Thats when you subtract and you get your answer which is 30.
Captain has $30 money
Flame has $20 +$5 =$25
difference =30-25=5
Captain has $5 more money
Answer:
There are 60 activity booklets in the media lab.
Step-by-step explanation:
- 30/2 = 15
Why divide those numbers?
For every 2 computers in a lab with 30 computers means you have to divide
- 15x4 = 60
Why multiply those numbers?
4 activity booklets for every 2 computers in a lab of 30 computers, so multiply
I hope this helps.