Computer Mathematics Fundamentals①(Numbers)

Numbers

Integers

Definition 1.1. The integers are the collection of all whole numbers:
that is, they consist of the whole positive numbers 1, 2, 3, 4, . . ., together
with the whole negative numbers −1,2,3,4, . . ., and the number 0.
We denote this set by writing the symbol Z.

The symbol Z comes from the German word “Zahl,” which means “number,in case you were curious.

Integers are the set of all integers:
that is, they consist of positive numbers
1, 2, 3, 4, ... for negative numbers - 1, - 2, - 3, - 4, ... and the number 0.
We denote this set by the symbol Z.

The symbol Z comes from the German word "Zahl", which means "number", if you're curious.

Even and Odd Integers

Definition 1.2. We say that an integer is even if we can write it as 2
times another integer; in other words, we say that an integer n is even
if we can find an integer k such that n = 2k.
Similarly, we say that an integer is odd if we can write it as one plus an
even number; in other words; we say that an integer n is odd if we can
find an integer k such that n = 2k + 1.

We say that an integer is even if we can write it as 2
times another integer; in other words, we say that an integer n is even
if we can find an integer k such that n = 2k. (for proof)
Similarly, we say that an integer is odd if we write it as 1 + an
even; in other words; we say that an integer n is odd if we can.
Find an integer k such that n = 2k + 1. (to prove)

Claim 1.1. The sum of any two odd numbers is even.

The sum of any two odd numbers is even.

prove:

Proof. Take any two odd numbers. Let’s give them names, for ease of
reference: let’s call them M and N. By definition, because M and N
are odd, we can write M = 2k + 1 and N = 2l + 1, for two integers k,l.
Therefore, M + N = (2k + 1) + (2l + 1) = 2k + 2l + 2 = 2(k + l + 1). In
particular, this means that M + N is an even number, as we’ve written
it as a multiple of 2!
Claim 1.2. The product of any two odd numbers is odd.

The product of any two odd numbers is odd.

Claim 1.3. No integer is both even and odd at the same time.

No integer is even and odd at the same time.

Divisibility and Primes

Definition 1.3. Given two integers a, b, we say that a divides b if there
is some integer k such that ak = b.
There are many synonyms for “divides”: each of the phrases
• “a is a divisor of b”,
• “a is a factor of b”,
• “b is a multiple of a”,
• “b can be divided by a,” and
• a ∣ b
all mean the same thing as “a divides b.

Given two integers ab, we say that a divides b by
some integer k such that ak = b.
There are many synonyms for "fen": each phrase has
• "a is a divisor of b",
• "a is a divisor of b",
• "b is a multiple of a",
• "b is divisible by a" and
• a ∣b
is the same as dividing a by b

Claim 1.4. Let a, b, c be three integers. If a divides b and b divides c,
then a divides c.

Let a, b, and c be three integers. If a divides b and b divides c,
we can say that a divides c.

Definition 1.4. A prime number is any positive integer with only two
distinct positive factors; namely, 1 and itself.

A prime number is any positive integer with only two factors:
1 and itself.

Observation 1.1. 1 is not a prime number.
Observation 1.2. 2 is the only even prime number.
Definition 1.5. A composite number is any positive integer n that
can be written as the product of two integers a, b, both of which are at
least 2 (and thus both of which are strictly smaller than n.)

A composite number is any positive integer n
can be written as the product of two integers a, b, both of which are at
least 2 (so both are strictly less than n)

Observation 1.3. By definition, any positive integer is either a prime
number, a composite number, or 1.

By definition, any positive integer is prime, composite, or 1

Definition 1.6. Given a positive integer n, a prime factorization of
n is any way to write n as a product of prime numbers.

Given a positive integer n, a prime factorization of n is any way to write n as the product of prime numbers.

Theorem 1.1. Every positive integer can be factorized into a product
of prime numbers in exactly one way, up to the ordering of those prime
factors.

This theorem says two things:

  • Every positive integer can be factored into prime numbers
  • No number can be decomposed into prime numbers in two different ways
Theorem 1.2. There are infinitely many primes.

There are infinite prime numbers

Claim 1.5. Let ab be a two-digit positive integer (where b is that number’s ones’ digit and a is its tens’ digit.) Show that the number abab is
not prime.

If ab is a two number, then abab is not a prime number

insert image description here
This conclusion can optimize the verifier of prime numbers. His gist is that a prime number does not have a factor between 2 and k (k is rounded down after the root of this number)

Modular Arithmetic

insert image description here
Take any two integers a, n, where n > 0. We define the number a % n, pronounced "a mod n", by the following algorithm:

  • If a≥n, subtract n from a repeatedly until a < n. The result of this process is a % n.
  • If a < 0, repeat adding n to a until a > 0. The result of this process is a % n.
  • If neither of these two cases apply, then by definition 0≤a < n. In this case, a % n is a (that is, we don't need to do anything!)

This modulo operation has different operation results in different programming languages. For details, see the implementation principle in the document.

Claim 1.7. If a, n are any two integers with n > 0, the quantity a % n
exists and is between 0 and n − 1. That is: the algorithm given above
to calculate % will never “crash” nor “run forever,” and it will always
generate an output between 0 and n − 1.

If a, n are any two integers, and n > 0, then a % n exists and lies between 0 and n−1. That is: the algorithm given above to compute % never "crash" or "run forever", it always produces an output between 0 and n−1.

% and Arithmetic

Definition 1.8. Take any three integers a, b, n. We say that a is congruent to b modulo n, and write a ≡ b mod n, if a − b is a multiple of
n.

Take any three integers a, b, n. If a - b is a multiple of n, we say that a is the same as b modulo n, and write it as a≡b mod n.

Claim 1.8. Take any three values a, b, n such that n ≠ 0. Then the
following two statements are equivalent:
 - a % n = b % n.
 - a − b is a multiple of n; i.e. a ≡ b mod n.

Take any three values ​​of abn such that n≠0. Then the following two expressions are equivalent:

  • a % n = b % n
  • a - b is a multiple of n a≡b mod n
Claim 1.9. Suppose that a, b, c, d, n are any set of integers with n ≠ 0,
such that a % n = b % n and c % n = d % n.
Then we have the following properties:
 (a + c) % n = (b + d) % n.
 (ac) % n = (bd) % n.

This claim is basically just saying that we can do “arithmetic modulo
n!” That is: for numbers a, b, c, d, you know that if a = b, c = d then
ac = bd and a + c = b + d, by just combining these equalities with the
addition and multiplication operations. This claim is saying that if your
values are “equal modulo n,” the same tricks work!

That is to say, a, b, c, d, and n are all integers, and n is not equal to 0. If a is the same as b modulo n, and c is the same as d modulo n, then a + c is the same as b + d modulo n, and ac is the same as bd modulo n n.

The second paragraph of text is to say that the equation after performing the linear operation and taking the equality is also true if the modulo is taken on both sides at the same time.

insert image description here
Note that this k takes any positive integer.
Use this method to perform a reduction operation on large numbers.

insert image description here
We can use the above method to prove this statement:

  • First we scale down 213047 to 7
  • Find the law again and find four cycles (the last digit is 7, 9, 3, 1)

Other Number Systems

insert image description here
Any rational number can be expressed as the ratio of two numbers, where x and y are integers and y is nonzero. We use Q to denote the set of rational numbers.

insert image description here
numerator dividend
denominator divisor

Definition 1.11. The natural numbers, denoted N, is the collection
of all nonnegative integers. That is, N = {
    
    0, 1, 2, 3, 4, 5, . . .}.

The natural numbers are represented by the set N and are non-negative integers

Definition 1.12. The real numbers, denoted R, is the collection of
all numbers that you can write out with a (possibly infinite) decimal
expansion: i.e. it’s the collection of things like
• 2.1,
• −724,0.111111 . . . = 0.1, and
• −3.1415926535 . . .

The real number R is the set of all numbers that can be expanded with (possibly infinite) decimals

Observation 1.4. Notice that every real number, by definition, is either
rational or irrational.

If every real number is not a rational number, it must be an irrational number, it can only be one of the two!

insert image description here
Proving this requires only the definition of rational numbers.

  • Put this logarithm on the left side of the equation and x/y on the right side
  • Use both sides of the equation as exponents of 2
  • Simultaneous y-th power on both sides of the equation
  • The left side of the equation is an odd number, and the right side of the equation is an even number, so it does not hold

Guess you like

Origin blog.csdn.net/zyb18507175502/article/details/124230827