Answer:
The answer of the the following question are 0(n^2)
The total number of multiplication is 2
And the total number of addition is 1
Explanation:
Let the size of the input is the degree of the polynomial = "n"
Than the number of the multiplications depends on "n"
Let the number of multiplication = M(n)
Let the number of addition = A(n)
1): Solution-
M(n) = n∑_{i=0} i∑_{j=1} 2
= 2 n∑_{i=0} i∑_{j=1}
= 2 n∑_{i=0} i-1+1
= 2 n∑_{i=0} i
= 2 * n*(n+1)/2 = n*(n+1)
= n^2 + n ∈ 0(n^2)
2): Solution for addition-
A(n) = n∑_{i=0} i∑_{j=1} 1
= by solving this from the same way it leads to
= n^2 + n and n^2 + n ∈ 0(n^2)
Answer:
The solution code is written in Python 3.
- import random
-
- count = 0
- flag = False
- guess = int(input("Input your guess (2-12): "))
-
- while(count <=3):
- dice1 = random.randint(1, 7)
- dice2 = random.randint(1, 7)
-
- if((dice1 + dice2) == guess):
- flag = True
-
- count += 1
-
-
- if(flag):
- print("User wins!")
- else:
- print("Computer wins!")
Explanation:
A Random generator is needed for this question and therefore we start by importing Python random class (Line 1)
Next, create one counter variable,<em> count</em>, to ensure there will be only three rolling of the dices (Line 3). We need another variable, <em>flag</em>, to track the status if the two dices equal to the <em>guess</em> number chosen by user (Line 4).
Next, prompt use to input a guess number (Line 5).
Within the while loop, we can use random class method <em>randint() to </em>generate random integer. The arguments 1 and 7 will give one random number ranged from 1 to 6 for <em>dice1</em> and<em> dice2</em>, respectively (Line 8 - 9).
If the total of<em> dice1 + dice2</em> equal to user <em>guess</em>, we turn the<em> flag </em>to <em>True</em>. If not, the <em>flag </em>will remain <em>False</em> after completing entire while loop.
If the <em>flag </em>turned to <em>True</em>, print the message "User Wins!" else print the message ("Computer wins!")
I believe that the answer to the question provided above is that with the age of improving technology, the aspects of future games will be based more unto electronic games or e-games.
Hope my answer would be a great help for you. If you have more questions feel free to ask here at Brainly.
Answer:
Explanation:
E-learning saves time and money. With online learning, your learners can access content anywhere and anytime. ...
E-learning leads to better retention. ...
E-learning is consistent. ...
E-learning is scalable. ...
E-learning offers personalization.
An outline is going to be the best answer