Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168753
Image: ubuntu2004

Have you ever tried to explain what numbers are?

Try it!  You'll find yourself confused rather quickly.

show("Do you see the number two below?"); show(2) @interact def _(answer = [None,"Yes", "No", "I don\'t know"]): if answer == 'Yes': print "No you don't.\n" print choice(["What you see is a squiggly line.", "You can only see a thing if it reflects light.\nNumbers don\'t reflect light.", "In Roman numerals this represents the number two ---> II.\nCan '2' and 'II' BOTH be the number two?", "In binary notation this represents the number two ---> 10.\nCan '2' and '10' BOTH be the number two?"]) print '\nTry again.' elif answer == 'No': print 'Correct, you do not see the number two.' print '\nWhat you see is a REPRESENTATION of the number two.' print "\n'2', 'II', '10', and 'two' are all REPRESENTATIONS of the number two." elif answer == "I don\'t know": print 'If you are not sure, good!' print '\nThe first step in philosophy is to \nbecome aware of what you do not know.'

Symbols usually do not represent themselves.

Numbers and the symbols we use to represent them are different types of things.

Mathematics is the study of the properties of numbers, shapes, and patterns.

Unfortunately, people often end up thinking that the symbols we use to represent mathematical objects are the mathematical objects themselves.  

To understand mathematics, you have to think about what the symbols MEAN.

That way you can recognize the same ideas when expressed in different symbolic forms.

The question 'What are numbers?' has no easy answer and has occupied some of the best minds in history.

One way to think about numbers is to see them as abstractions from quantities.

What is a quantity?  Well, like number, quantity is a fundamental concept.

We will define a quantity as a number of units:

def quantity(number, unit=1): return number*[unit]
quantity(3)

A quantity constructed from a number and a unit will be a list containing that number of units.

If no unit is specified, then the default unit will be 11.

To be able to say how many, you have to be able to say how many of what.

Whenever we count, we count units. We count instances of a type.

Latin quantus means how many, and quale means of what type.

You will often hear people contrast quantity vs. quality, but it is a mistake to think they somehow compete with each other.  Rather, they depend on each other.  It is impossible to have one without the other.

quantity(3, '?')
quantity(3, 2)
quantity(5, '*')
quantity(0)
quantity(0, '!')

The unit of a quantity can itself be another quantity.

quantity(3, quantity(2))
quantity(3, quantity(2, '?'))
quantity(2, quantity(3, '?'))
matrix(quantity(3, quantity(2, pi)))
matrix(quantity(2, quantity(3, pi)))

A quantity consisting of 2 quantities of three is not exactly the same thing as a quantity consisting of 3 quantities of two.

Both quantities contain the same number of simple units, so they both have the same value.

However, each has a different mathematical structure.

We will define the value of a quantity as the sum of the values of its units.

If the quantity consists of only a single unit, then the value will be the unit itself.

def value(quantity): if type(quantity) != list: return quantity else: return sum([value(unit) for unit in quantity])
value(quantity(1, pi))
quantity(3)
value(quantity(3))
quantity(3, 2)
value(quantity(3, 2))
quantity(2, 3)
value(quantity(2, 3))
quantity(2, 3) == quantity(3, 2)
value(quantity(2, 3)) == value(quantity(3, 2))
quantity(3, quantity(2))
value(quantity(3, quantity(2)))
quantity(2, quantity(3))
value(quantity(2, quantity(3)))
a = quantity(2, quantity(3)) b = quantity(3, quantity(2)) a; b; a == b
value(quantity(2, quantity(3))) == value(quantity(3, quantity(2)))
var('x') Q = quantity(5, x) Q; value(Q)
x = 3 Q = quantity(5, x) Q; value(Q)
Q = quantity(4, pi) Q; value(Q)
Q = quantity(2, quantity(3, quantity(4, pi))) Q; value(Q)
Q = quantity(3, -1) P = quantity(3, 1) Q; value(Q); P; value(P); Q+P; value(Q+P)
Q = quantity(3, -4) P = quantity(2, 5) Q; value(Q); P; value(P); Q+P; value(Q+P)
Q = quantity(3, 1/4) P = quantity(2, 1/5) Q; value(Q); P; value(P); Q+P; value(Q+P)

A quantity whose units are all the same is a 'simple' quantity.

A quantity composed of different types of units is a 'compound' quantity.

An 'amount' is the sum of two or more quantities, so an amount is a compound quantity.

var('a b c') amount = [quantity(3, a), quantity(2, b), quantity(5, c)] amount
value(amount)

Note \rightarrow quantus can also mean 'how much'.  

Sometimes when we quantify an amount in terms of a unit we find that we can't group the amount into a whole number of units.

Sometimes we have to divide a unit into subunits, and sometimes we have to think of the quantity in terms of different types of units.

For example, consider the quantity circumference of a unit circle.

If we use the radius as our unit, then the definition would be quantity(6.28,1)quantity(6.28, 1).  But this creates a problem.

quantity(6.28, 1)

A list can only contain a whole number of items.  You can have 6 or 7 items, but not 6.28.

It might make sense to think of such a list such as [1,1,1,1,1,1,0.28][1, 1, 1, 1, 1, 1, 0.28], but it is still a list that contains 7 items.  And again, the 0.280.28 is only an approximation.

Suppose we use a different kind of unit, like π\pi?  It's impossible to give an exact decimal representation of its value, so we'll just designate it as 'π\pi'.  

Since the circumference of a unit circle is equal to 2π2\pi, if we think of π\pi as the unit, our quantity becomes:

C = quantity(2, pi) C; value(C)

This representation of the quantity is exact.  There are no approximations.

C = quantity(2, pi) C
value(C)

A quantity whose units are all the same is a 'simple' quantity.

A quantity composed of different types of units is a 'compound' quantity.

var('a b c') amount = [quantity(2, a), quantity(3, b), quantity(5, c)]
amount; value(amount)

A simple quantity is a monomial, meaning one name.

A compound quantity is a polynomial, meaning many names.

To quantify an amount in terms of a unit is to create a list containing that unit as many times as is possible.

To quantify a numbernumber in terms of a unitunit is to create a list containing that unit as many times as is possible with that numbernumber.

def quantify(number, unit): quantified = [] while number >= value(unit): quantified += [unit] number -= value(unit) if number > 0: quantified += [number] return quantified
quantify(73, 15)
quantify(18, 7)
quantify(20, 4)
quantify(20, 5)
quantify(20, quantity(4))
quantify(20, 9)
quantify(20, quantity(9))
[quantity(3, x), quantity(5)]
value([quantity(3, x), quantity(5)])
quantity(3, 1/5)
value(quantity(3, 1/5))
a = quantity(3, 1/5) b = quantity(4, 1/7) [a, b]
value([a, b])
a = quantity(3, quantity(7, 1/35)) b = quantity(4, quantity(5, 1/35)) [a, b]
[value(a), value(b)]
value([a, b])
var('y')
[quantity(3, x), quantity(4, y)]
value(_)
y = 2*x
[quantity(3, x), quantity(4, y)]
value(_)
quantity(2, quantity(2, quantity(2)))
value(_)
quantity(2, quantity(3))
matrix(_)
quantity(3, quantity(2))
matrix(_)
x = 7
3*[x]
quantity(x)
var('x')
class Quantity: def __init__(self, number=1, unit=1): (self.number, self.unit) = (number, unit) def __repr__(self): return str(self.number*[self.unit]) def value(self): if type(self.unit) == Quantity: return self.number*self.unit.value() if type(self.unit) == list: return sum(self.number*self.unit) if type(self.unit) == str: return self.number*[self.unit] return sum(self.number*[self.unit]) a = Quantity(3, 2) b = Quantity(5, '?') c = Quantity(3, Quantity(2, x))
a; a.value()
b; b.value()
c; c.value()
c
c.value()
b.value()
a.value()