CSI 2101 - midterm

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 21

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

22 Terms

1

negating quantifiers

equivalent to the opposite quantifier with a negated predicate

New cards
2

how to verify two propositions are equivalent

prove one proposition implies the other and vice versa

New cards
3

rational numbers

can be written in the form n/d

New cards
4

proof by cases

split all logical possibilities into disjoint cases and prove these cases cover all possibilities. prove each case implies the proposition

New cards
5

proof by contrapositive

turn a proposition of the form P → Q into NOT Q → NOT P, which is logically equivalent. this is useful for proving the converse of IFF statements and proving propositions involving rational numbers

New cards
6

proof by contradiction

assume the proposition is false and prove how this assumption leads to falsehood. NOT P → F. Useful for proving propositions involving rational numbers, and proving uniqueness. Use as a last resort.

New cards
7

proofs with irrational numbers

rearrange the proposition so it does not claim a number is irrational, but rather rational

New cards
8

proof by induction

first prove the base case where n is the lowest is can possibly be (typically 1). the assume the inductive hypothesis of P(n), taking the inductive step, and prove that if P(n) is true, that P(n+1) is true. This is used for proving propositions of the form “For all n, P(n)”

New cards
9

strong induction

A type of induction where the inductive step assumes all values up to n are true, rather than just n being true.

New cards
10

invariant

a predicate that is true for all states over all transitions throughout the lifetime of a state machine. invariants only tell us what is unreachable, not necessarily what is reachable

New cards
11

combination

a number c is a combination of two other numbers a,b if there exists integers x,y such that c=xa+yb

New cards
12

facts about combinations (3)

  • combinations of combinations of initial numbers are also combinations of those initial numbers

  • if d divides a and b, then d divides all combinations of a and b

  • the gcd of a and b is a combination of a and b

New cards
13

euclid’s slgorithm

E(n,d) where n>=d>=0

  1. if d=0, return n

  2. otherwise, write n=qd+r where q is as large as possible while keeping r positive. Return E(d,r)

New cards
14

extended euclid’s algorithm

used to find the combination of n and d equaling their gcd. X(n,d) where n>=d>=0

  1. if d=0, return (1,0)

  2. otherwise, return n=qd+r having q as large as possible while r remains possible. Get (s,t) from X(d,r), and return (t, s-(q*t))

New cards
15

modulus

represented as y mod x, it returns the positive remainder y when divided by x. for negative numbers, consider that you must always move right to get the remainder

New cards
16

modular addition

done by adding the modulus of each addend together, and then getting the modulus of that

New cards
17

congruent modulo

written as a ≡ a’ (mod n) if a mod n = a’ mod n. a and a’ have the same remainder when divided by n

New cards
18

facts about congruency (3)

  • two numbers are congruent if n divides a-a’

  • if a ≡ a’ (mod n) and b ≡ b’ (mod n), then

    • a + b ≡ a’ + b’ (mod n)

    • ab ≡ a’b’ (mod n)

  • n is even translates to n ≡ 0 (mod 2), odd translates to n ≡ 1 (mod 2)

New cards
19

modular multiplication

done by multiplying the modulo of each factor together and then taking the modulo of that product

New cards
20

modular exponentiation

given ae mod n, if e is large enough use Power(a,e,n)

  1. if e = 1, return a mod n

  2. if e is even, return Power(a2 mod n, e/2, n)

  3. if e is odd, return a Power(a, e-1, n)mod n

New cards
21

modular division

you can find the multiplicative inverse of a divisor using X(n,a) if 1<=a<=n-1 and the gcd(a,n)=1. The inverse of a’ is s mod n, where s is from sa + tn from X(n,a)

New cards
22

fermat’s little theorem

assume n is prime. then xn ≡ x (mod n) for every n

New cards
robot