Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Friday, 3 June 2022

Determine the truth value of each of the following formulas (the universe of discourse for each statement is given in parentheses).

 Question: Determine the truth value of each of the following formulas (the universe of discourse for each statement is given in parentheses).

(a) (∀x)(x + x ≥ x). (ℝ)

(b) (∀x)(x + x ≥ x). (ℕ)

(c) (∃ x) (2x = x). (ℕ)

(d) (∃ x) (2x = x). (w)

 

Solution:

a) (∀x)(x + x ≥ x). (ℝ)

False
Counter Example: x = -2
b) (∀x)(x + x ≥ x). (ℕ)

True
c) (∃ x) (2x = x). (ℕ)

False
There is no such number
d) (∃ x) (2x = x). (w)

True
Example: x = 0 and 2x = 0 

Sunday, 28 March 2021

One cup holds 8 ounces. If a cup is 2/5 full, how many ounces are in the cup?

 Question: One cup holds 8 ounces. If a cup is 2/5 full, how many ounces are in the cup? 

Solution: One cup can hold 8 ounces.
A cup is 2/5 full
The number of ounces in the cup = 8x2/5
= 16/5
=3.2 ounces
3.2 ounces are there in the 2/5 full cup.

450,000,000 cups of coffee and consumed everyday in the united states.

 Question: 450,000,000 cups of coffee and consumed everyday in the united states assume there are 8. ounces of coffee in a cup and 128 ounces in a gallon how many gallons are consumed in one year. 

Solution: Everyday they consumed 450000000 cups of coffee in US.

8 ounces of coffee in cup. And 128 ounces in gallon. Then the total number of cups of coffee in a gallon is :-

128/8 = 16 cups
Then the everyday consumed coffee in gallons is:-
450000000/16 = 28125000 gallons in a day
Then total number of gallons consumed in a year:-
28125000 x 365 = 10,265,625,000 Gallons in a year

Friday, 7 July 2017

Difference between Math.Floor() and Math.Truncate()

Question: What is the difference between Math.Floor() and Math.Truncate() in .NET?

Solution:

math.floor()
Returns the largest integer less than or equal to the specified number.

math.truncate()
Calculates the integral part of a number.

Example with outputs


Math.Floor(2.56) = 2
Math.Floor(3.22) = 3
Math.Floor(-2.56) = -3
Math.Floor(-3.26) = -4

Math.Truncate(2.56) = 2
Math.Truncate(2.00) = 2
Math.Truncate(1.20) = 1
Math.Truncate(-3.26) = -3
Math.Truncate(-3.96) = -3