A basket has 12 marigolds and 8 carnations. if we had picked two flowers one by one with replacement, find the probability of getting a marigold and a carnation.
An automobile traveling at the rate of 20 m/s is approaching an intersection. When the automobile is 100 meters from the intersection, a truck traveling at the rate of 40 m/s crosses the intersection. The automobile and the truck are on perpendicular roads. How fast is the distance between the truck and the automobile changing two seconds after the truck leaves the intersection?
On average, four students visits the Mathematics and Statistics tutoring centre during a 5-minute period.
(a) Calculate the probability that three students visit the centre during a 5 minute period. (3)
(b) During a ten-minute period, what is the probability that at least 4 students visit the centre? (5)
Given the demand for a product as Qd = 90 - 7P and the supply is given as Qs = -60 + 8P. You are told equilibrium is obtained at the point where Qd = Qs. The equilibrium price for the product is
1. Copy the countdown function from Section 5.8 of your textbook.
def countdown(n):
if n <= 0:
print('Blastoff!')
else:
print(n)
countdown(n-1)
Write a new recursive function countup that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:
>>> countup(-3)
-3
-2
-1
Blastoff!
Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)
If the number is positive, the program should call countdown. If the number is negative, the program should call countup. Choose for yourself which function to call (countdown or countup) for input of zero.
Provide the following.
The code of your program.
Output for the following input: a positive number, a negative number, and zero.
An explanation of your choice for what to call for input of zero.
The mean water consumption of 10 students in a week is 28 liters with a standard deviation of 1.6 liters. Consider 95% confidence level, the upper limit is
A car of mass 1250 kg drives around a curve with a speed of 22 m/s.
a. If the radius of the curve is 35 m, what is the centripetal acceleration of the car? (3 points)
b. The maximum friction that the car's tires can apply is 20,000 N. What is the radius of the smallest circle the car can drive in at a speed of 22 m/s? (3 points)
d = 26 - 8P and the supply is given as Qs = -16 + 6P. You are told equilibrium is obtained at the point where Qd = Qs. The equilibrium quantity for the product is
If I add 65 grams of calcium chloride to 500 grams of water, what will the boiling
points be of the resulting solution? Kb = 0.512 °C.
Happy Numbers: A number is called a happy number, if you start with the given number
and arrive at 1 by repeating the following process (as illustrated in the below example):
(a) compute the sum of the squares of given number digits
(b) if the resultant value is 1, then the number is happy number, else execute point (a) for
the newly produced number.
Note that if a number is not a happy number, there will be an endless loop to this execution.
Goal: In this question, you are required to write a recursive function that checks whether
the number entered by the user is a happy number or not for 10 cycles/iterations only. The
output shown in blue colour should be shown by the function and text in yellow colour
should be displayed by the main function.