Course: CSCI 1900

Divisibility

  • An integer π‘Ž divides 𝑏 if there exists an integer 𝑐 such that 𝑏=π‘Žπ‘
  • π‘Žβˆ£π‘ β†’ β€œa divides b”
    • 2∣4 β†’ 4 is divisible by 2
    • 8∀23 β†’ 23 is not divisible by 8

Properties of Division

  • Distributive Property β†’ if π‘Žβˆ£π‘ and π‘Žβˆ£π‘, then π‘Žβˆ£(𝑏+𝑐)
  • Common Factor β†’ if π‘Žβˆ£π‘, then π‘Žβˆ£π‘π‘ for all integers 𝑐
  • Associative Property β†’ if π‘Žβˆ£π‘ and π‘βˆ£π‘, then π‘Žβˆ£π‘

Remainder Theorem

  • π‘š=π‘žπ‘›+π‘Ÿ, 0β‰€π‘Ÿβ‰€π‘›
  • Where π‘š is the dividend, 𝑛 is the divisor, π‘ž is the quotient, and π‘Ÿ is the remainder
  • 127Γ·4=31remainder3 β†’ 127=31β‹…4+3

Floor

  • Round down to the nearest integer
  • ⌊π‘₯βŒ‹=max{π‘›βˆˆπ‘βˆ£π‘›β‰€π‘₯}
  • ⌊2.3βŒ‹=2

Integer Division + Modulus

  • Integer Division β†’ βŒŠπ‘Ž/π‘βŒ‹ only returns the quotient
    • Also known as β€œfloor division”
  • Modulus β†’ π‘Žmod𝑏 returns only the remainder

Congruence + Modular Arithmetic

  • If π‘Žβ‰‘π‘modπ‘š, then π‘Žmodπ‘š=𝑏modπ‘š
    • 17≑5mod12 because 17mod12=5