Week 2 -P vs NP Flashcards

1
Q

Given 2 functions f(n) and g(n)
define big o

A

f(n) = O(g(n)) if there exists some c ( where c>0 ) such that for all values of n f(n)<= c x g(n) where n>= n0 (n0 >=0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

define big omega

A

f(n) = Ω(g(n)) if there exists some c ( where c>0 ) such that for all values of n f(n)>= c x g(n) where n>= n0 (n0 >=0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

define big theta

A

f(n) =O(g(n)) AND Ω(g(n))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the language of a decision problem

A

Every problem for which the answers are yes or No can be a language

Lp = w ∈ Σ* : w is an instance of problem P whose answer is yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Time complexity tM(w) of a deterministic machine ( given a terminating machine)

M is a subscript character

A

number of steps required to terminate on an input word w ∈ Σ*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Time complexity tM(w) of a non-deterministic machine ( given a terminating machine)
M is a subscript character

A

the number of steps in the single longest computation of the input w be it one that terminates in an accepting or rejecting state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Worst case time complexity (Tm(n)) - m is a subscript character

A

max {t(w) : all words w of length n}

looks at every possible input of length n and identifies longest to process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

P (Polynomial Time): This refers to the class of problems that can be solved efficiently by a computer, meaning that an algorithm exists that can find the solution in a time that grows at a polynomial rate with the size of the input. In simpler terms, if a problem is in P, it means there is a known fast solution to it.

NP (Nondeterministic Polynomial Time): This refers to the class of problems for which a given solution can be verified efficiently, even if we don’t know how to find that solution quickly. If a problem is in NP, it means that while it might be hard to solve, if someone gave you a solution, you could check it quickly.

The Big Question: P vs NP
P problems are “easy to solve.”
NP problems are “easy to verify.”

A

asdgiash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

P what it is

A

(Deterministic) polynomial time
A langauge L is said to be solvable in polynomial time if there exists
a deterministic Turing Machine M such that:
. M accepts L
. Polynomial time complexity O(n^k) dont get confused with exponential

P is the class of all languages solvable in Deterministic polynomial time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

NP what is it

A

Non-Deterministic polynomial time
A langauge L is said to be solvable in non-deterministic polynomial time if there exists
a non-deterministic Turing Machine M such that:
. M accepts L
. Polynomial time complexity O(n^k) dont get confused with exponential

NP is the class of all languages solvable in Non-Deterministic polynomial time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is NP Complete

A

. Np hard
.in NP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Examples of NP complete problems

A

Boolean satisfiability problem
Clique Problem
Hamiltonian Cycle Problem
Travelling Salesman Problem
Graph Colouring Problem
Knapsack Problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly