Writing Fibonacci Series in Python using if else statement and for loop
Example:1
Writing Fibonacci Series in Python using if else statement and for loop
Example:1
Writing Star Pyramid Program using Function in Python
Example:
Checking whether given word or sequence of number is palindrome
Example 1
Finding all the possible factors of an integer in Python
Example
Finding a number is prime or not in python
Example1
Finding even and odd numbers using while loop in Python
Example 1
Example 2
Finding odd and even numbers in a specified list
The function models the population of rabbits on a farm after with no removal. The function models the number of rabbits removed from the population after . Which function, , models the total number of rabbits on the farm after ?
Solution
f(x) = h(x) + g(x)
that is,
Total models population of rabbits with NO removal = models of rabbits removed from the population after x months + Total number of rabbits on the farm after x months
Let's substitute the given values in the above equation
Hence answer is h(x) = 2(2.0)^x
A man bought x boxes of doughnuts for $3.49 each, he paid with a $50 bill and received the correct amount of change. If he received more than $10 but less than $20, which inequalities represent the number of boxes of doughnuts he could have bought?
A pilot flew from airport A to airport B at a rate of 100 km/hr and flew
back from airport B to airport A at 120 km/hr. The total time it took wasSet up and solve the proportions
The park ranger stocks the children's fishing pond, keeping a ratio of 4 sunfish to 3 perch. If he puts 300 sunfish into the pond, how many perch should be put into the pond?
Solution
given, 4Sunfish to 3 perch
that is 4/3
we have to find 300 Sunfish to how many perch (x)
since its a ratio, we can equate those two
Hence he should put 225perch into the pond
We can translate word problems into equations to solve
1. Find two consecutive integers whose sum is 45
Solution
let us assume one of the integer is x
since its two consecutive integers, the second integer must be x+1
also given, their sum is 45
that is x + (x+1) = 45
2x + 1 =45
2x = 45 -1 =44
2x =44
x = 44/2
x =22
one of the integer is 22
next integer is 22+1 = 23
let check whether if we add these two integers we will be getting 45
22+23 = 45
hence the two consecutive integers are 22 and 23
Water is being pumped into a 10-foot-tall cylindrical tank at a constant rate.
What will the depth (in feet) of the water be at 5:00 pm?
Solution
First lets write the given statement in points ( time, water depth in feet)
Given,
At 1:30pm, the water depth was 2.4 feet
which means (1.5 , 2.4 )
[ 1.30 pm which means 1 1/2 so, we are writing it as 1.5]
also given,
It is now 4:00pm and the depth of the water is 3.9 feet.
that is ( 4 , 3.9 )
Now we got two points (x1,y1) = (1.5,2.4)
(x2,y2) = (4,3.9)
Slope (m)= y2 - y1 / x2 - x1
= 3.9 - 2.4 / 4 - 1.5
= 1.5 / 2.5
m = 0.60
Every hour water level increases 0.60 feet
we have to find the depth (in feet) of the water be at 5:00 pm
we found m=0.60
lets take one of the given point (1.5,2.4) (x1,y1)
we have to find y when x=5(5pm)
y - y1 = m(x-x1)
y - 2.4 = 0.60(5-1.5)
y - 2.4 = 0.60(3.5)
y-2.4 = 2.1
y = 2.4 + 2.1
= 4.5 feet
Hence the depth (in feet) of the water be at 5:00 pm is 4.5ft
John mixed cashews and almonds.
John bought 4 pounds of almonds for a total of $22
The cost per pound for cashews is 60% more than the cost per pound for almonds.
John bought enough cashews that, when he mixed them with the almonds, the mixture had a value of $6.50 per pound.
What percent of the mixture, by weight, were cashews?
a) 20% b) 25% c) 30% d) 35%
Answer
Given
4 Pounds of almonds cost = $22
1 Pound of almonds cost = 22/4 = $5.50
Also given,
The cost per pound for cashews is 60% more than the cost per pound for almonds
which implies
1 pound of Cashews = 60% of 1pound almonds + cost of 1pound almonds
= 60% of 5.50 + 5.50
= 0.60 * 5.50 + 5.50
= 3.3 + 5.50
= $ 8.80
the mixture had a value of $6.50 per pound.
that is, 5.50 almonds + 8.80 Cashews = 6.50
Now, let's take each option one by one and substitute that in the above equation
a) if cashew is 20% then almond must be 80%
5.50 * 80% + 8.80*20% = 6.50
5.50 * 0.8 + 8.80 * 0.2 = 6.50
4.4 + 1.76 = 6.50
6.16 = 6.50 ( Not True )
let's move on to option b) if cashew is 25% then almond must be 75%
5.50 * 75% + 8.80*25% = 6.50
5.50 * 0.75 + 8.80 * 0.25 = 6.50
4.125 + 2.2 = 6.50
6.325 = 6.50 ( Not True )
let's move on to option c) if cashew is 30% then almond must be 70%
5.50 * 70% + 8.80*30% = 6.50
5.50 * 0.70 + 8.80 * 0.30 = 6.50
3.85 + 2.64 = 6.50
6.49 = 6.50 ( which is very close)
let's move on to option d) if cashew is 35% then almond must be 65%
5.50 * 65% + 8.80*35% = 6.50
5.50 * 0.65 + 8.80 * 0.35 = 6.50
3.575 + 3.08 = 6.50
6.655 = 6.50 ( Close but option is more close than this )
Hence the answer is option c) 30%