Answer:
<em>Written in Python</em>
def SumN(n):
total = 0
for i in range(1,n+1):
total = total + i
print("Total: ",total)
def SumNCubes(n):
total = 0
for i in range(1,n+1):
total = total + i**3
print("Cube: ",total)
n = int(input("User Input: "))
if n > 0:
SumN(n)
SumNCubes(n)
Explanation:
The SumN function is defined here
def SumN(n):
This line initializes the total to 0
total = 0
The following iteration compute the required sum
<em> for i in range(1,n+1):
</em>
<em> total = total + i
</em>
This line outputs the calculated sum
print("Total: ",total)
The SumNCubes function is defined here
def SumNCubes(n):
This line initializes the total to 0
total = 0
The following iteration compute the required sum of cubes
<em> for i in range(1,n+1):
</em>
<em> total = total + i**3
</em>
This line outputs the calculated sum of cubes
print("Cube: ",total)
The main starts here; The first line prompts user for input
n = int(input("User Input: "))
The next line checks if input is greater than 0; If yes, the two defined functions are called
if n > 0:
SumN(n)
SumNCubes(n)
Answer:
![\left[\begin{array}{ccccc}&DF&SS&MS&F\\Regression&1&7200&7200&72\\Error&18&1800&100\\total&19&900\end{array}\right]](https://tex.z-dn.net/?f=%5Cleft%5B%5Cbegin%7Barray%7D%7Bccccc%7D%26DF%26SS%26MS%26F%5C%5CRegression%261%267200%267200%2672%5C%5CError%2618%261800%26100%5C%5Ctotal%2619%26900%5Cend%7Barray%7D%5Cright%5D)
Explanation:
Sample size, n=20
Degrees of freedom is 1
Number of degrees of freedom for error is n-2 hence 20-2=18
Total number of degrees of freedom is 18+1=19
Standard error estimate is
Here,
Coefficient of determination
Here,
The total sum of squares is
SS total=SSR+SSE=7200+1800=9000
MSR=SSR=7200
F value is given by
The ANOVA table is then
Answer:
Technician be says that diesel engines produce more power because they use excess air to burn feel who is correct
Explanation:
He is correct as many engines are run by diesel. It produces more power as that is how cars produce more power.