Difference between revisions of "Math for CS Review"

From Computer Science
Jump to: navigation, search
(Memorize)
(Memorize)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Note - [https://www.khanacademy.org/math Khan Academy Math] is a good resource to look up and refresh general math knowledge.  [https://www.khanacademy.org/computing/ap-computer-science-principles Khan Academy AP CS Principles] and [https://www.khanacademy.org/computing/computer-science Khan Academy Computing] also have some content related to math embedded within them.
 +
 
=Memorize=
 
=Memorize=
 
These are things you need to memorize.
 
These are things you need to memorize.
Line 11: Line 13:
 
* ''Logarithms''
 
* ''Logarithms''
 
** log<sub>b</sub>x = y, means b<sup>y</sup> = x, for any b > 1
 
** log<sub>b</sub>x = y, means b<sup>y</sup> = x, for any b > 1
 +
** log<sub>10</sub>1000 = 3
 +
** log<sub>2</sub>1024 = 10
 
** log<sub>b</sub>x = log<sub>c</sub>x / log<sub>c</sub>b, for any b > 1, c > 1
 
** log<sub>b</sub>x = log<sub>c</sub>x / log<sub>c</sub>b, for any b > 1, c > 1
 
** log<sub>2</sub>10 is about 3.32
 
** log<sub>2</sub>10 is about 3.32
** log<sub>b</sub>(xy) = y log<sub>b</sub> x, for any b > 1
+
** log<sub>b</sub>(x<sup>y</sup>) = y log<sub>b</sub> x, for any b > 1
 +
** log<sub>b</sub>(x y) = log<sub>b</sub> x + log<sub>b</sub> y, for any b > 1
 +
* ''Formulae''
 +
** Arithmetic Sum: (1 + 2 + ... + n) = n * (n+1) / 2
 +
** Geometric Sum: 1 + r + r<sup>2</sup> + r<sup>3</sup> + ... + r<sup>n</sup> = (r<sup>n+1</sup>-1) / (r-1)
 +
* ''Boolean logic''
 +
** Possible values - true, false - can mean on, off - often represented by 1, 0
 +
** and, or, not - read about in [https://www.khanacademy.org/computing/ap-computer-science-principles/computers-101/logic-gates-and-circuits/a/logic-gates Khan academy]
 +
** De Morgan's laws: not (A and B) is equivalent to (not A) or (not B).  not (A or B) is equivalent to (not A) and (not B).
 +
** Should be able to answer questions about truth tables for and / or / not, and evaluate expressions of and's / or's / not's

Revision as of 03:47, 10 January 2020

Note - Khan Academy Math is a good resource to look up and refresh general math knowledge. Khan Academy AP CS Principles and Khan Academy Computing also have some content related to math embedded within them.

Memorize

These are things you need to memorize.

  • Order of operations: first parenthesis, then exponents, then multiplication/division/modulus, then addition and subtraction. And left to right.
  • Powers/exponents
    • 210 = 1024, roughly 1 thousand
    • 2a+b = 2a * 2b
    • ya+b = ya * yb
    • 2-a = 1 / (2a)
    • 220 = 1024 × 1024, roughly 1 million
    • 230 = 1024 × 1024 × 1024, roughly 1 billion
  • Logarithms
    • logbx = y, means by = x, for any b > 1
    • log101000 = 3
    • log21024 = 10
    • logbx = logcx / logcb, for any b > 1, c > 1
    • log210 is about 3.32
    • logb(xy) = y logb x, for any b > 1
    • logb(x y) = logb x + logb y, for any b > 1
  • Formulae
    • Arithmetic Sum: (1 + 2 + ... + n) = n * (n+1) / 2
    • Geometric Sum: 1 + r + r2 + r3 + ... + rn = (rn+1-1) / (r-1)
  • Boolean logic
    • Possible values - true, false - can mean on, off - often represented by 1, 0
    • and, or, not - read about in Khan academy
    • De Morgan's laws: not (A and B) is equivalent to (not A) or (not B). not (A or B) is equivalent to (not A) and (not B).
    • Should be able to answer questions about truth tables for and / or / not, and evaluate expressions of and's / or's / not's