Answer:
- def median(l):
- if(len(l) == 0):
- return 0
- else:
- l.sort()
- if(len(l)%2 == 0):
- index = int(len(l)/2)
- mid = (l[index-1] + l[index]) / 2
- else:
- mid = l[len(l)//2]
- return mid
-
- def mode(l):
- if(len(l)==0):
- return 0
-
- mode = max(set(l), key=l.count)
- return mode
-
- def mean(l):
- if(len(l)==0):
- return 0
- sum = 0
- for x in l:
- sum += x
- mean = sum / len(l)
- return mean
-
- lst = [5, 7, 10, 11, 12, 12, 13, 15, 25, 30, 45, 61]
- print(mean(lst))
- print(median(lst))
- print(mode(lst))
Explanation:
Firstly, we create a median function (Line 1). This function will check if the the length of list is zero and also if it is an even number. If the length is zero (empty list), it return zero (Line 2-3). If it is an even number, it will calculate the median by summing up two middle index values and divide them by two (Line 6-8). Or if the length is an odd, it will simply take the middle index value and return it as output (Line 9-10).
In mode function, after checking the length of list, we use the max function to estimate the maximum count of the item in list (Line 17) and use it as mode.
In mean function, after checking the length of list, we create a sum variable and then use a loop to add the item of list to sum (Line 23-25). After the loop, divide sum by the length of list to get the mean (Line 26).
In the main program, we test the three functions using a sample list and we shall get
20.5
12.5
12
Answer:
the hurts my brain sorry bud cant help
Explanation:
120 volt divided by 22 ampere
= 5.4545454545455 ohm (Ω)
P = V × I
= 120 volt × 22 ampere
= 2640 watt (W)
Answer:
True
Explanation:
Tensile testing which is also referred to as tension testing is a process which materials are subjected to so as to know how well it can be stretched before it reaches breaking point. Hence, the statement in the question is true
Answer
given,
a = 2 t - 10
velocity function
we know,
![\dfrac{dv}{dt}=a](https://tex.z-dn.net/?f=%5Cdfrac%7Bdv%7D%7Bdt%7D%3Da)
![\dfrac{dv}{dt}=(2t-10)](https://tex.z-dn.net/?f=%5Cdfrac%7Bdv%7D%7Bdt%7D%3D%282t-10%29)
integrating both side
![\int dv =\int (2t -10) dt](https://tex.z-dn.net/?f=%5Cint%20dv%20%3D%5Cint%20%282t%20-10%29%20dt)
v = t² - 10 t + C
at t = 0 v = 3
so, 3 = 0 - 0 + C
C = 3
Velocity function is equal to v = t² - 10 t + 3
Again we know,
![\dfrac{dx}{dt}=v](https://tex.z-dn.net/?f=%5Cdfrac%7Bdx%7D%7Bdt%7D%3Dv)
![\dfrac{dx}{dt}=(t^2-10t + 3)](https://tex.z-dn.net/?f=%5Cdfrac%7Bdx%7D%7Bdt%7D%3D%28t%5E2-10t%20%2B%203%29)
integrating both side
![\int dx =\int (t^2-10t + 3)dt](https://tex.z-dn.net/?f=%5Cint%20dx%20%3D%5Cint%20%28t%5E2-10t%20%2B%203%29dt)
![x = \dfrac{t^3}{3}- 10\dfrac{t^2}{2} + 3 t + C](https://tex.z-dn.net/?f=x%20%3D%20%5Cdfrac%7Bt%5E3%7D%7B3%7D-%2010%5Cdfrac%7Bt%5E2%7D%7B2%7D%20%2B%203%20t%20%2B%20C)
now, at t= 0 s = -4
![-4 = \dfrac{0^3}{3}- 10\dfrac{0^2}{2} + 0 + C](https://tex.z-dn.net/?f=-4%20%3D%20%5Cdfrac%7B0%5E3%7D%7B3%7D-%2010%5Cdfrac%7B0%5E2%7D%7B2%7D%20%2B%200%20%2B%20C)
C = -4
So,
![x = \dfrac{t^3}{3}- 10\dfrac{t^2}{2} + 3 t-4](https://tex.z-dn.net/?f=x%20%3D%20%5Cdfrac%7Bt%5E3%7D%7B3%7D-%2010%5Cdfrac%7Bt%5E2%7D%7B2%7D%20%2B%203%20t-4)
Position function is equal to ![x = \dfrac{t^3}{3}- 10\dfrac{t^2}{2} + 3 t-4](https://tex.z-dn.net/?f=x%20%3D%20%5Cdfrac%7Bt%5E3%7D%7B3%7D-%2010%5Cdfrac%7Bt%5E2%7D%7B2%7D%20%2B%203%20t-4)