1. Modular arithmetic
    1. Divisibility Rules
      1. Pascal's Divisibility Rule
        1. for 11
          1. Simply put, if you split all the digits of a number into two groups – every other digit (one group will have all the digits in odd positions, the other – in even positions), sum up all the digits in each group and subtract one sum from the other, then the remainder when dividing the result by 11 will be the same as for the original number.
    2. Theory of Divisibility
      1. basics
        1. trivial divisor
          1. A divisor of n is called a trivial divisor of n if it is either 1 or n itself.
        2. nontrivial divisor
          1. A divisor of n is called a nontrivial divisor if it is a divisor of n, but is neither 1, nor n.
        3. theorems
          1. a - dividend
          2. q - quotient
          3. r - reminder
          4. The Sieve of Eratosthenes
    3. Rules
      1. positive integers
      2. addition
      3. multiplication
      4. exponential
    4. conguent
      1. /equiv - latex
    5. example
      1. (1 * 1) % 5 = (2 * 3) % 5 = (3 * 2) % 5 = = (4 * 4) % 5 = 1
      2. (2 ** (-1)) % 5 = 3 % 5 = 3
      3. (3 ** (-1)) % 5 = 2 % 5 = 2
      4. (4 ** (-1)) % 5 = 4 % 5 = 4
      5. (23 ** (-1)) % 5 = (3 ** (-1)) % 5 = 2
      6. 23 % 5 = 3
      7. (163 ** 42) % 49 = 1
      8. (163 ** (-1)) % 42 = 46
      9. 3 ** 203 % 7 = 5
      10. inverse mod k
      11. A modular inverse of a number is such a natural number that, when multiplied modulo a given number, results in one. The modular inverse modulo m can be computed using the so-called Extended Euclidean Algorithm.
    6. tricks
      1. (11 * 4) % 12 = ((-1) * 4 % 12 = (-4) % 12 = 8
      2. (11 ** 7) % 12 = ((-1) ** 7) % 12 = 11
    7. p doesn't divide a
    8. inverse mod k
    9. encription
      1. M - message
      2. p - prime number
      3. e - encryption key
      4. C - scramble message
      5. d - decryption key
        1. private key
        2. Шаги
        3. 1. Два простых числа - 7 и 11
        4. 2. Вычисляем модуль p=7*11=77
        5. 3. Вычисляем функцию Эйлера: k = (7-1) * (11-1) = 6 * 10 = 60
        6. 4. Выбираем число e: простое, меньше k, оно должно быть взаимно простое с k. Выберем e = 43 (открытая экспонента)
        7. Взаимно простые числа — целые числа, не имеющие никаких общих делителей, кроме ±1. Равносильное определение: целые числа взаимно просты, если их наибольший общий делитель равен 1
        8. 5. Вычислить d, обратно по модулю k: (d * e) % k = 1 (d * 43) % 60 = 1 d = 7 или 67
      6. public key
      7. Algorithms
        1. DSA
          1. Digital Signature Algorithm
          2. The Digital Signature Algorithm (DSA) is a widely used asymmetric cryptographic algorithm for creating and verifying digital signatures. It was proposed by the National Institute of Standards and Technology (NIST) as a standard for digital signatures.
          3. DSA algorithm
          4. Key Generation:
          5. Generate a large prime number p, typically 1024 or 2048 bits long, and a smaller prime number q, such that q divides p-1. These primes are public parameters shared by the participants.
          6. Select an integer g, where g is a generator of the multiplicative group of integers modulo p. This group is denoted as Zp*.
          7. Choose a private key x, a randomly selected integer from the range [1, q-1].
          8. Compute the corresponding public key y, where y = g^x mod p.
          9. Signing Process:
          10. Hash the message to be signed using a secure hash function, such as SHA-256, to obtain a fixed-size message digest.
          11. Generate a random number k from the range [1, q-1].
          12. Compute r, where r = (g^k mod p) mod q.
          13. Compute s, where s = ((hash + x*r) * k^(-1) mod q), and hash represents the message digest.
          14. The signature for the message is the pair (r, s).
          15. Signature Verification:
          16. Obtain the public key (y) of the signer from a trusted source.
          17. Hash the received message to obtain the message digest.
          18. Compute w, where w = s^(-1) mod q.
          19. Compute u1, where u1 = (hash * w) mod q.
          20. Compute u2, where u2 = (r * w) mod q.
          21. Compute v, where v = ((g^u1 * y^u2) mod p) mod q.
          22. The signature is valid if and only if v is equal to r.
          23. The DSA algorithm relies on the computational difficulty of computing discrete logarithms to provide security. The private key x must be kept secret, while the public key y can be freely distributed.
          24. DSA is widely used in various cryptographic applications, such as secure communication, digital certificates, and authentication. However, it has been largely replaced by the more efficient and secure Elliptic Curve Digital Signature Algorithm (ECDSA) in many modern systems and protocols.
        2. ECDSA
          1. Elliptic Curve Digital Signature Algorithm
          2. The Elliptic Curve Digital Signature Algorithm (ECDSA) is an asymmetric cryptographic algorithm used for creating and verifying digital signatures. It is based on the mathematical properties of elliptic curves over finite fields. ECDSA provides a high level of security with shorter key lengths compared to other algorithms like RSA.
          3. ECDSA algorithm
          4. Key Generation:
          5. Select an elliptic curve defined over a finite field. The curve parameters, including the equation and base point, must be agreed upon by the communicating parties.
          6. Choose a private key d, a random integer from a specific range defined by the curve's order.
          7. Compute the corresponding public key Q, where Q = d * G, and G is the base point on the elliptic curve.
          8. Signing Process:
          9. Hash the message to be signed using a secure hash function, such as SHA-256, to obtain a fixed-size message digest.
          10. Generate a random number k within the specified range.
          11. Compute the point R = k * G on the elliptic curve, where G is the base point.
          12. Derive the x-coordinate of R as r, where r = R.x mod n, and n is the order of the base point.
          13. Compute the value s, where s = (k^(-1) * (hash + r * d)) mod n.
          14. The signature for the message is the pair (r, s).
          15. Signature Verification:
          16. Obtain the public key Q of the signer from a trusted source.
          17. Hash the received message to obtain the message digest.
          18. Compute the value w, where w = s^(-1) mod n.
          19. Compute the value u1, where u1 = (hash * w) mod n.
          20. Compute the value u2, where u2 = (r * w) mod n.
          21. Compute the point R' = u1 * G + u2 * Q on the elliptic curve.
          22. The signature is valid if and only if the x-coordinate of R' is equal to r.
          23. ECDSA offers strong security and performance advantages over traditional digital signature algorithms. It requires shorter key lengths, making it more efficient in terms of computation and storage. The use of elliptic curves enhances the security of the algorithm.
          24. ECDSA is widely used in various cryptographic applications, such as secure communication protocols, digital certificates, and blockchain technologies. It provides a reliable method for verifying the authenticity and integrity of digital data.
        3. RSA
          1. Rivest-Shamir-Adleman
          2. Rivest-Shamir-Adleman (RSA) is an asymmetric cryptographic algorithm widely used for secure communication, digital signatures, and encryption. It was introduced in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. RSA relies on the computational difficulty of factoring large integers into their prime factors.
          3. RSA algorithm
          4. Key Generation:
          5. Select two large prime numbers, p and q.
          6. Compute the modulus N as N = p * q.
          7. Compute Euler's totient function ϕ(N) as ϕ(N) = (p-1) * (q-1).
          8. Choose a public exponent e, which is typically a small prime number, coprime to ϕ(N) (i.e., gcd(e, ϕ(N)) = 1).
          9. Compute the private exponent d as the modular multiplicative inverse of e modulo ϕ(N) (i.e., d ≡ e^(-1) (mod ϕ(N))).
          10. The public key is (N, e), while the private key is (N, d).
          11. Encryption:
          12. Convert the plaintext message into a numerical representation (e.g., using ASCII or Unicode encoding).
          13. Split the message into blocks if necessary.
          14. For each block m, compute the ciphertext c as c ≡ m^e (mod N).
          15. The resulting ciphertext represents the encrypted message.
          16. Decryption:
          17. Obtain the private key (N, d).
          18. For each ciphertext block c, compute the plaintext block m as m ≡ c^d (mod N).
          19. If necessary, combine the decrypted blocks to obtain the original plaintext message.
          20. Digital Signatures:
          21. To create a digital signature for a message, the signer uses their private key (N, d).
          22. The signer computes the hash of the message using a secure hash function.
          23. The hash is then encrypted using the private key: s ≡ hash^d (mod N).
          24. The resulting value s represents the digital signature.
          25. Signature Verification:
          26. To verify the signature, the recipient uses the public key (N, e) and the received signature s.
          27. The recipient decrypts the signature using the public key: hash ≡ s^e (mod N).
          28. The recipient computes the hash of the original message using the same secure hash function.
          29. If the computed hash matches the decrypted hash, the signature is valid.
          30. RSA is widely used in various applications due to its security, efficiency, and versatility. However, the security of RSA relies on the difficulty of factoring large integers, and as computing power advances, longer key lengths are required to maintain security against attacks.
      8. Standarts
        1. DES
          1. Data Encryption Standard
          2. The Data Encryption Standard (DES) is a symmetric-key block cipher algorithm that was widely used for encryption and decryption of electronic data. It was developed in the 1970s by IBM and later standardized by the National Institute of Standards and Technology (NIST) in the United States.
          3. DES algorithm
          4. Key Generation
          5. The DES algorithm uses a 56-bit key, which is generated by the user or system.
          6. The key undergoes a process called key schedule, involving permutations and transformations, to generate 16 subkeys of 48 bits each.
          7. Encryption Process
          8. The data to be encrypted is divided into blocks of 64 bits.
          9. Each block goes through an initial permutation (IP) stage.
          10. The permutation rearranges the bits according to a fixed table.
          11. The permuted block is then divided into two halves, left and right, each consisting of 32 bits.
          12. Rounds
          13. The DES encryption process consists of 16 rounds of similar operations.
          14. In each round, the right half of the data block is expanded from 32 bits to 48 bits using an expansion permutation.
          15. The expanded right half is then XORed (bitwise exclusive OR) with a subkey generated during the key schedule.
          16. The XOR result is passed through a series of S-boxes (substitution boxes).
          17. The S-boxes perform a non-linear substitution, replacing each 6-bit input with a 4-bit output.
          18. The outputs of the S-boxes are combined and passed through a permutation called a P-box.
          19. The result of the P-box permutation is XORed with the left half of the data block.
          20. The updated left half becomes the new right half, and the previous right half becomes the new left half.
          21. This process is repeated for 16 rounds, with the subkeys used in a predetermined order.
          22. Final Permutation and Output
          23. After 16 rounds, the left and right halves of the data block are swapped.
          24. The combined block goes through a final permutation (IP inverse).
          25. The output of the final permutation is the encrypted data block.
          26. Decryption
          27. Decryption in DES is essentially the reverse of the encryption process.
          28. The subkeys are used in the reverse order during decryption.
          29. The same operations of expansion, XOR, S-boxes, and permutation are applied, but in the reverse order.
          30. After 16 rounds, the final permutation is applied to obtain the decrypted data block.
          31. DES was widely used for many years as a standard encryption algorithm, but its key size of 56 bits is now considered too short for secure encryption. Consequently, the Advanced Encryption Standard (AES) has largely replaced DES in modern cryptographic applications due to its stronger security and larger key sizes.
        2. AES
          1. Advanced Encryption Standard
          2. The Advanced Encryption Standard (AES) is a symmetric-key encryption algorithm that was selected by the National Institute of Standards and Technology (NIST) in 2001 as a replacement for the Data Encryption Standard (DES). AES has become the most widely used encryption algorithm worldwide due to its strong security and efficiency.
          3. AES algorithm
          4. Key Generation:
          5. AES supports key sizes of 128, 192, or 256 bits.
          6. The key is generated by the user or system and must match the chosen key size.
          7. Encryption Process:
          8. The data to be encrypted is divided into blocks of 128 bits.
          9. AES operates on a fixed number of rounds depending on the key size: 10 rounds for AES-128, 12 rounds for AES-192, and 14 rounds for AES-256.
          10. Each round consists of several transformation stages, including SubBytes, ShiftRows, MixColumns, and AddRoundKey.
          11. SubBytes: Each byte of the data block is substituted using a predefined substitution box (S-box), which provides non-linearity and confusion.
          12. ShiftRows: The bytes in each row of the data block are shifted cyclically to the left.
          13. MixColumns: The columns of the data block are mixed using a matrix multiplication operation to achieve diffusion.
          14. AddRoundKey: The data block is XORed with a round key derived from the main encryption key.
          15. Key Expansion:
          16. The original encryption key is expanded to generate a set of round keys for each round of encryption.
          17. The key expansion algorithm involves a series of transformations, including SubBytes, RotWord, and XOR with a round constant.
          18. The round keys are derived from the main encryption key and used in the AddRoundKey operation during each round.
          19. Decryption:
          20. Decryption in AES is essentially the reverse of the encryption process.
          21. The round keys are used in reverse order during decryption.
          22. The inverse of each transformation stage (InvSubBytes, InvShiftRows, InvMixColumns) is applied in the reverse order.
          23. After the final round, the data block is XORed with the last round key to obtain the decrypted data.
          24. AES provides a high level of security, even against sophisticated attacks, and is widely adopted in various applications, including secure communication, data storage, and digital systems. Its flexibility in supporting different key sizes allows for a balance between security and performance, making it a versatile encryption algorithm.
        3. DSS
          1. Digital Signature Standard
          2. The Digital Signature Standard (DSS) is a standard for digital signatures that was established by the National Institute of Standards and Technology (NIST) in the United States. It specifies the algorithms and protocols to be used for generating and verifying digital signatures.
          3. Components
          4. Digital Signature Algorithm (DSA):
          5. DSA is the core algorithm used for generating and verifying digital signatures in the DSS.
          6. It is based on the mathematical properties of modular exponentiation and the difficulty of solving the discrete logarithm problem in finite fields.
          7. DSA utilizes a specific elliptic curve (FIPS 186-4) or a set of predefined parameters for prime fields (FIPS 186-3).
          8. The algorithm provides a high level of security with relatively short key sizes.
          9. Key Generation:
          10. DSS specifies the key generation process for DSA.
          11. A large prime number p and a smaller prime number q are generated according to specific criteria.
          12. The private key is randomly generated as an integer within a certain range.
          13. The corresponding public key is computed based on the private key and the generated primes.
          14. Signature Generation and Verification:
          15. DSS defines the procedures for generating and verifying digital signatures using DSA.
          16. To generate a signature, the private key holder computes specific mathematical operations based on the message and private key.
          17. The resulting signature consists of two values: r and s.
          18. To verify the signature, the public key holder performs calculations using the received signature, message, and public key.
          19. The verification process ensures that the signature is valid and has not been tampered with.
          20. Key Management and Certification:
          21. DSS provides guidelines for key management and certification, including the storage, backup, and revocation of keys.
          22. It outlines practices for generating, storing, and protecting keys to maintain the security and integrity of digital signatures.
          23. The standard also addresses the use of certificates to establish trust and verify the authenticity of public keys.
          24. The Digital Signature Standard (DSS) is widely adopted and used in various applications where digital signatures are required for authentication, integrity, and non-repudiation of digital data. It ensures the security and interoperability of digital signature systems and plays a crucial role in secure communication, electronic transactions, and data integrity verification.
    10. methods
      1. CFRAC
        1. Continued FRACtion method (for factoring)
          1. Choose a number to factorize: Let's say we have a composite number N that we want to factorize.
          2. Choose a quadratic function: The method uses a quadratic function, typically f(x) = (x^2) mod N, to generate a sequence of numbers.
          3. Generate a sequence: We generate a sequence of numbers using the quadratic function and a chosen starting value.
          4. Create fractions: Each number in the sequence is used to create a fraction. The fraction is then converted into a continued fraction.
          5. Find convergents: The convergents (best rational approximations) of the continued fraction are computed.
          6. Check for factorization: For each convergent, we check if the denominator divides N. If it does, we've found a non-trivial factor of N.
          7. Repeat: If no factor is found, the process is repeated with a different quadratic function or a different starting value.
      2. ECM
        1. Elliptic Curve Method (for factoring)
          1. Choose a number to factorize: Let's say we have a composite number N that we want to factorize.
          2. Choose an elliptic curve and a point: We randomly choose an elliptic curve E over the field of integers modulo N, and a point P on E.
          3. Perform point multiplication: We compute kP where k is a product of small primes, and P is the point chosen on the elliptic curve.
          4. Check for factorization: If during the computation of kP, we find a non-trivial divisor of N, then we've found a factor of N.
          5. Repeat: If no factor is found, the process is repeated with a different elliptic curve or a different point.
      3. NFS
        1. Number Field Sieve (for factoring)
          1. Choose a number to factorize: Let's say we have a composite number N that we want to factorize.
          2. Polynomial selection: We choose two polynomials f(x) and g(x) such that f(x) is irreducible over the integers and g(x) is a simpler polynomial, typically linear. The root of f(x) modulo N should be a root of g(x) modulo N.
          3. Sieving: We search for values of x such that both f(x) and g(x) are B-smooth, meaning all their factors are less than some bound B. These values of x are used to form a matrix over the field with two elements.
          4. Matrix reduction: We use linear algebra techniques to find a nontrivial kernel of this matrix. This gives us a set of x values such that the product of f(x) is a square modulo N and the product of g(x) is a square in the integers.
      4. QS/MPQS
        1. Quadratic Sieve/Multiple Polynomial Quadratic Sieve (for factoring)
          1. Square root computation: We compute these square roots and use them to find a factor of N.
          2. Select a smoothness bound B.
          3. Choose a quadratic polynomial f(x) = (ax + b)^2 - N.
          4. Sieve using a set of primes p1, p2, ..., pk, such that their squares are smaller than or equal to B:
          5. Compute f(x) modulo pi for x = 0 to B.
          6. If f(x) is divisible by pi, divide f(x) by pi until it is not divisible anymore.
          7. Record the exponent of pi.
          8. difference
          9. QS
          10. In the QS algorithm, a single quadratic polynomial is selected, and sieving is performed using this polynomial. The goal is to find x values for which the polynomial evaluates to a perfect square modulo N.
          11. MPQS
          12. On the other hand, MPQS extends the QS algorithm by using multiple quadratic polynomials. A set of quadratic polynomials is chosen, and sieving is performed using each of these polynomials. The aim is still to find x values for which each polynomial evaluates to a perfect square modulo N.
          13. In summary, the key difference between QS and MPQS is that QS uses a single quadratic polynomial for sieving, while MPQS employs multiple quadratic polynomials to increase the probability of finding suitable x values for factorization.
          14. Construct a matrix "relations" to store the relationships between smooth values.
          15. For each smooth value (x, exponent):
          16. For each prime pi:
          17. Compute pi^exponent modulo N and store it in the "relations" matrix.
          18. Use Gaussian elimination or other linear algebra techniques to find equations summing up to zero modulo 2.
          19. Solve the system of equations to find a set of x values.
          20. Compute the product of the corresponding f(x) values.
          21. If the product is a perfect square modulo N, you have found non-trivial factors of N.
          22. If no factors are found, repeat with different quadratic polynomials until successful or a limit is reached.
          23. Multiple Polynomial Quadratic Sieve (MPQS)
      5. ECPP
        1. Elliptic Curve Primality Proving
          1. Select a random elliptic curve E defined over a finite field of size N.
          2. Choose a random point P on the elliptic curve E.
          3. Generate a random prime q such that q is small enough for efficient computation and q does not divide N.
          4. Compute the point Q = [q]P, where [q] denotes the scalar multiplication of the point P by the integer q.
          5. If the point Q is the identity element on the elliptic curve (i.e., Q = O, where O denotes the point at infinity), return to step 2 and choose a different random point P.
          6. Compute the order r of the point Q. The order r is the smallest positive integer such that [r]Q = O.
          7. If r does not divide N, return to step 2 and choose a different random point P.
          8. Verify the primality of N using the primality test for r. This step involves checking if r is a prime number using a separate primality-testing algorithm.
          9. If the primality test for r determines that r is composite, return to step 2 and choose a different random point P.
          10. Repeat steps 2 to 9 until a prime r is found.
          11. Perform a set of consistency checks to ensure that the computed values are correct and that N is a prime number.
          12. If all the checks pass, conclude that N is a prime number. Otherwise, repeat the process with a different elliptic curve or different random point P.
  2. Number systems
    1. Conversion from Decimal
      1. Whole Part
        1. Sequentially divide by the base, record the remainder as the new digit of the number, and then divide the result again by the base. Write the digits in reverse order (the first remainder is the last digit of the number).
      2. Fraction
        1. Sequentially multiply by the base, record the whole part as a digit, and multiply the fractional part again by the base. Write the digits in the order obtained.
        2. 0.515625 = 0.41 (8)
        3. 0.515625 * 8 = 4.125
          1. > 4
        4. 0.125 * 8 = 1
          1. > 1
    2. Binary
      1. Fractions
        1. 0.1 = 0.5
          1. 1/2
        2. 0.01 = 0.25
          1. 1/4
        3. 0.001 = 0.125
          1. 1/8
        4. 0.0001 = 0.0625
          1. 1/16
      2. To Decimal
        1. 0.75 = 0 + 7 * (1/8) + 5 * (1/64)
    3. Octal
      1. Conversion from Binary using 3 bits
        1. 10 101.101110 = 25.56
      2. Fractions
        1. 0.1 = 0.125
          1. 1/8
        2. 0.01 = 1/64
    4. Hexadecimal
      1. Conversion from Binary using 4 bits
        1. 1.01 = 1.4
        2. 10 0111 0010 = 272
      2. Fractions
        1. 0.1 = 0.0625
          1. 1/16
      3. Multiplication
        1. FAF9 * 6FFD = 16AF6
    5. Numbers
      1. Numbers
        1. 1
          1. 01
          2. 1
          3. 1
        2. 2
          1. 10
          2. 2
          3. 2
        3. 3
          1. 11
          2. 3
          3. 3
        4. 4
          1. 100
          2. 4
          3. 4
        5. 5
          1. 101
          2. 5
          3. 5
        6. 6
          1. 110
          2. 6
          3. 6
        7. 7
          1. 111
          2. 7
          3. 7
        8. 8
          1. 1000
          2. 10
          3. 8
        9. 9
          1. 1001
          2. 11
          3. 9
        10. 10
          1. 1010
          2. 12
          3. A
        11. 11
          1. 1011
          2. 13
          3. B
        12. 12
          1. 1100
          2. 14
          3. C
        13. 13
          1. 1101
          2. 15
          3. D
        14. 14
          1. 1110
          2. 16
          3. E
        15. 15
          1. 1111
          2. 17
          3. F
        16. 16
          1. 10 000
          2. 20
          3. 10
  3. Sequences and Series
    1. Series
      1. It is the sum of the terms of a sequence.
        1. Arithmetic progression
          1. The sum of all terms of an arithmetic progression is equal to half the product of the sum of its extreme terms and the number of all its terms.
          2. sum of all positive odd numbers
        2. Geometric progression
          1. Examples
          2. The sum of n terms of a geometric progression with denominator q != 1 is equal to the quotient of dividing the difference between the product of the last term by the denominator of the progression and the first term by the difference between the denominator of the progression and one.
        3. Sum of squares
        4. Sum of cubes
        5. Examples
          1. Triangular numbers
        6. decomposition
          1. sum decomposition
          2. moving multiplier
          3. don't do this for n
      2. compound percent
        1. FV is the future value of the annuity.
        2. P is the monthly deposit (annuity payment).
        3. r is the monthly interest rate (as a decimal).
        4. n is the total number of payments (or months, in this case).
    2. limit
      1. sequences limit
      2. convergents
        1. geometric series
        2. The limit of geometric series
        3. harmonic series
        4. Cauchy Criterion
          1. English
        5. Root test
        6. Ratio test
        7. additional
          1. convergence of a sequence between two others
          2. conditions
        8. Binomial Theorem
        9. limits
    3. Sequences
      1. Arithmetic progression
      2. Geometric progression
      3. module (random)
      4. Popular
        1. Bernoulli
          1. Bernoulli numbers are a sequence of rational numbers which are deeply connected to number theory. They appear in the series expansions of trigonometric functions, in formulas for the sum of powers of the first n positive integers, in the Euler-Maclaurin formula, and many other areas in mathematics.
        2. Fermat
        3. Mersenne primes
  4. Sets
    1. General
      1. Set theory branch of mathematics that deals with the properties of well-defined collections of objects
      2. Definition
        1. A set is defined as a collection of distinct elements.
          1. {a, b, c}
          2. {x | x is a natural number, x < 10}
        2. A set is an unordered collection of unique objects
        3. Cardinality of a set (Card)
          1. Number of elements in a set.
        4. Element of a set
        5. Subset
          1. A set where all elements are also in another set.
          2. Proper subset
          3. A proper subset is a subset that contains some but not all elements of the larger set, and it can't be identical to the larger set.
          4. Not Proper subset
        6. Special Sets
          1. Natural numbers
          2. Integers
          3. Rational numbers
          4. Irrational numbers
          5. Irrational numbers are real numbers that cannot be expressed as a simple fraction – that is, they cannot be written as a ratio of two integers. When written in decimal form, irrational numbers are infinite and non-repeating. This means that the numbers go on forever without repeating a pattern.
          6. characteristics
          7. Non-repeating
          8. The decimal expansion never repeats or terminates. Unlike a rational number, where you can eventually find a repeating pattern or the digits end entirely, irrational numbers have no such repeating pattern.
          9. Non-terminating
          10. They go on forever without coming to an end.
          11. examples
          12. 3.14159...
          13. 1.41421...
          14. The square root of any non-perfect square
          15. Euler's number (e):
          16. 2.71828...
          17. The golden ratio (φ)
          18. 1.61803...
          19. Real numbers
      3. Representing Sets
        1. Listing Method
          1. List all elements within curly brackets.
          2. Examples
        2. Set-Builder Notation (Rule of Inclusion)
          1. Describe elements using a rule within curly brackets.
          2. Examples
          3. Even Integers
          4. Odd Integers
          5. Rational Numbers
      4. Power Sets
        1. The power set P(S) of a set S contains all possible subsets of S
        2. Elements & Subsets
          1. Elements of a set can also be sets themselves.
          2. A set can be both a subset of one set and an element of another.
        3. Examples
        4. Cardinality
          1. Advanced Cardinality
      5. Set Operations
        1. Union of Sets
          1. the set containing all the elements that are in either A or B.
        2. Intersection of Sets
          1. the set containing all the elements that are in both A and B.
        3. Set Difference
          1. The set difference A−B contains all the elements that are in A but not in B.
        4. Symmetric Difference
          1. contains all the elements that are in either A or B, but not in both.
        5. Membership Tables
          1. 1 means the element belongs to the set.
          2. 0 means the element does not belong to the set.
        6. Cartesian product
          1. A Cartesian product of two sets A and B is the set containing ordered pairs from A and B
    2. Venn Diagrams and Set Theory
      1. Universal Set
        1. Denoted by U, it contains all possible elements.
      2. Complement of a Set
        1. meaning it contains all elements in U that are not in A.
      3. Venn Diagrams for Sets
        1. Used to visualize relationships among sets.
        2. The entire area represents the Universal Set U
    3. Operations
      1. Commutativity
      2. Associativity
      3. Distributivity
      4. De Morgan's Laws
      5. Special Cases
      6. Absorption Laws
      7. Set Difference
      8. Disjoint Sets
      9. Inclusion-Exclusion Principle (IEP) for two sets
    4. Laws
      1. De Morgan's Laws
        1. First Law
          1. The complement of the union of two sets is equal to the intersection of their complements:
        2. Second Law
          1. The complement of the intersection of two sets is equal to the union of their complements:
  5. Functions and plots
    1. Plots
      1. Coordinates
        1. Addition
          1. Q(1,2) P(-1, 3) Q+P(0, 5) Q-P(2,-1)
      2. Plane
      3. Cartesian Coordinates
        1. System of two perpendicular axes, x,y to map and label points on the plane
        2. origin
          1. (0, 0)
      4. Formulas
        1. distance between points
        2. midpoint
      5. description
        1. Tangent to curve
          1. The gradient of a curve at any point is equal to the gradient of the tangent at that point
        2. Asymptote
          1. an asymptote (/ˈæsɪmptoʊt/) of a curve is a line such that the distance between the curve and the line approaches zero as one or both of the x or y coordinates tends to infinity.
        3. intersections with axes
          1. x = 0
          2. y = 0
        4. symmetry
      6. types
        1. Straight line
          1. Any straight line has an equation of the form y = mx + c where m and c are constants
          2. m
          3. In the equation y = mx + c the value m is known as the gradient and is a measure of the steepness of the line
          4. or slope
          5. m
          6. if the point (a, b) lies on the line y = mx + c then equation is satisfied by letting x = a and y = b
          7. parallel
          8. perpendicular
          9. two-point form
        2. base changing
          1. a - vertical dilation
          2. b - horizontal dilation
          3. c - horizontal translation
          4. d - vertical translation
        3. Quadratic function
          1. y = 0
        4. Cubic function
        5. fractional
        6. higher order polynomials
        7. circle
          1. center: (h, k)
    2. Function
      1. Definitions
        1. Intervals
          1. closed
          2. An interval that includes its end-points is called a closed interval
          3. [1, 3]
          4. open
          5. Any interval that does not include its end-points is called an open interval
          6. strictly greater
          7. strictly less
          8. (1, 3)
          9. semi-open/semi-closed
          10. [1, 3)
        2. types
          1. Surjective function
          2. to each y of set Y is associated at least one element x of set X
          3. onto
          4. vertical line test
          5. every possible output must be obtainable from some input.
          6. Injective function
          7. to each x of set X is associated only one distinct y of set Y
          8. one-to-one
          9. horizontal line test
          10. different inputs must result in different outputs.
        3. Image and Pre-Image
          1. y is the image of x
          2. x is the pre-image of y.
        4. Components of a Function
          1. Domain of a function
          2. elements of set X on which f is defined
          3. The set of all inputs for the function
          4. Every element x in the domain of a function has one output f(x).
          5. Codomain of a function
          6. elements of Y linked by f to X
          7. The set containing all possible outputs
          8. Range
          9. The set of all actual outputs from the function
        5. variants
          1. A non-injective surjective
          2. An injective surjective
          3. An injective non-surjective
          4. A non-injective non-surjective
        6. domain
        7. co-domain
      2. inverse function
        1. graph
      3. Function composition
        1. Definition
          1. The composition of two functions
          2. equal to
        2. Stages of Computation
          1. Input X to the function G and get G(x) as output.
          2. Use the output of G(x) as an input to the function F and get F(G(x)).
          3. Example with Functions F and G
          4. Function F
          5. Function G
          6. Calculating
          7. Get the output of G(x)
          8. Use the output of G(x) as an input to F
        3. Visualization of Function Composition
          1. Sets
        4. Commutative Property
          1. Function composition is not commutative
          2. Example
          3. As we can see, F(G(1)) is not equal to G(F(1)). Therefore, the function composition is not commutative.
      4. Floor and Ceiling Functions
        1. Floor Function
          1. The floor function is denoted as ⌊x⌋.
          2. The floor function, ⌊x⌋, takes a real number x and returns the largest integer less than or equal to x.
          3. For example
          4. Properties of the Floor Function
          5. The ceiling of an integer is equal to itself.
          6. The ceiling of any number x between n and n+1 (inclusive) is n + 1
          7. The domain of the ceiling function is all real numbers.
          8. Property Proof: Floor Function
          9. Graph
        2. Ceiling Function
          1. The ceiling function, ⌈x⌉, takes a real number x and returns the smallest integer greater than or equal to x
          2. Example
          3. Properties of the Ceiling Function
          4. The ceiling of an integer is equal to itself.
          5. The ceiling of any number x between n and n+1 (inclusive) is n+1.
          6. The domain of the ceiling function is all real numbers.
          7. Graph
      5. Hamming distance
        1. the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different.
        2. it measures the minimum number of substitutions required to change one string into the other, or the minimum number of errors that could have transformed one string into the other.
    3. Kinematics
      1. variables
        1. u - initial velocity
        2. v - final velocity
        3. S - distance
      2. formulas
      3. graphs
    4. Useful
    5. Exponential
      1. for all a, y intercept of 1, that is the graph passes through (0,1)
      2. a > 1, the function is increasing
      3. a < 1, the function id decreasing
      4. for all a, the function is positive
      5. the x-axis is an asymptote
      6. e
        1. 2.71828
        2. natural exponential function
    6. Logarithms
      1. Types
        1. Natural logarithm
          1. the inverse of the natural exponential function
        2. Logarithm function with base a
          1. the domain
          2. the range
        3. Logarithm with base 10
      2. Properties
        1. Product Rule
        2. Quotient Rule
        3. Reciprocal Rule
        4. Power Rule
        5. Inverse properties
          1. Base a
          2. Base e
          3. Common
        6. Change of base
          1. Every logarithmic function is a constant multiple of the natural logarithm
      3. Graphs
        1. for all a, x intercept of 1, that is the graph passes through (1,0)
        2. for all a, the graph passes through (a, 1)
        3. a > 1, the function is increasing
        4. a < 1, the function id decreasing
        5. for all a, the function is positive
        6. the y-axis is an asymptote
        7. the function defined for a > 0 and x > 0
        8. for a > 1 the bigger a is more slowly the function increases
        9. for a < 1 the smaller a is the more slowly the function decreases
    7. Limits and differentiation
      1. Limit of sequence
        1. If limit exists finite, the sequence is convergent
        2. If limit doesn't exists the sequence is said to be divergent
      2. Laws
        1. Sum Law
          1. The limit of a sum is the sum of the limits
        2. Difference Law
          1. The limit of the difference is the difference of the limits
        3. Constant Multiple Law
          1. The limit if a constant times a function is the constant times the limit of the function
        4. Product Law
          1. The limit if a product is the product of the limits
        5. Quotient Law
          1. The limit of a quotient is the quotient of the limits (provided that the limit of the denominator is not 0)
      3. Limit and continuity of a function
        1. Discontinious
      4. Derivative of a function
        1. The derivative of a function is the limit of the ratio of the change in the function to the change in its argument, provided that the change in the argument approaches zero.
        2. Slope
          1. Slope shows the change in y or the change on the vertical axis versus the change in x or the change on the horizontal axis.
        3. Gradient
        4. Rules
          1. Trigonometric
        5. L'Hôpital's rule
        6. Derivate and study of a function
          1. Max and Min
          2. Second test
          3. Concavity test
  6. Introduction
    1. Symbols
      1. The Greek alphabet
      2. Latex
        1. Sets
          1. \mathbb{letter}
          2. Real number
    2. Vocabulary
      1. Prime numbers
        1. It is a positive integer, larger than 1, which cannot be expressed as the product of two smaller positive integers
        2. 2, 3, 5, 7, 11, 13, 13, 17, 19, 23
      2. factor
        1. 3 * 4 = 12
          1. 3 and 4 are factors of 12
          2. when a number is written as a product of prime numbers we say the number has been factorised
        2. Highest common factor
          1. h.c.f
          2. greatest common divisor
          3. g.c.d
        3. Lowest common factor
      3. fraction
        1. fraction = numerator/denominator = p /q
        2. proper fraction
          1. p < q
        3. improper fraction
          1. p > q
        4. inverted
          1. q / p
        5. reciprocal
          1. reciprocal = inverted fraction
          2. The reciprocal of a number is found by inverting it, so, for example, the reciprocal of 4/5 is 5/4
        6. equivalent fractions
        7. simplest form
          1. when there are no factors common to both numerator and denominator
        8. common denominator
          1. q / a and p / a. a - common denominator
        9. mixed fraction
          1. whole number and fraction part
        10. least common multiply
          1. l.c.m
          2. In Mathematics, the LCM of any two is the value that is evenly divisible by the two given numbers. The full form of LCM is Least Common Multiple. It is also called the Least Common Divisor
          3. l.c.d
        11. decimal
          1. decimal point
          2. first decimal place
          3. number of significant figures
          4. number of decimal places
          5. rounded
          6. rounded up
          7. rounded down
        12. percentage
          1. percentage change
        13. ratio
          1. Ratios are simply an alternative way of expressing fratcions
          2. Divide 170 in the ratio 3 : 2
          3. 3/5 of 170
          4. 102
          5. 2/5 of 170
          6. 68
          7. Divide 250 cm in the ratio 1 : 3 : 4
          8. 1/8
      4. BODMAS
        1. Brackets
          1. ()
        2. Of
          1. x
        3. Division
          1. /
          2. numerator
          3. denumerator
          4. quotient
        4. Multiplication
          1. *
        5. Addition
          1. +
        6. Substruction
          1. -
      5. Algebra
        1. superscript
          1. power
          2. index
          3. y
          4. indices
          5. plural
          6. laws of indices
          7. the first law
          8. base
          9. x
          10. negative powers
          11. fractional powers
          12. scientific notation
          13. quadratic expressions
          14. a and b - coefficients
          15. constant term
        2. subscript
          1. root
        3. substitution
          1. Substitution means replacing letters by actual numerical values
        4. formula
          1. A formula is used to relate two or more quantities
          2. subject
          3. transpose
          4. If we asked to transpose formula for r, then we must rearrange the formula so that r becomes the subject
        5. like terms
          1. Like terms are multiples of the same quantity
          2. Like terms can be collected together and added or subtracted in order to simplify them
        6. fraction
          1. partial fractions
          2. it is a part of the original fraction
          3. linear factor
          4. ax + b
          5. repeated linear factor
          6. quadratic factor
        7. equations
          1. unknown quantity
          2. solve
          3. solution
          4. root of the equation
          5. satisfy the equation
          6. linear equations
          7. ax + b = 0
          8. b - constant term
          9. simultaneous equations
          10. eliminating
          11. quadratic equations
          12. discriminant
          13. > 0
          14. distinct real roots
          15. = 0
          16. repeated root
          17. equal roots
        8. verbs
          1. evaluate
          2. simplify
          3. express
          4. factorise
          5. determine
          6. obtain
        9. inequalities
          1. x > y
          2. y < 5
      6. sequence
        1. term
        2. finite sequence
        3. infinite sequence
          1. limit
          2. converge
          3. When a sequence possesses a limit it is said converge
          4. diverge
        4. arithmetic progressions
          1. common difference
        5. geometric progressions
          1. common ratio
        6. series
          1. sigma notation
          2. arithmetic series
          3. geometric series
      7. set
        1. A set is a collection of clearly defined objects, things or states
        2. {...}
        3. finite set
        4. infinite set
        5. equal sets
        6. subset
        7. union
          1. Venn diagrams
        8. number sets
      8. Number bases
        1. decimal system
        2. binary system
        3. octal system
        4. hexadecimal system
      9. elementary logic
        1. symbolic logic
        2. negation
          1. The negation of a proposition is the proposition that is true whenever the original proposition is false and false when the original is true
          2. not
        3. conjunction
          1. Given any two propositions we can form their conjunction
          2. and
        4. disjunction
          1. or
        5. implication
          1. if then
        6. compound proposition
  7. Trigonometry
    1. angle
      1. measure
        1. degree
          1. 360
        2. minutes
          1. 60
        3. seconds
          1. 60
        4. radian
      2. types
        1. right
          1. 90
        2. flat
          1. 180
        3. complete
          1. 360
    2. triangles
      1. properties
      2. types
        1. similar triangles
        2. Isosceles
          1. two sides and two angles are equal
        3. equilateral
          1. all sides and angles are equal
        4. right triangles
          1. sides
          2. h - hypotenuse
          3. opposite
          4. adjacent
          5. properties
        5. scalene
          1. all three sides are different
      3. General
        1. cosine
        2. sine
        3. tangent
        4. cotangent
        5. trigonometrical ratios
        6. formulas
          1. the cosine rule
          2. the sine rules
          3. secant
          4. cosecant
          5. cotangent
          6. more
          7. Cofunction identities
          8. Double angles
          9. Even/odd
          10. Half angles
          11. Reciprocal functions
          12. Power reducing formulas
          13. Product to sum
          14. Pythagorean identities
          15. Sum and difference of angles
          16. Sum to product
        7. Circle view
      4. projections
    3. Functions
      1. The sine finction
      2. The cosine function
      3. the tangent function
  8. Vectors and Matrices
    1. Common
      1. Vector space
        1. A vector space or a linear space is a group of objects called vectors, added collectively and multiplied (“scaled”) by numbers, called scalars.
      2. Properties
        1. Associatibity
        2. Commutativity
        3. Identity
        4. Inverse
        5. Compatibility
        6. Distributivity
      3. Examples
        1. Euclidean vector
        2. line
        3. plane
      4. Operations
        1. scalar product of vectors
          1. The scalar product of two vectors is defined as the product of the magnitudes of the two vectors and the cosine of the angles between them
          2. The Dot Product
        2. Cross Product
          1. The scalar product is the product of vectors which gives a scalar quantity whereas the vector product is the product of vectors which gives a vector quantity as the product.
          2. parallelogram area
      5. length
      6. unit vector
        1. A unit vector is a vector whose length is 1
    2. Linear independence
      1. In the theory of vector spaces, a set of vectors is said to be linearly independent if there exists no nontrivial linear combination of the vectors that equals the zero vector. If such a linear combination exists, then the vectors are said to be linearly dependent. These concepts are central to the definition of dimension.
    3. Basis
      1. A basis for a vector space is a sequence of vectors that form a set that is linearly independent and that spans the space.
    4. Linear Transformations and Matrices
      1. Vector Rotations
        1. Clockwise rotation
      2. Linear
      3. Matrix
        1. Multiplication
          1. To perform multiplication of two matrices, we should make sure that the number of columns in the 1st matrix is equal to the rows in the 2nd matrix. Therefore, the resulting matrix product will have a number of rows of the 1st matrix and a number of columns of the 2nd matrix.
          2. sum i row A * j column B
        2. Determinant of a matrix
          1. The determinant of a matrix is the scalar value or number calculated using a square matrix.
        3. Inverse Transformation
          1. Inverse matrix is obtained by dividing the adjugate of the given matrix by the determinant of the given matrix.
        4. Systems of equations and matrices
          1. Example
          2. A system of equations can be represented by an augmented matrix.
          3. In an augmented matrix, each row represents one equation in the system and each column represents a variable or the constant terms.
          4. In this way, we can see that augmented matrices are a shorthand way of writing systems of equations.
          5. Gauss Jordan elimination
          6. Gauss-Jordan Elimination is an algorithm that can be used to solve systems of linear equations and to find the inverse of any invertible matrix.
  9. Probability
    1. Probability
      1. Total outcomes
        1. x
          1. variants
        2. n
          1. times
      2. or
      3. and
      4. Independent events
        1. The outcome of one event does not affect the other
      5. Dependent events
        1. The outcome of one event affects the other
        2. conditional probability
        3. probability that, given the occurrence of B, A occurs as well
        4. example
        5. A = clubs
        6. B = king
        7. A and B = king of clubs
    2. Combinatorics
      1. Permutations
        1. Types and formulas
          1. Formula
          2. +
          3. Selecting r elements from n options, with repetition
          4. Distribute r distinguishable balls into n distinguishable boxes
          5. Permutations with repetition
          6. +
          7. Permutations without repetition
          8. Arranging n elements in a sequence, no repetition
          9. +
          10. -
          11. Permutations without using all elements
          12. Arranging r elements from n options, no repetition
          13. +
          14. -
          15. Combinations without repetition
          16. Selecting r elements from n options, no repetition, order does not matter
          17. Distribute n balls into r boxes, no repeated balls
          18. -
          19. -
          20. Permutations of a multiset
          21. Arranging elements of a multiset (where n is the total number of items, and m_1, m_2, ..., m_k are the counts of each distinct item)
          22. +
          23. Implicit (due to the nature of multisets)
          24. Combinations with Repetitions
          25. Number of ways to select k objects from n categories with repetition permitted is given by the combination formula.
          26. Distribute n balls into k boxes, repeated balls
          27. -
          28. +
        2. Counting
          1. The Rule of Sum (Addition Principle)
          2. If you have two tasks, and there are a ways to do the first task and b ways to do the second task, and these tasks can't be done at the same time (they are mutually exclusive), then there are a+b ways to do one of the tasks.
          3. The Rule of Product (Multiplication Principle)
          4. If there are a ways to do something, and b ways to do another thing after the first thing has been done, then there are a×b ways to perform both actions.
        3. the permutation of r elements
        4. in a set of total n elements
        5. if we don't want to count more than once the groups (couples) that are different only for by the order we must divide by r!
        6. Binomial distribution
        7. Combinations
        8. Combinations are about selecting objects without regard to the order in which they are selected. If you have n objects and want to select r of them, the number of ways to do this is given by the combinations formula.
        9. If you're arranging r objects out of n available objects, the formula changes a bit.
        10. Permutations of multisets
        11. Distinguishable Objects and Boxes
          1. Distinguishable Balls into Distinguishable Boxes
          2. With Exclusion
          3. Representation as unordered selection of k boxes from n.
          4. Without Exclusion
          5. Representation as an ordered selection of k boxes from n with repetition.
          6. Indistinguishable Balls into Distinguishable Boxes
          7. With Exclusion
          8. Without Exclusion
          9. k - balls
          10. n - boxes
      2. Binomial coefficients
        1. Here, n! denotes the factorial of n, which is the product of all positive integers up to n.
        2. Properties
          1. Symmetry
          2. Binomial coefficients have a symmetric property.
          3. Summation
          4. They also follow a rule when adding two adjacent coefficients.
          5. Pascal's Triangle
          6. Each number in Pascal's triangle is the sum of the two numbers directly above it, and these numbers represent binomial coefficients.
          7. Examples of application
          8. Binomial Coefficients
          9. look at the fifth row (counting from zero) of Pascal’s Triangle and the second element in this row (counting from zero)
          10. Combinatorial Tasks
          11. Suppose you want to find the number of paths from the top-left corner to the bottom-right corner of a grid, moving only down and to the right. For a 2x2 grid, the number of paths is equal to the element in the third row and third element of Pascal's Triangle, which is 6.
          12. Permutations with repetition (Paths through a grid)
          13. Finding the number of distinct paths through an r×s grid, using only steps down and to the right
          14. Expansion of Binomial Powers
          15. use the fourth row of Pascal’s Triangle (1, 4, 6, 4, 1)
          16. Probability Theory
          17. Number of outcomes for tossing a coin 3 times. If you toss a coin 3 times, the number of possible outcomes for each quantity of "heads" corresponds to the third row of Pascal’s Triangle: 1 (no heads), 3 (one head), 3 (two heads), 1 (three heads).
          18. Geometry
        3. Binomial Theorem
          1. The binomial coefficients play a key role in the binomial theorem, which gives the expansion of powers of binomials.
          2. Example
          3. Let's calculate the binomial coefficient for n = 5 and r = 3
          4. So, there are 10 ways to choose 3 elements out of a set of 5.
        4. Application
          1. Combinatorics
          2. They are used to solve problems involving combinations where order does not matter.
          3. Probability
          4. Binomial coefficients can calculate the probabilities in binomial distributions, where there are two possible outcomes (like success and failure).
          5. Algebra
          6. In expanding binomials, they determine the coefficients in the expanded form.
      3. Applications
        1. Designing algorithms
        2. Cryptographic systems
        3. Network optimization
        4. Game theory
      4. Pigeonhole Principle
        1. Basic
          1. Definition
          2. If K+1 objects are placed into K boxes, then at least one box contains two or more objects.
          3. Contrapositive
          4. If no box has more than one object, then the total number of objects would be at most K, which contradicts having K+1 objects.
        2. One-to-One Functions
          1. If the domain of a function F has K+1 elements mapped to K elements, then F is not one-to-one.
          2. Create a box for each element in the co-domain of F.
          3. As there are K+1 elements in the domain and only K boxes, there must be at least one box with more than one element.
          4. Therefore, F is not one-to-one.
        3. Generalized
          1. If N objects are placed into K boxes, then there exists a box with at least ceiling(N/K) objects.
          2. Proof
          3. Assume no box exceeds ceiling(N/K - 1) objects, which contradicts the total being N.
        4. Application
          1. Cards from a Deck
          2. To guarantee at least 4 cards of the same suit, a minimum of 13 cards from a standard deck of 52 cards must be selected.
    3. Statistics
      1. frequency
      2. mean
        1. The mean is the average of all the numbers in a dataset.
        2. You sum up all the numbers and then divide by the total count.
          1. value
          2. amount of value
      3. median
        1. The median is the middle value when you arrange the numbers in ascending order. If there's an even number of values, you take the mean of the two middle numbers.
        2. Median=Middle value in sorted list
      4. variance
        1. Variance measures how spread out the numbers are from the mean.
      5. standard deviation
        1. The standard deviation is the square root of the variance. It's useful because it's in the same units as the data.
      6. mode
        1. Mode=Most frequently occurring value(s)
        2. The mode is the number that appears most frequently in a dataset. A dataset can have zero or more modes. If no number repeats, it's called "no mode." If there are multiple numbers that appear most frequently, it's "multimodal."
      7. Normal distribution (Gaussian distribution)
        1. Key Points
          1. Symmetry
          2. It's symmetrical around the mean, which means the left and right sides are mirror images of each other.
          3. Mean, Median, Mode
          4. In a perfect normal distribution, the mean, median, and mode are all the same and located at the center of the curve.
          5. Standard Deviation
          6. The "width" of the bell curve is determined by the standard deviation (σ). A larger σ means a wider curve, and a smaller σ means a narrower curve.
          7. 68-95-99.7 Rule
          8. About 68% of the data falls within one standard deviation of the mean.
          9. About 95% falls within two standard deviations.
          10. About 99.7% falls within three standard deviations.
        2. Mathematical Expression
          1. μ is the mean
          2. σ is the standard deviation
      8. Chebyshev's Theorem
        1. Chebyshev's Theorem states that no matter what the shape of the distribution, at least a certain percentage of the data must lie within k standard deviations (σ) of the mean (μ).
        2. Key Points
          1. Applicability
          2. Unlike the 68-95-99.7 rule for normal distributions, Chebyshev's Theorem applies to any distribution shape.
          3. k Value
          4. k must be greater than 1. The larger the k, the higher the percentage of data within that range.
  10. Discrete
    1. Predicate Logic
      1. Predicate Logic vs Propositional Logic
        1. Propositional Logic Limitations
          1. Inadequate for expressing complex mathematical statements.
          2. Example
          3. "All men are mortal."
          4. "Socrates is a man."
          5. Conclusion: "Socrates is mortal."
          6. Only deals with propositions (statements with known truth values).
          7. Example
          8. Statement: "X squared is equal to 4."
          9. This is not a proposition as its truth value depends on the value of 'x'.
          10. Propositional logic cannot express this, but predicate logic can.
          11. Propositional logic cannot express complex statements in mathematics precisely
          12. Propositional logic only studies propositions with known truth values
          13. Propositional logic is helpful for studying propositions but has limitations
        2. Predicate Logic Advantages
          1. Overcomes limitations of propositional logic.
          2. Allows for building more complex reasoning.
      2. Introduction
        1. Objective: Understanding the role of predicate logic in addressing the limitations of propositional logic.
        2. Focus: Examining examples that propositional logic can't describe and introducing predicate logic as a solution.
        3. Defining Predicate Logic
          1. Predicate: A generalization of propositions; functions returning true/false based on variables.
          2. Transformation into Proposition: Predicates become propositions when variables are assigned specific values.
        4. Example Analysis
      3. Predicates
        1. Predicates are functions that return a true or false value depending on their variables.
        2. Predicates are generalizations of propositions.
        3. Predicates become propositions when their variables are given actual values.
        4. Examples
          1. with a single parameter
          2. with multiple parameters
        5. Logical Operations
          1. Logical operations from propositional logic can be carried over to predicate logic.
      4. Quantification
        1. Quantifiers
          1. Universal
          2. for all values of x in the universe of discourse
          3. for all x P(x)
          4. If universe of discourse is finite, universal quantifier is conjunction of propositions over all elements
          5. conjunction
          6. Existential
          7. there exists a value x in the universe of discourse
          8. there exists x P(x)
          9. If universe of discourse is finite, existential quantifier is disjunction of propositions over all elements
          10. disjunction
          11. Uniqueness
          12. there exists a unique value of x in the universe of discourse
          13. there exists a unique x P(x)
        2. Nested quantifiers
          1. examples
          2. Variables
          3. Bound
          4. A variable is bound if it is within the scope of a quantifier
          5. Free
          6. A variable is free if it is not bound by a quantifier or particular value
          7. x is bound
          8. y is free
        3. De Morgan's laws for quantifiers
          1. Negation of for all x, P of x is equivalent to there exists x for which not P of x
          2. Negation of there exists x for which P of x is equivalent to for all x not P of x
          3. Application of De Morgan's laws successively from left to right
      5. Rules of Inference
        1. Rules
          1. Modus Ponens
          2. Premises
          3. Conclusion
          4. Modus Tollens
          5. Premises
          6. Conclusion
          7. Conjunction
          8. Premises
          9. Conclusion
          10. Simplification
          11. Premises
          12. Conclusion
          13. Addition
          14. Premises
          15. Conclusion
          16. Hypothetical Syllogism
          17. Premises
          18. Conclusion
          19. Disjunctive Syllogism
          20. Premises
          21. Conclusion
          22. Resolution
          23. Premises
          24. Conclusion
        2. Rules of Inference with Quantifiers
          1. Universal Instantiation
          2. From
          3. Infer
          4. for a specific element c
          5. Example
          6. Premise
          7. Application
          8. Consider a specific number, say 5
          9. Conclusion
          10. Existential Instantiation
          11. From
          12. Infer
          13. for some element c
          14. Example
          15. Premise
          16. Application
          17. Consider a specific bird, say a sparrow.
          18. Conclusion
          19. Sparrow can fly.
          20. Universal Generalization
          21. From
          22. Infer
          23. Example
          24. Premise
          25. Every single apple in a basket is red.
          26. Application
          27. This apple is red, that apple is red, and so on for every apple.
          28. Conclusion
          29. Existential Generalization
          30. From
          31. Infer
          32. Example
          33. Premise
          34. A particular bird, say a robin, can sing.
          35. Application
          36. This robin can sing.
          37. Conclusion
          38. Universal Modus Ponens
          39. From
          40. Infer
          41. Example
          42. Premise
          43. Application
          44. Conclusion
          45. Universal Modus Tollens
          46. From
          47. Infer
          48. Example
          49. Premise
          50. Application
          51. Conclusion
          52. In these rules, P(x) represents a predicate involving the variable x, and c represents a specific constant or element. These rules help in moving between statements about specific elements and general statements about all elements (or the existence of elements) within a domain.
          53. Expressing Complex Statements Using Quantifiers
          54. Determine the universe of discourse of variables
          55. Reformulate the statement by making "for all" and "there exists" explicit
          56. Reformulate the statement by introducing variables and defining predicates
          57. Reformulate the statement by introducing quantifiers and logical operations
        3. Info
          1. Premises
          2. These are statements or propositions that are assumed to be true. They serve as the starting point for logical reasoning.
          3. Conclusion
          4. This is the statement or proposition that logically follows from the premises. It's what you deduce or infer based on the given premises.
          5. Tautology
          6. A tautology is a statement or formula that is true in every possible interpretation. No matter what values you assign to its components, a tautological statement will always be true.
          7. It's like saying "it will either rain or not rain today." This statement is always true because there are no other possibilities besides raining and not raining.
          8. In the context of the Rules of Inference, tautologies can be used to justify certain steps in a logical argument or proof. For instance, some rules might inherently involve tautological statements to ensure the validity of the conclusions drawn from the premises.
        4. How to Use the Rules of Inference:
          1. Identify the Form of the Argument: First, look at the logical structure of the argument you have. Which rule of inference does it resemble? For instance, if you have two premises: "If it rains, the ground will be wet" and "It is raining," this matches the structure of Modus Ponens.
          2. Apply the Rule: Once you've identified the rule, apply it to derive the conclusion. In our example, using Modus Ponens, we conclude: "The ground will be wet."
    2. Propositional Logic
      1. Key Concepts
        1. Propositions
          1. In propositional logic, propositions are statements that can be either true or false but not both. They are the basic building blocks of logical reasoning. For example, "The sky is blue" and "2 + 2 = 5" are propositions.
          2. Definition of a Proposition: In the realm of mathematics and logic, a proposition is a declarative sentence that can have only one of two truth values: true or false. It serves as the fundamental building block for logical reasoning.
        2. Logical Connectives
          1. And (∧): Represents logical conjunction. It is true only when both propositions are true.
          2. Or (∨): Represents logical disjunction. It is true when at least one of the propositions is true.
          3. Not (¬): Represents negation. It reverses the truth value of a proposition.
          4. Implies (→): Represents implication. It indicates that if the first proposition is true, the second must also be true.
          5. If and Only If (↔): Represents biconditional. It is true when both propositions have the same truth value.
        3. Examples of Propositions
          1. True Propositions
          2. "London is the capital of the United Kingdom."
          3. "1 plus 1 equals 2."
          4. "2 is less than 3."
          5. False Propositions
          6. "Madrid is the capital of France."
          7. "3 is less than 2."
          8. "10 is an odd number."
        4. Non-Propositional Sentences
          1. Sentences involving variables without assigned values, e.g., "x + 1 equals 2."
          2. Non-declarative questions, e.g., "What time is it?"
          3. Imperative statements, e.g., "Read this carefully."
          4. Statements with vague or relative meanings, e.g., "This coffee is strong."
        5. Propositional Variables
          1. To streamline notations and avoid repetition, propositional variables (usually denoted as p, q, r, etc.) are employed. These variables represent propositions.
      2. Truth Tables and Truth Sets
        1. Truth Tables
          1. When dealing with complex propositions, we need a systematic method to determine their truth values. Truth tables serve as a tool to represent all possible combinations of truth values for propositional variables.
          2. Definition
          3. A truth table is a tabular representation that exhaustively lists all possible combinations of truth values for its constituent propositional variables.
          4. Constructing a Truth Table
          5. Number of Rows
          6. For n propositional variables, create a table with 2^n rows and n columns.
          7. Filling Values
          8. Fill the n columns with all possible combinations of truth values, usually starting with false values.
          9. Example
          10. Consider three propositional variables, p, q, and r. The truth table will have eight rows, with columns for p, q, and r. Values will alternate to represent all possible combinations
          11. Truth tables help manage and analyze the truth values of complex propositions by systematically listing all possible combinations of truth values for propositional variables.
        2. Truth Set
          1. Truth Set of a Proposition
          2. Let p be a proposition defined on a set S. The truth set of p, denoted as capital P, is the set of elements in S for which p is true.
          3. Example
          4. Scenario
          5. et S be the set of integers from 1 to 10. Define two propositions concerning an integer n in S:
          6. Proposition p: "n is even."
          7. Proposition q: "n is odd."
          8. Truth Sets
          9. The truth set of p, denoted as capital P, includes integers 2, 4, 6, 8, and 10.
          10. The truth set of q, denoted as capital Q, includes integers 1, 3, 5, 7, and 9.
          11. A truth set, denoted as capital P for a proposition p, is the set of elements in a given set for which p is true.
      3. Compound Propositions
        1. Negation (Not Operator)
          1. Negation of a Proposition (not p)
          2. If p is a proposition, then the negation of p, denoted as not p, is the statement "It is not the case that p." The truth value of not p is the opposite of the truth value of p.
          3. Example
          4. For proposition p, "John's program is written in Python," the negation not p is the proposition "John's program is not written in Python."
        2. Conjunction (And Operator)
          1. Conjunction of Propositions (p and q)
          2. Given propositions p and q, the conjunction p and q is true only when both p and q are true; otherwise, it is false.
          3. Example
          4. If p is "John's program is written in Python" and q is "John's program has less than 20 lines of code," then p and q is "John's program is written in Python and has less than 20 lines of code."
        3. Disjunction (Or Operator)
          1. Disjunction of Propositions (p or q)
          2. Given propositions p and q, the disjunction p or q is false only when both p and q are false; otherwise, it is true.
          3. Example
          4. If p is "John's program is written in Python" and q is "John's program has less than 20 lines of code," then p or q is "John's program is written in Python or has less than 20 lines of code."
        4. Exclusive-Or (XOR Operator)
          1. Exclusive-Or of Propositions (p xor q)
          2. Given propositions p and q, the exclusive-or p xor q is true only when either p is true and q is false or p is false and q is true, but not both.
          3. Example
          4. If p is "John's program is written in Python" and q is "John's program has less than 20 lines of code," then p xor q is "John's program is written in Python or has less than 20 lines of code, but not both."
        5. Order of Precedence
          1. Parentheses for Clarity
          2. When combining propositions, use parentheses to clarify the order of operations. The meaning of propositions can vary based on the arrangement of parentheses.
          3. Order of Precedence
          4. To reduce the number of parentheses, you can use an order of precedence, which determines the sequence of logical operations.
      4. Logical Implication
        1. Conditional Statements
          1. Conditional statements are propositions of the form "if p then q," where p is the hypothesis, and q is the conclusion or consequence.
          2. Example
          3. Consider propositions p and q: p is "John did well in discrete mathematics," and q is "John will do well in the programming course." The conditional statement is "If John did well in discrete mathematics, then John will do well in the programming course."
          4. Truth Table
          5. Logical Reasoning
          6. Conditional statements represent reasoning from p to q. If the reasoning is correct (true implication), when the hypothesis is true, the conclusion is also true. In the case of incorrect reasoning (false implication), when the hypothesis is true, the conclusion is false. If the hypothesis is false, any conclusion can be implied, whether false or true.
          7. Variations
          8. If p then q
          9. If p, q
          10. p implies q
          11. p only if q
          12. q follows from p
          13. p is sufficient for q
          14. q unless not p
          15. q is necessary for p
          16. Related Statements
          17. converse
          18. The converse of p implies q is q implies p.
          19. contrapositive
          20. The contrapositive of p implies q is not q implies not p.
          21. inverse
          22. The inverse of p implies q is not p implies not q.
          23. Example
        2. Logical Equivalence
          1. Equivalence Operator
          2. Let p and q be propositions. The biconditional or equivalent statement, "p equivalent to q," is the proposition p implies q and q implies p. It is also represented as "p if and only if q." The statement "p equivalent to q" is true when p and q have the same truth values and false otherwise.
          3. Equivalence of Propositions
          4. Logical Equivalence
          5. Two propositions, p and q, are considered logically equivalent if they always have the same truth value, denoted as "p equivalent to q." This concept is different from equivalent statements.
          6. Determining Equivalence
          7. Equivalence can be determined by using truth tables to check whether two propositions have the same truth values for all possible combinations.
      5. Translation
      6. Logic Laws
        1. Propositional
          1. Idempotent Laws
          2. p or p is equivalent to p.
          3. p and p is equivalent to p.
          4. Commutative Laws
          5. p or q is equivalent to q or p.
          6. p and q is equivalent to q and p.
          7. Associative Laws
          8. The conjunction and disjunction operators can be distributed over one another.
          9. Distributive Laws
          10. The order in which operators are performed doesn't matter as long as their sequence remains the same
          11. Identity Laws
          12. p or false is equivalent to p.
          13. p and true is equivalent to p.
          14. Domination Laws
          15. p or true is always equivalent to true.
          16. p and false is always equivalent to false.
        2. DeMorgan's Laws
          1. Formalize negation of conjunction and disjunction.
          2. Negation of disjunction (p or q) is equivalent to (not p and not q).
          3. Negation of conjunction (p and q) is equivalent to (not p or not q).
        3. Absorption Laws
          1. p or (p and q) is equivalent to p.
          2. p and (p or q) is equivalent to p.
        4. Negation Laws
          1. p or not p is always true (tautology).
          2. p and not p is always false.
        5. Double Negation Law:
          1. not not p is equivalent to p.
        6. Tables
    3. Boolean Algebra
      1. History
        1. Aristotle established the foundations of logic between 384 and 322 BC
        2. George Boole developed a system of logical algebra in 1854
        3. Huntington defined the six rules of Boolean algebra in 1904
        4. Claude Shannon investigated Boolean algebra for analyzing relay switching circuits in 1938
        5. Boolean algebra is the foundation of computer circuits analysis
      2. Basic Operations
        1. AND
          1. Logical product representing logical conjunction
          2. 2
        2. OR
          1. Logical sum
          2. 3
        3. NOT
          1. Logic complement
          2. 1
      3. Postulates
        1. Huntington's
          1. Closure: The value of any Boolean operation is either zero or one.
          2. Identity: The value of x + 0 and x.1 is always equal to the value of x.
          3. Commutativity: Plus and dot are both commutative. That is, x + y equals y + x and x.y equals y.x.
          4. Complements: The logical sum of x and its corresponding complement is always equal to one, while the logical product of x and its corresponding complement is always equal to zero.
          5. Distance Elements: Any Boolean algebra has to have two distinct values.
        2. Basic Theorems
          1. Idempotent laws: For any logical variable x, x + x equals x and x.x equals x.
          2. Tautology and contradiction: For any logical variable x, x + 1 is a tautology as its value is always equal to one, whereas x.0 is a contradiction as its value is always equal to zero.
          3. Involution: For any logical variable x, the value of applying the complement twice on x is always equal to x.
          4. Associative laws: Given any three logical variables x, y, and z, we have x + (y + z) = (x + y) + z and x.y.z = (x.y).z.
          5. Absorption laws: Given any two logical variables x and y, we have x + (x.y) = x and x.(x + y) = x.
          6. Uniqueness of complements: Given any two logical variables x and y, if y + x = 1 and y.x = 0, then x = complements of y.
          7. Inversion law: The complement of zero is equal to one and the complement of one is equal to zero.
        3. De Morgan's Theorems
          1. The complement of a product of variables is equal to the sum of the complements of the variables: complements of x.y = complements of x + complements of y.
          2. The complement of a sum of variables is equal to the product of the complements of the variables: complements of (x + y) = complements of x . complements of y.
        4. Distributivity of plus over dot
        5. Principle of Duality
          1. Every theorem in Boolean algebra remains valid if we interchange all ANDs and ORs and interchange all zeros and ones.
        6. Equivalence Proving Methods
          1. Perfect induction: Showing that two expressions have identical truth tables.
          2. Axiomatic proof: Applying Huntington's postulates or other rules and theorems.
          3. Duality principle: Interchanging ANDs and ORs and zeros and ones.
          4. Contradiction: Assuming the hypothesis is false and showing it leads to a false conclusion.
        7. Proof of Absorption Rule
          1. By writing the truth table or using the rules, we can prove that x + (x.y) = x and x.(x + y) = x.
          2. By applying the duality principle, we can also deduce that x.(x + y) = x.
      4. Boolean functions
        1. Definition
          1. Boolean function: mapping from Boolean input value(s) to a Boolean output value
          2. n Boolean input values result in 2^n possible combinations
        2. Algebraic Form
          1. f(x) = x + x'y
          2. f(x) = x + y
        3. Standardized Forms
          1. Sum of products form: values built using the AND operator, summed using the OR operator
          2. Product of sums form: values built using the OR operator, multiplied using the AND operator
        4. Useful Boolean Functions
          1. Exclusive OR Function (XOR)
          2. xor(x, y) = x'y + xy' (true if either x or y is true, but not both)
          3. Implies Function
          4. implies(x, y) = x' + y (true if x implies y)
      5. Logic Gates
        1. Introduction
          1. Definition: electronic circuit with single or multiple inputs and single or multiple outputs
          2. Outputs are logical functions of inputs
          3. Basic logic gates: OR, AND, NOT
        2. Variants
          1. Basic Logic Gates
          2. OR
          3. High output if at least one input is high
          4. Truth table: f = x + y
          5. AND
          6. High output if all inputs are high
          7. Truth table: f = x * y
          8. NOT
          9. Output is opposite of input
          10. Truth table: f = not x
          11. Additional
          12. XOR
          13. High output if inputs are different
          14. NAND
          15. AND gate followed by an inverter
          16. NOR
          17. OR gate followed by an inverter
          18. XNOR
          19. XOR gate followed by an inverter
          20. Multiple Input Gates
          21. AND, OR, XOR, and XNOR operations can be extended to more than two inputs
          22. NAND and NOR operations are commutative but not associative
          23. De Morgan's Laws
          24. The complement of the product of variables is equal to the sum of the compliments of the variables
          25. The complement of the sum of variables is equal to the product of the compliments of the variables
        3. Combinational Circuits
          1. Introduction
          2. Combination circuits are logic networks designed to model Boolean functions
          3. They implement a Boolean function, where the output values depend on the current input configuration
          4. We want to minimize the number of gates to reduce the circuit's cost
          5. Building a Logic Network
          6. Label the gates' outputs that depend on input variables
          7. Express the Boolean functions for each gate in the first level
          8. Repeat this process for subsequent levels until all outputs are written as Boolean expressions
          9. Designing Systems for Specific Problems
          10. Label inputs and outputs using variables
          11. labelling
          12. Model the problem as a Boolean expression
          13. modelling
          14. Replace each operation with its equivalent logic gates
          15. replacing
          16. Half Adder
          17. Used to add two 1-digit binary bits
          18. Sum is the output of XOR gate
          19. Carry can be represented by AND gate
          20. Full Adder
          21. Overcomes limitations of half adder for multi-bit additions
          22. Has 3 inputs: x, y, and carry in
          23. Express sum as x XOR y XOR carry in
          24. Express carry out as xy + carry in
          25. the key functions of a full adder circuit
          26. Binary Addition: It adds two binary digits plus a carry-in from a less significant bit position.
          27. Sum Output: It produces a sum output, which is the result of the addition of the two input bits and the carry-in.
          28. Carry Output: It generates a carry-out, which is used as a carry-in for the addition of the next pair of higher significant bits.
          29. table
          30. Simplification
          31. Purpose
          32. reducing global cost, computation time, and increasing circuit density
          33. Algebraic simplification
          34. Use of Boolean algebra paradigms to simplify Boolean functions
          35. Theorems/rules for simplification: De Morgan's laws, distributive laws, commutative, idempotent, complement laws, and absorption law
          36. Karnaugh maps
          37. K-maps
          38. Example
          39. 0
          40. 1
      6. Tables
    4. Proofs
      1. Definitions and Terminology
        1. Proof
          1. A valid argument used to prove the truth of a statement.
        2. Theorem
          1. A formal statement that can be shown to be true.
        3. Axiom
          1. A statement assumed to be true to serve as a premise for further arguments.
        4. Lemma
          1. A proven statement used as a step to a larger result.
        5. Corollary
          1. A theorem that can be established by a short proof from another theorem.
      2. Types
        1. Direct Proof
          1. Direct proof is based on showing that a conditional statement, p implies q, is true. It starts by assuming that p is true and then uses axioms, definitions, theorems, and rules of inference to show that q must also be true.
          2. Example
          3. For example, let's consider the theorem stating that there exists a real number between any two not equal real numbers. This can be proven using a direct proof by assuming that x and y are arbitrary elements in R, and let z be the real number (x + y) / 2. It can be shown that z satisfies x < z < y. Therefore, the statement holds for all x and y in R.
        2. Proof by Contraposition
          1. Proof by contraposition is based on the fact that proving the conditional statement p implies q is equivalent to proving its contrapositive, not q implies not p. It starts by assuming that not q is true and then uses axioms, definitions, theorems, and rules of inference to show that not p must also be true.
          2. Example
          3. For example, the theorem stating "If n squared is even, then n is even" can be proven using the contrapositive. By assuming that n is odd, it can be shown that n squared is also odd. Therefore, the contrapositive holds and the original statement is true.
        3. Proof by Contradiction
          1. Proof by contradiction is based on assuming that the statement to be proved is false and then showing that this assumption leads to a false proposition. It starts by assuming that not p is true and then uses axioms, definitions, theorems, and rules of inference to show that not p is false. From this, it can be concluded that the initial assumption was wrong, so p must be true.
          2. Example
          3. For example, the theorem stating "There are infinitely many prime numbers" can be proven using a proof by contradiction. By assuming that there are only finitely many prime numbers and listing them as p_1, p_2, p_3, etc., it can be shown that there exists a number c that is a product of all the prime numbers plus 1. From this, it can be derived that c has at least one prime divisor, which contradicts the assumption that there are only finitely many prime numbers.
      3. Mathematical Induction
        1. Definition
          1. Mathematical induction is a method used to prove that a propositional function, P(n), is true for all positive integers, n.
          2. Induction can be formalized using the following rule of inference: P(1) is true, and for all k, P(k) implies P(k+1).
        2. Intuition
          1. Induction is based on the idea that if P is true for a base case (e.g., P(1)), and if P being true for one case implies P being true for the next case (e.g., P(k) implies P(k+1)), then P is true for all cases.
        3. Structure of Induction
          1. Basic step: Show that P(1) is true.
          2. Inductive step: Show that for all k in n, if P(k) is true (inductive hypothesis), then P(k+1) is also true.
        4. Applications
          1. Formulas
          2. Inequalities
          3. Divisibility
          4. Properties of subsets and their cardinality
        5. Proof by Induction
          1. Introduction
          2. Induction can be used to prove formulas, inequalities, and divisibility
          3. Two steps for proving a propositional function P of n:
          4. Basis step: show P of 1 is true
          5. Inductive step: show if P of k is true, then P of k plus 1 is true for all k in n
          6. Examples
          7. Proving a Formula
          8. Proving the formula: the sum from 1 to n is equal to n times (n plus 1) divided by 2
          9. Basis step: P of 1 is true
          10. Inductive step: Assuming P of k is true, show P of k plus 1 is true
          11. Proving an Inequality
          12. Proving the inequality: 3 to the power of n is less than n factorial for n >= 7
          13. Basis step: P of 7 is true
          14. Inductive step: Assuming P of k is true, show P of k plus 1 is true
          15. Proving Divisibility
          16. Proving the divisibility: 6 to the power of n plus 4 is divisible by 5
          17. Basis step: P of 0 is true
          18. Inductive step: Assuming P of k is true, show P of k plus 1 is true
          19. Incorrect Induction
          20. Statement: the sum from i equals 0 to n minus 1 of 2 to the power of i is equal to 2 to the power of n for all n in n
          21. Incorrectly assumed that the statement holds true for all n
          22. Base case and inductive step were verified, but the statement is false
          23. To avoid false conclusions, both the base case and the inductive step must be verified
        6. Strong Induction
          1. Principle
          2. In ordinary induction, you prove a base case, say P(1), and then show that if P(k) is true, P(k+1) is also true.
          3. In strong induction, you assume that the statement is true for all values less than or equal to a certain number k (i.e., P(1), P(2), ..., P(k)) and use this to show that P(k+1) is true.
          4. Why Use Strong Induction?
          5. It's used when the proof of P(k+1) depends not just on P(k) but on several or all of the previous cases.
          6. Steps in a Strong Induction Proof
          7. Base Case
          8. rove the statement for the initial value(s), just like in ordinary induction. This could be for one or more initial values (e.g., P(1), P(2)).
          9. Inductive Step
          10. Assume P(i) is true for all i ≤ k, where k is some positive integer. Then prove that P(k+1) is true under this assumption.
          11. Example
          12. Proving properties in sequences or series where each term depends on multiple previous terms.
          13. Establishing correctness of algorithms, especially recursive ones.
          14. Why It's "Strong"
          15. It's not stronger in the sense of proving more statements true. Rather, it's a more flexible tool in your mathematical toolkit, allowing you to tackle problems that ordinary induction can't handle as easily.
          16. Tips for Writing Strong Induction Proofs
          17. Clearly state the property P(n) you want to prove.
          18. Don't forget to prove the base case(s) thoroughly.
          19. In the inductive step, clearly state your inductive hypothesis (that P(i) is true for all i ≤ k).
          20. Show how this hypothesis helps you prove P(k+1).
    5. Recursive
      1. Definitions
        1. Introduction
          1. Recursion allows for defining objects in terms of themselves
          2. Recursive definitions are used for functions, sets, and algorithms
        2. Recursively Defined Functions
          1. A function is recursively defined by a basis step and a recursive step
          2. Basis step: specifies the initial value of the function
          3. Recursive step: provides a rule for finding the value of the function at an integer from its values at smaller integers
        3. Recursively Defined Sets
          1. Sets can also be defined recursively
          2. Basis step: specifies some initial elements
          3. Recursive step: provides a rule for constructing new elements from those already defined
          4. Example: Set S contains all positive integers that are multiples of four
        4. Recursive Algorithms
          1. An algorithm is a finite sequence of precise instructions for solving a problem
          2. Recursive algorithms solve a problem by reducing it to a smaller instance of the same problem
          3. Example: Recursive algorithm for computing n factorial
          4. Basis step: 0 factorial equals 1
          5. Recursive step: n factorial equals n multiplied by (n-1) factorial
      2. Recurrence Relations
        1. First-order Recurrence
          1. Example: Modeling country's population growth
          2. Linear recurrence equation: an+1 = 1.01an + 50,000
          3. This describes a sequence where each term is a linear combination of only the previous term plus a constant.
        2. Second-order Recurrence
          1. Example: Fibonacci sequence
          2. Linear recurrence equation: an = an-1 + an-2
          3. Each term is a linear combination of the previous two terms.
        3. Arithmetic Sequences
          1. Definition and properties
          2. Definition: A sequence where each term differs from the next by a constant amount (common difference).
          3. Properties: Easy to compute, used for simple uniform series.
          4. Example: Common difference
        4. Geometric Sequences
          1. Definition and properties
          2. A sequence where each term is obtained by multiplying the previous term by a constant (common ratio).
          3. Used in exponential growth/decay models, compound interest calculations.
          4. Example: Common ratio
        5. Divide and Conquer Algorithms
          1. Three steps: divide, solve, combine
          2. Divide: Break the problem into smaller subproblems.
          3. Solve: Solve each subproblem (often recursively).
          4. Combine: Combine solutions of subproblems to form the solution to the original problem.
          5. Example: Finding minimum of a sequence
      3. Solving Recurrence Relations
        1. Linear Recurrence
          1. General form
          2. Characteristic equation
          3. If r is a solution with multiplicity p, the combination satisfies the recurrence
        2. Fibonacci Recurrence
          1. General form
          2. Characteristic equation
          3. Distinct roots
          4. Solution
          5. Use initial conditions to find
        3. Using Strong Induction
    6. Graphs
      1. Definition
        1. Graph G represented as VE
          1. V - set of nodes or vertices
          2. E - set of edges, lines, or connections
        2. Vertices
          1. Basic elements of a graph
          2. Usually represented as nodes or dots
          3. Set of vertices denoted as V(G) or just V
        3. Edges
          1. Links between two vertices
          2. Usually represented as lines
          3. Set of edges denoted as E(G) or just E
        4. Adjacency
          1. Vertices are adjacent if they are endpoints of the same edge
          2. Edges are adjacent if they share the same vertex
          3. If vertex v is an endpoint of edge e, then e and v are incident
        5. Loops and Parallel Edges
          1. Loops: edge that connects a vertex to itself
          2. Parallel edges: multiple edges between the same pair of vertices
        6. Directed Graphs
          1. Edges have a direction, indicated by arrows
          2. digraph
        7. A graph is a discrete structure consisting of vertices or nodes and edges connecting them
      2. Applications
        1. Computer science uses graph theory to create abstractions of real-world problems that can be represented, understood, and manipulated by computers
        2. Graphs can model associations or connections between items in various domains, such as course scheduling, computer networks, roadmaps, and organization structures
        3. The first problem in graph theory was the Seven Bridges of Königsberg problem, solved by Leonhard Euler in 1735
        4. Real-World Applications
          1. Modeling computer networks
          2. Modeling roadmaps
          3. Solving shortest path problems
          4. Assigning jobs in an organization
          5. Distinguishing chemical compound structures
      3. Walks and Paths
        1. Walk
          1. A sequence of vertices and edges where vertices and edges can be repeated.
        2. Trail
          1. A walk in which no edge is repeated. Vertices can be repeated.
        3. Circuit
          1. A closed trail where vertices can be repeated.
        4. Path
          1. A trail in which neither vertices nor edges are repeated.
        5. Cycle
          1. A closed path consisting of edges and vertices, where the last vertex is reachable from the first.
        6. Named Paths
          1. Euler Path
          2. A path that uses each edge of the graph precisely once, making the graph traversable.
          3. Euler Circle
          4. If a graph has an Euler circuit, then every vertex of the graph has a positive even integer
          5. Hamiltonian Path
          6. A path that visits each vertex of a graph exactly once.
          7. Hamiltonian Cycle
          8. A cycle that visits each vertex exactly once, except for the starting vertex which is visited once at the start and once again at the end.
      4. Graph Connectivity
        1. Connected Graph
          1. A graph in which any two vertices are connected by a path.
        2. Strongly Connected Digraph
          1. A strongly connected digraph is a directed graph in which it is possible to reach any node starting from any other node by traversing edges in the direction(s) in which they point.
        3. Transitive Closure
          1. The digraph G* where there is a directed edge from U to V if there is a directed path from U to V.
      5. Degree Sequence
        1. Vertex Degree
          1. The degree of a vertex in a graph is the number of edges incident to the vertex.
          2. An isolated vertex has a degree: 0
          3. In directed graphs, it is distinguished between in-degree (number of edges for which the vertex is the terminal vertex) and out-degree (number of edges for which the vertex is the initial vertex).
          4. A loop contributes twice to the degree.
        2. Degree Sequence
          1. For an undirected graph G, the degree sequence is a sequence of the degrees of each vertex in G written in descending order, separated by commas.
          2. Properties
          3. The sum of the degree sequence is always even.
          4. The sum of the degree sequence is twice the number of edges in the graph.
          5. Example
          6. Consider a graph with vertex degrees 4, 3, 3, 2, 1, 1. The sum of the degree sequence is 14. This indicates the graph has 7 edges.
          7. directed graph
          8. The degree sequence of a directed graph is the list of its indegree and outdegree pairs
      6. Special graphs
        1. Simple Graphs
          1. A simple graph contains no loops and no parallel edges.
          2. The degree of each vertex of a simple graph with n vertices is at most n-1.
          3. Example
        2. Regular Graphs
          1. An r-regular graph has all vertices with the same number of neighbors and degree.
          2. Properties
          3. Degree sequence of an r-regular graph is r, r, r repeated n times
          4. Number of edges = r*n/2
          5. r*n should be even
          6. Examples
        3. Complete Graphs
          1. A complete graph has every pair of vertices adjacent.
          2. Properties of complete graphs with n vertices
          3. Every vertex has a degree of n-1
          4. Sum of degree sequence = n*(n-1)
          5. Number of edges = n*(n-1)/2
          6. Examples
        4. Isomorphic Graphs
          1. Definition
          2. Two graphs, G1 and G2, are isomorphic if there is a bijection, an invertible function F, mapping all vertices of G1 to vertices of G2, preserving adjacency and non-adjacency.
          3. If vertices U and V in G1 with edge uv, then F(u), F(v) is an edge in G2, preserving adjacency.
          4. Properties
          5. Degree Sequences
          6. Graphs with different degree sequences are not isomorphic.
          7. Graphs with the same degree sequences are not necessarily isomorphic.
        5. Bipartite graphs
          1. Definition
          2. A graph G is bipartite if the set of vertices V can be divided into two sets V₁ and V₂, and each edge is between V₁ and V₂.
          3. Vertices can be divided into two sets - V1 and V2
          4. Each edge connects a vertex in V1 with a vertex in V2
          5. Matching
          6. Matching: A set of pairwise non-adjacent edges.
          7. Maximum Matching: A matching of maximum size.
          8. Vertex is matched if it is an endpoint of a matching edge.
          9. Hopcroft-Karp Algorithm
          10. Augmenting path: Increases the cardinality of the current matching.
          11. An augmenting path is a path in a bipartite graph that begins and ends with unmatched vertices (vertices not included in the current matching) and alternates between edges that are not in the matching and those that are. This means the path starts with an edge not in the current matching, the next edge is in the matching, the following is not, and so on.
          12. Breadth-first search (BFS)
          13. Traverses the graph level by level
          14. Depth-first search (DFS)
          15. Traverses a graph all the way to a leaf before starting another path
          16. Used to find the maximum matching in a bipartite graph
          17. Follows a pseudocode involving breadth-first and depth-first search
          18. Explanation
      7. Adjacency Matrix
        1. Adjacency List
          1. The adjacency list of a graph is a list of vertices and their corresponding adjacent vertices
        2. Adjacency Matrix
          1. A graph can also be represented by its corresponding adjacency matrix.
          2. digraph
        3. Properties
          1. The adjacency matrix of an undirected graph is symmetric.
          2. The number of edges in an undirected graph is half the sum of all the elements of its adjacency matrix.
          3. For example, the sum of the adjacency matrix's elements is equal to the sum of the degree sequence of the undirected graph and a half of of the degree sequence of the directed graph.
        4. Matrix powers
          1. If A is the adjacency matrix of the directed or undirected graph G, then the matrix A^n (i.e., the matrix product of n copies of A) has an interesting interpretation: the element (i, j) gives the number of (directed or undirected) walks of length n from vertex i to vertex j.
          2. If n is the smallest nonnegative integer, such that for some i, j, the element (i, j) of A^n is positive, then n is the distance between vertex i and vertex j.
      8. Dijkstra's Algorithm
        1. Definition
          1. Dijkstra's algorithm is used to compute the shortest path between two vertices in a weighted graph.
          2. It works in two steps:
          3. Initialization: Initialize distances from A to all vertices and the unvisited list.
          4. Pic
          5. Set distance from start vertex A to itself as 0.
          6. Set distance from start vertex A to all other vertices as infinity.
          7. Previous vertex is initialized to undefined.
          8. Update unvisited list with all nodes of the graph.
          9. Update Step: Iteratively visit unvisited vertices, calculate distances, and update the table until completion.
          10. Pic
          11. For each visited vertex, examine its unvisited neighbors and calculate their distances from A.
          12. Update the shortest distances for the neighbors if the calculated distances are less.
          13. Update the previous vertex column for visited neighbors.
          14. Remove the visited vertex from the unvisited list.
        2. Application
          1. It can be used in various scenarios such as modeling the distance between cities, response time in a communication network, or cost of a transaction.
      9. Trees
        1. Application
          1. Finding the shortest path in a graph.
          2. Constructing efficient algorithms to locate items in a list.
          3. Modeling procedures carried out using a sequence of decisions.
          4. Binary tree as a fundamental data structure in high-level programming.
        2. Definition
          1. Acyclic Graph
          2. An acyclic graph has no cycles, loops, or parallel edges.
          3. Tree
          4. A tree is an undirected graph that is connected and acyclic.
          5. Properties
          6. 1. A tree is a connected graph with a unique simple path between any pair of vertices.
          7. 2. A tree with n vertices has exactly n-1 edges.
          8. Forest
          9. In graph theory, a cycle-free disconnected graph is called a forest.
        3. Spanning Trees
          1. Definition
          2. A spanning tree of a connected graph is a subgraph that is a tree containing all the vertices of the original graph.
          3. Properties
          4. A graph with n vertices has n-1 edges in its spanning tree.
          5. A spanning tree does not contain any cycles.
          6. Removal of any edge from a spanning tree results in a disconnected graph.
          7. Algorithms for Finding
          8. Depth-First Search (DFS): Traverses the graph depth-wise, ensuring a spanning tree is formed.
          9. Breadth-First Search (BFS): Explores the neighbors of the vertices horizontally to construct a spanning tree.
          10. Minimum Spanning Tree
          11. A minimum spanning tree of a weighted graph is the spanning tree with the minimum total edge weight.
          12. Prim's and Kruskal's algorithms are commonly used to find the minimum spanning tree of a graph.
          13. Kruskal's Algorithm
          14. Start with: Cheapest edge, add cheapest edges to keep it connected without cycles
          15. Prim's Algorithm
          16. Starting node: Choose any node and iteratively add the least-weight edge to connect nodes
          17. Weight of Spanning Tree
          18. Sum of edge weights in the tree
          19. A minimum cost spanning tree connects all vertices in a graph with the lowest overall edge weight.
          20. Isomorphic
          21. Two spanning trees are isomorphic if there exists a bijection preserving adjacency between them.
          22. Non-Isomorphic
        4. Rooted Trees
          1. Definition
          2. A rooted tree has a designated root vertex, and every edge is directed away from the root.
          3. A directed tree with one vertex as the root.
          4. Property
          5. Each vertex has a directed path from the root.
          6. Depth
          7. Number of edges from root to a node. (Path length)
          8. Height
          9. Longest path from node to leaf.
          10. Terms
          11. Parent
          12. Children
          13. Ancestor
          14. Siblings
          15. Internal
          16. External Nodes
          17. Special Trees
          18. Binary Tree
          19. Max two children per vertex.
          20. Ternary Tree
          21. Max three children per vertex.
          22. m-ary Tree
          23. Max m children per vertex.
          24. Regular m-ary Tree
          25. Each internal node has m children.
          26. Properties
          27. Isomorphic Trees
          28. Definition
          29. Two trees are isomorphic if there's a bijective map preserving adjacency.
          30. Isomorphism
          31. Rooted trees are isomorphic if there's a bijection mapping roots.
        5. Binary Search
          1. Definition
          2. A binary search tree (BST) is a binary tree data structure where each node has at most two children, referred to as the left child and right child, with the left child's key being less than the parent's key and the right child's key being greater.
          3. Uses
          4. BSTs are commonly used for searching, inserting, and deleting elements in logarithmic time complexity, making them efficient data structures for many operations.
          5. Building a Binary Search Tree
          6. Start with an empty tree
          7. Insert nodes one by one following the key comparison rules
          8. Nodes on the left have keys less than the parent node, and nodes on the right have keys greater
          9. Storing Records
          10. For each side, add the minimum to the maximum, divide it by two and take the floor of the result.
          11. External nodes (green rectangles) can store additional records.
          12. Height
          13. The height of a binary search tree depends on the order of insertion of records.
          14. In the best-case scenario with balanced input, the height is logarithmic, while in the worst-case scenario of skewed input, the height can be linear.
          15. Example
          16. if N = 15, height is 4 using both methods.
          17. Algorithm
          18. Compare search element to middle term of the list.
          19. Split list into two sub-lists based on comparison.
          20. Continue search in appropriate sub-list.
      10. Relations
        1. Intro
          1. Overview
          2. Relations connect two entities, whether living or non-living.
          3. Common relationships include familial ties (e.g., mother-daughter, brother-sister), employment relations, and associations in computer science.
          4. Mathematical
          5. Study relationships like divisibility of positive integers, relations between real numbers, and function evaluations.
          6. Define relationships between elements of sets and within the same set.
          7. Properties
          8. Further exploration of the characteristics and behaviors of mathematical relations.
          9. Understanding the various properties inherent to different types of relations.
          10. Motivation
          11. Recognizing the importance of relations in mathematical analysis and problem-solving.
          12. Building a foundation for understanding complex mathematical concepts through relation theory.
        2. Definition
          1. A relation is a set of ordered pairs where the first element in each pair is related to the second element.
          2. Relation vs. Function
          3. A relation R is a set of ordered pairs (x, y) where x is related to y.
          4. A function is a special type of relation where each element in the domain is related to exactly one element in the co-domain.
          5. Examples
          6. Cartesian Product
          7. The Cartesian product of sets A and B is a set of pairs
          8. Formal Definition
          9. Binary Relation
          10. A binary relation from set A to B is a subset of A x B. It consists of ordered pairs (x, y) where x is from A and y is from B, indicating that x is related to y.
        3. Matrix and Graph
          1. Intersection
          2. Intersection Notation
          3. Definition
          4. Combining Relations
          5. Union Calculation
          6. using matrix join operation.
          7. Intersection Calculation
          8. using matrix meet operation.
          9. Graphical Representation of a Relation
          10. A relation on set A can be represented by a digraph with vertices as elements of A
          11. Relation Defined by Division
          12. Consider
          13. Relation using Matrix
          14. Matrix Representation of Specific Relations
          15. Relation: Strictly Less Than
          16. Relation: Less Than or Equal To
        4. Properties
          1. Reflexive Relations
          2. A relation R on set S is reflexive if for all x ∈ S, xRx holds.
          3. Example of Reflexive Relation
          4. Let R be on Z such that a ≤ b. This is a reflexive relation as a ≤ a for all a ∈ Z.
          5. Example of Non-Reflexive Relation
          6. For all x elements of Z, we have x !< x hence x !R x
          7. Digraph
          8. Digraph has a loop on each element of S
          9. Example
          10. S={1,2,3,4}, R={(a,b) | a,b ∈ S, a ≤ b}
          11. Matrix
          12. Adjacency matrix M_r of a reflexive relation has all diagonal elements as 1
          13. Reflexivity
          14. Every element is related to itself.
          15. Symmetric Relations
          16. A relation R on set S is symmetric if for all a,b in S, aRb implies bRa
          17. Example
          18. R={(a,b) | a,b ∈ Z, a mod 2 = b mod 2} is symmetric
          19. Digraph
          20. Digraph contains symmetric pairs of arcs
          21. Matrix
          22. Matrix M_r is symmetric if R is symmetric
          23. Symmetry
          24. Relations are bidirectional between related elements.
          25. Anti-symmetric Relations
          26. A relation R on set S is anti-symmetric if for all x, y ∈ S, if xRy and yRx, then x = y.
          27. Example
          28. If R relates a to b and b to a, then a = b for R to be anti-symmetric.
          29. R={(a,b) | a,b ∈ Z, a ≤ b} is anti-symmetric
          30. Digraph
          31. No parallel edges between different vertices in the digraph
          32. Matrix
          33. Element M_ij ≠ 0 implies M_ji = 0 for anti-symmetry
          34. Anti-symmetry
          35. If two elements relate to each other, they must be the same.
          36. Transitivity
          37. Digraph
          38. Transitive relations can be visually represented by digraphs where nodes represent elements of the set S, and edges display the relation between elements.
          39. Transitive Closure
          40. The transitive closure of a relation R on a set S is the smallest transitive relation that contains R.
          41. To find the transitive closure of a relation, iteratively add edges to make it transitive until no more edges need to be added.
          42. Importance
          43. Transitivity is crucial in various areas such as graph theory, database management, and equivalence relations.
          44. It helps in determining the reachability and connectivity between elements in networks and systems.
          45. A relation R on a set S is transitive if for all a, b, c in S, if a is related to b and b is related to c, then a is related to c.
          46. Equivalence
          47. Definition
          48. A relation R on a set S is an equivalence relation if and only if R is reflexive, symmetric, and transitive.
          49. Example
          50. Non-Equivalence Relation
          51. A relation on Z where a, b are related if a ≤ b is not an equivalence relation as it fails to be symmetric.
          52. Let R be a relation on elements in Z where a, b are related if a mod 2 = b mod 2 for all a, b in Z. R is reflexive, symmetric, and transitive, thus an equivalence relation.
          53. Equivalence Classes
          54. Equivalence class of a is set {x ∈ S | xRa}.
          55. Equivalence relation on Z where a mod 2 = b mod 2 has two equivalence classes: {1, 3} and {2, 4}.
          56. Partitioning
          57. Equivalence classes form a partition of the set S.
          58. Representatives
          59. Each equivalence class has a representative element.
          60. Uniqueness
          61. Each element in S belongs to exactly one equivalence class.
          62. Properties
          63. Reflexivity
          64. For all a ∈ S, aRa.
          65. Symmetry
          66. For all a, b ∈ S, if aRb then bRa.
          67. Transitivity
          68. For all a, b, c ∈ S, if aRb and bRc, then aRc.
          69. Partition
          70. all the elements of the set are in the partition.
          71. each element of the set appear in one parition only
          72. Order
          73. Partial Order
          74. A relation R on set S is a partial order if it is reflexive, anti-symmetric, and transitive.
          75. Example
          76. Relation on integers Z where a is less than or equal to b.
          77. Relation on positive integers Z-plus where a divides b.
          78. Total Order
          79. A relation R on set S is a total order if it is a partial order and every pair of elements in S are comparable.
          80. Example
          81. Relation on integers Z where a is less than or equal to b.
          82. Interval Orders
          83. An interval order is a partial order that arises from a collection of intervals on the real line.
          84. Example
          85. Consider a set of intervals in R defined by their endpoints. The relation "less than or overlaps" between intervals forms an interval order
          86. Linear Extensions
          87. In the context of a partial order, a linear extension is a total order that preserves the partial order relation.
          88. Example
          89. Given a partial order on a set of elements, determining a linear extension involves defining a linear order that respects the given partial order constraints.