Complexity Theory: Polynomial Time
10 Questions
4 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following best describes the nature of the Severan dynasty?

  • A purely aristocratic lineage focused on diplomacy.
  • A military monarchy that prioritized the army's interests. (correct)
  • A theocratic state where religious leaders held primary power.
  • A commercial republic centered on economic expansion.

The Edict of Diocletian (301 AD) effectively controlled rampant inflation by fixing maximum prices for goods and labor.

False (B)

What action did Septimius Severus take in order to solidify the eastern border of the empire?

established the province of Mesopotamia

To try and ensure a smooth transition of power, Septimius Severus designated his son _________ as co-emperor alongside his other son Geta.

<p>Caracalla</p> Signup and view all the answers

Match each emperor with a significant action or event during their reign:

<p>Aurelian = Defeated Queen Zenobia of Palmyra, restoring imperial control. Caracalla = Instituted the Constitutio Antoniniana granting citizenship to nearly all free inhabitants. Diocletian = Divided the empire into four administrative regions with the Tetrarchy. Constantine = Issued the Edict of Milan, granting religious tolerance.</p> Signup and view all the answers

What long-term impact did the constant internal wars and external pressures during the Crisis of the Third Century have on the Roman Empire?

<p>They weakened the empire's infrastructure, economy, and social fabric, leaving it vulnerable. (B)</p> Signup and view all the answers

The 'honestiores' and 'humiliores' were treated equally under Roman law during the late imperial period.

<p>False (B)</p> Signup and view all the answers

Name one specific policy, besides increasing pay, that Septimius Severus enacted to benefit the army.

<p>allowed them to form families during their years of service</p> Signup and view all the answers

The system of requiring sons to take up their fathers' professions, particularly in agriculture, is known as _________.

<p>obligo creditorio</p> Signup and view all the answers

Which of the following factors contributed to the decline in agricultural production during the Crisis of the Third Century?

<p>Soil barrenness, abandonment of fields, brigandage, and civil unrest. (A)</p> Signup and view all the answers

Flashcards

Septimius Severus

Septimius Severus became emperor in 193 after defeating many rivals.

Caracalla's Succession

To prevent power vacuums in succession, he designated his son Caracalla as emperor.

Province of Mesopotamia

To strengthen the eastern border, he established the province of Mesopotamia.

Severus & Soldiers

Severus took measures to support the army, raising salaries and allowing soldiers to start families during service years.

Signup and view all the flashcards

Annonia militaris

Instituted the 'Annonia militaris', a tax paid through cereals, oil and wine

Signup and view all the flashcards

Mass monetary change

Second measure to modify coin production by increasing the amount of currency, which reduced the value

Signup and view all the flashcards

Limitanei

Troops from the combat zone are under the command of the emperor

Signup and view all the flashcards

Diocletian

After Aurelian's death in 245 AD, he became emperor

Signup and view all the flashcards

Military Reduction

Reduced the number of soldiers in the legions

Signup and view all the flashcards

Edict of Prices (301)

Fixed maximum prices of consumer goods and labor activities.

Signup and view all the flashcards

Study Notes

  • This lecture introduces complexity theory

Polynomial Time

  • An algorithm is polynomial time if its runtime is $O(n^k)$ with constant $k$, where $n$ is input size
  • The complexity class P includes decision problems solvable by an algorithm in polynomial time
  • SORTING is an example: arranging n numbers in order
  • CONNECTIVITY is an example: finding path between 2 nodes (s and t) in graph G = (V, E)
  • PRIMALITY is an example: determining integer n is prime or not

Nondeterministic Polynomial Time (NP)

  • Complexity class NP includes problems where a solution can be verified in polynomial time
  • HAMPATH is an example: determining if Hamiltonian path from s to t exists in graph G = (V, E)
  • CLIQUE is an example: determining if clique of size k exists in graph G = (V, E)

Polynomial-Time Reducibility

  • Problem A is polynomial-time reducible to problem B ($A \leq_P B$) if polynomial-time algorithm f exists
  • Algorithm f transforms instance x of A into instance f(x) of B
    • If x is YES for A, f(x) is YES for B
    • If x is NO for A, f(x) is NO for B
  • If $A \leq_P B$, A "no harder" than B
  • A polynomial-time algorithm for B enables solving A in polynomial time

NP-Completeness

  • Decision problem B is NP-complete if:
    • $B \in NP$
    • $A \leq_P B$ for every $A \in NP$
  • NP-complete problems are the "hardest" in NP
  • Finding polynomial-time algorithm for NP-complete implies all problems in NP solvable in polynomial time and P = NP
  • The SAT decision problem is NP-complete due to Cook-Levin Theorem

SAT (Satisfiability)

  • Given boolean formula in Conjunctive Normal Form (CNF), can variables be assigned to make it true?

3-SAT

  • Special case of SAT: each clause has 3 literals
  • Example: $(x_1 \lor \neg x_2 \lor x_3) \land (\neg x_1 \lor x_4 \lor x_5) \land (x_2 \lor \neg x_3 \lor \neg x_4)$
  • 3-SAT is NP-complete
    • 3-SAT $\in$ NP
    • SAT $\leq_P$ 3-SAT
  • Convert any SAT clause into set of clauses with 3 literals each:
    • $(x) \rightarrow (x \lor x \lor x)$
    • $(x \lor y) \rightarrow (x \lor y \lor y)$
    • $(x_1 \lor x_2 \lor... \lor x_k) \rightarrow (x_1 \lor x_2 \lor y_1) \land (\neg y_1 \lor x_3 \lor y_2) \land... \land (\neg y_{k-3} \lor x_{k-2} \lor y_{k-2}) \land (\neg y_{k-2} \lor x_{k-1} \lor x_k)$

Implications of NP-Completeness

  • If P $\neq$ NP, NP-complete problems are not solvable in polynomial time
  • Many important problems are NP-complete, like HAMPATH, CLIQUE, 3-SAT, VERTEX-COVER, SUBSET-SUM
  • Consider approximation algorithms, heuristics or exponential-time algorithms when NP-complete problem arises

Transistors

  • Semiconductor devices used for amplify/switch electrical signals and power
  • Key building blocks of electronics today

Transistor Types

  • Bipolar Junction Transistors (BJTs)
  • Field-Effect Transistors (FETs)

Bipolar Junction Transistors(BJTs)

  • Current-controlled transistors: the flow of current depends on the flow of current into its base
  • Used in amplifiers, switches and regulators

Structure

  • Three layers of semiconductor material are doped differently. The three terminals are emitter, base, and collector.

Types

  • NPN: Emitter/collector doped with n-type material, base with p-type
  • PNP: Emitter/collector doped with p-type material, base with n-type

Function

  • Current is applied applied to BJT base, causes a larger current to flow from collector to the emitter

Field-Effect Transistors (FETs)

  • Voltage-controlled transistors: flow of current controlled by voltage to the gate
  • Used in amplifiers, switches, and variable resistors

Structure

  • Three terminals: source, drain, and gate. The source and drain are connected by a channel and the gate allows the channel to be controlled.

Types

  • Junction FET (JFET): Gate is p-n union
  • Metal-Oxide-Semiconductor FET (MOSFET): Gate is isolated from the channel

Function

  • Gate voltage creates an electric field which impacts channel conductance, affecting the flow of current

Transistor Applications

  • Amplifiers
  • Switches
  • Oscillators
  • Digital circuits
  • Voltage regulators
  • Microprocessors
  • Memory

Transistor Advantages

  • High Reliability
  • Low Cost
  • Small size
  • Low power

Transistor Conclusion

  • Versatile devices, key building block in electronic devices

Clinical Trial Protocol

  • Phase 3, Randomized, Double-Blind, Placebo-Controlled, Parallel-Group, Multi-Center Study
  • Evaluates Efficacy and Safety of MEDI4736
  • Applies to Patients: With Unresectable Stage III Non-Small Cell Lung Cancer (NSCLC); Have Not Progressed Following Concurrent Chemoradiation

Table of Contents Include

  • Protocol Summary
  • Introduction
    • Background Information
    • Rationale for Study
  • Objectives
    • Primary: Target
    • Secondary: Target
  • Study Design
    • Overall Plan
    • Randomization and Blinding
    • Population -
      • Inclusion: Criteria
      • Exclusion: Criteria
    • Treatment
      • Investigational Product:
      • Method of Assignment
      • Dosage and Administration
      • DurationConcomitant Medications
      • Management of Overdose
    • Assessments
      • Efficacy: Assessments
      • Safety: Assessments
      • Pharmacokinetic (Optional)
      • Biomarker (Optional)
    • Procedures
    • Visits
    • Discontinuation
    • End of Study
  • Statistical Considerations
    • Sample Size
    • Statistical Analysis
      • Efficacy: Analysis
      • Safety: Analysis
    • Interim Analysis (If Applicable)
  • Data Managment
    • Data Collection
    • Quality Assurance
  • Ethical Considerations
    • Ethical Principles
    • Informed Consent
    • Regulatory Compliance
  • Publication Policy
  • References
  • Appendices

Chemical Principles

Quantitative Description of Chemical Reactions

Stoichiometry - Reaction Relationships

  • Stoichiometric Coefficients: Balanced equation describes the relative number of moles per reactant/product

    • $2H_2(g) + O_2(g) \longrightarrow 2H_2O(g)$
    • 2 mol $H_2$ react with 1 mol $O_2$ to produce 2 mol $H_2O$
  • Stoichiometric Ratios: Relates amounts of two species

    • $2H_2(g) + O_2(g) \longrightarrow 2H_2O(g)$
    • $\frac{n(H_2)}{n(O_2)} = \frac{2}{1}$
    • $\frac{n(H_2O)}{n(H_2)} = \frac{2}{2} = 1$

Reaction Yield

  • Actual yield of a reaction is often less than the theoretical yield
    • Side reactions
    • Incomplete reaction
    • Losses during recovery of product
  • $$\text{Percent yield} = \frac{\text{Actual yield}}{\text{Theoretical yield}} \times 100%$$

Limiting Reactant

  • The limiting reactant is consumed completely in a chemical reaction while other reactants are excess
  • $N_2(g) + 3H_2(g) \longrightarrow 2NH_3(g)$
    • 1 mol $N_2$ and 2 mol $H_2$ allowed to react
    • $H_2$ is the limiting reactant
    • $N_2$ is in excess

Adipic Acid Example

  • $H_2C_6H_8O_4$ is used to produce nylon & made by oxidating cyclohexane ($C_6H_{12}$)
  • 25.0 kg cyclohexane react with 25.0kg $O_2$
  • $2C_6H_{12}(l) + 5O_2(g) \longrightarrow 2H_2C_6H_8O_4(s) + 2H_2O(g)$
What is the limiting reactant?
  • $n(C_6H_{12}) = \frac{25.0 \times 10^3 g}{84.16 \frac{g}{mol}} = 297 mol$
  • $n(O_2) = \frac{25.0 \times 10^3 g}{32.00 \frac{g}{mol}} = 781 mol$
  • $\frac{n(O_2)}{n(C_6H_{12})} = \frac {781}{297} = 2.63 < \frac{5}{2}$, therefore $O_2$ is the Limiting Reactant
What is theoretical yield of adipic acid?
  • $n(H_2C_6H_8O_4) = \frac{2}{5} \times n(O_2) = \frac{2}{5} \times 781 mol = 312 mol$
  • $m(H_2C_6H_8O_4) = 312 mol \times 146.1 \frac{g}{mol} = 45.6 \times 10^3 g = 45.6 kg$

Data Structures and Algorithms

Objectives

  • Explain common data structures and algorithms
  • Select appropriate data structures and algorithms for problem solving
  • Write programs that use data structures and algorithms for problem solving

Data Structures

  • A way of organizing and storing data in a computer so that it can be accessed and used efficiently

Types

  • Arrays: Collection of the same typed elements, stored contiguously
  • Linked Lists: Sequences of nodes, with data and a pointer to the next node
  • Stacks: LIFI (Last-In-First-Out)
  • Queues: FIFO (First-In-First-Out)
  • Trees: Hierarchical data structure, nodes connected by edges
  • Graphs: Nodes (vertices) & edges. Edges connect pairs of nodes
  • Hash Tables: Uses a hash function to map keys to values

Algorithms

  • A step-by-step procedure for solving a problem

Types

  • Searching Algorithms
    • Algorithms for finding an element
      • Linear Search
      • Binary Search
  • Sorting Algorithms
    • Algorithms for arranging elements
      • Bubble Sort
      • Insertion Sort
      • Merge Sort
      • Quick Sort
  • Graph Algorithms
    • Algorithms for graphs
      • Depth-First Search (DFS)
      • Breadth-First Search (BFS)
      • Dijkstra's Algorithm
      • Prim's Algorithm
      • Kruskal's Algorithm
  • Dynamic Programming
    • Solves optimization problems breaking them down into smaller problems
  • Greedy Algorithms
    • Makes locally optimal choices, looking for global optimum

Algorithm Analysis

  • Time Complexity: The run time as a function of the input size
  • Space Complexity: The memory amount as a function of the input size
  • Big O Notation: Asymptotic behavior of functions; use to type time/space

Big O Notation types

  • O(1): constant time
  • O(log n): Logrithemic time
  • O(n): Linear Time
  • O(n log n) - Linearithmic Time
  • O($n^2$) - Quadratic Time
  • O($2^n$) - Exponential Time
  • O(n!) - Factorial Time

Key Concepts

  • Abstract Data Type: Theoretical model defined by it operations
  • Recursion: A function calls itself to solve smaller subproblems
  • Divide and conquer: Break a problem into smaller subproblems, solve and combine

Applications

  • Database Management Systems: Uses data structures and algorithms for data
  • Computer Graphics: Used in simulating the images and 3-D models
  • Operating Systems: file system organization, process scheduling, memory
  • Arificial Intelligence: In machine language, and computer visions
  • Networking: Routing, congestion control, and security

Chapitre 2 : Algèbre relationnelle (Chapter 2: Relational Algebra)

Introduction

  • Relational algebra is a theoretical query language that operates on relations and produces other relationships.
  • Provides a formalism for manipulating data stored in relational databases.

Opérateurs de base (Basic Operators)

  • Sélection ($\sigma$) (Selection): Filters tuples of a relation based on a condition
    • Example: $\sigma_{age > 25}(Employés)$ (Employees)
  • Projection ($\Pi$) (Projection): Selects certain columns from a relation
    • Example: $\Pi_{nom, salaire}(Employés)$ (Employees)
  • Union ($\cup$) (Union): Combines the tuples of two compatible relations
    • Example: $Employés \cup Clients$ (Employees or Clients)
  • Intersection ($\cap$) (Intersection): Returns tuples common to 2 compatible relations
    • Example: $Employés \cap Clients$ (Employees or Clients)
  • Différence (-) (Difference): Returns tuples present in 1 relation, but not in the other
    • Example: $Employés - Clients$ (Employees, not Clients)
  • Produit cartésien ($\times$) (Cartesian Product): Combines each tuple with others
    • Example: $Employés \times Départements$ (Employees with Departments)
  • Renommage ($\rho$) (Renaming): Renames a relation or its attributes
    • Example: $\rho_{NouveauxEmployés}(Employés)$ (New Employees or Employees)

Opérateurs dérivés (Derived Operators)

  • Jointure ($\Join$) (Join): Combines tuples based on condition
    • Example: $Employés \Join_{Employés.département = Départements.id} Départements$ (Join Employees with Departments)
  • Division ($\div$) (Division): Returns tuples of 1 relation that corresponds to all tuples of another.
    • Example: Achats \div Clients (Purchases and Clients)

Exemples de requêtes (Examples of Queries

  • Etudiants (Students): (id, nom, age, adresse)
  • Cours (courses): (id, titre, crédits)
  • Inscriptions (registrations): (id_etudiant, id_cours, date)

Requêtes (Queries)

  1. Student names over 20: $\Pi_{nom}(\sigma_{age > 20}(Etudiants))$
  2. Course tiles for students: $\Pi_{titre}(\Cours \Join_{Cours.id = Inscriptions.id_cours}(\sigma_{id_etudiant = 123}(Inscriptions)))$
  3. Student names: $\Pi_{nom}(Etudiants \Join_{Etudiants.id = Inscriptions.id_etudiant} Inscriptions) \div \Pi_{id}(\Cours)$

Avantages et inconvénients (Advantages and Disadvantages

Avantages (Advantages)

  • Formalisme mathématique précis (Precise mathematical formalism)
  • Base pour l'optimisation des requêtes (Basis for query optimization)

Inconvénients (Disadvantages)

  • Peu intuitif pour les utilisateurs non techniques (Not intuitive for users)
  • Verbeux pour les requêtes complexes (Verbose)

Conclusion

  • Fundamental tool for understanding/manipulating databases
  • Underlies languages like SQL
  • Allows efficient query optimiation

Lab 1: Introduction to DOS

Objectives

  • Become familiar with Linux environment and DOS
  • Learn how to use basic DOS commands
  • Practice creating simple DOS nodes

Deliverables

  • A written report including:
    • Answers to all questions
    • Code of DOS Nodes
    • Screen Capture of Turtlesim Simulation
    • A brief discussion and conclusions about the lab
  • All of your nodes

Introduction

What is DOS?

  • DOS is a flexible framework for writing robot software
  • DOS is a collection of tools, libraries, and conventions
    • Complex
    • Robust robot behavior
    • A wide variety of robotiic platforms

Why DOS?

  • Facilitates code reuse in robotics research and development
  • Large and Active Community
  • Provides Simulation, Visualization, and Debugging
  • Abstraction from underlying Hardware

DOS Concepts

  • Nodes: Executable per specific tasks
  • Topics: Named bases which nods exchange messages, to publish and reciever
  • Messages: Data used to communicate, with standard and custom sets
  • Services: Request/Reply functions to be called with certain inputs
  • Paramters: Stored configuration values

DOS Architecture

  • DOS master tracks, topics, and services, which finds all of connections

Preliminaries

DOS Basic Commands

  • roscore: starts the DOS master
  • rosnode: displays listing for DOS Nodes
  • rostopic: displays listing for topics, lists, and pulishing.
  • rosservice: lists and calls DOS services
  • roslaunch: command line for launching and configuring

DOS programming

  • Creating: Before creating a DOS node, create a package
    • catkin_create_pkg: Creates a ROS program and set dependencies
      • my_package.roscpp, rospy, std_msg
  • CD to catkin_ws.src
  • Building a ROS node: C++ or Python
    • Add executable to CMakeLists.txt

Building

  • Target libraries inside of cmakeLists.txt
  • Build from catkin_make

Running DOS Node

  • Need to source with the bash script

Turtlesim simulation

  • DOS simulation

DOS Installation: Follow installation instructions on ROS website

  • Command: sudo apt-get install ros-noetic-turtlesim

DOS Running command: rosrun turtlesim turtlesim_node

DOS Control

  • Run command: Command: rosrun turtlesim turtle_teleop_key
  • DOS turtles can be given position and orientation

Questions

1.  What is a ROS node?
2.  What is a ROS topic?
3.  What is a ROS message?
4.  What is the difference between a ROS topic and a ROS service?
5.  What is a ROS package?
6.  How do you create a ROS package?
7.  How do you build a ROS node?
8.  How do you run a ROS node?
9.  How do you find out the name of the topics that are currently active?
10. How do you display the messages being published to a topic?
11. How do you publish a message to a topic?
12. How do you create a message definition?

Extra Excercises

  • 1: Writes a DOS to publish turle position
  • 2: Write a DOS, that can use to rest the turtle and services
  • 3: Create a launch file,

Chapter 14: Social Psychology

Social Psychology Defined

  • The study of how an individual's thoughts, feelings, and behaviors are affected by the presence of others

Social Cognition

  • Studies processing of information related to people and social situations. Understanding cognitive processes
    • Attribution: Explains why people give certain behaviors
      • Internal attribution: Cause due to trait/personality -External attribution: Cause due to external factor
        • Fundamental attribution error: Overestimate role of dispositional factors
        • Actor-observer bias: Attributing own behavior situational causes
        • Self-serving bias: Taking credit for our successes and denying failures
    • Attitudes: evaluation of people, objects, and ideas
      • Cognitive: thoughts/beliefs
      • behavioral: emotions
        • Behavioral: actions
      • cognitive dissonance: uncomfortablity felt behavior
      •       Persuasion: Changing attitude throught the transmisiion of messages
        

Social influenve

  • Ways people are affected by others Conformity: One feeling, matched those to a goup of people - Group polarization: the tendency for a group to make decisions that are more extreme than the initial inclination of its members. Informational/Social

Social Relations

  • How to maintain relations
  • Prejudice*. negative attitude Stenotype, generalization of beilfs Discriminations - Negative Behaviour
  • *Aggregations: Verval Actions .Bystander
  • *Bystander, .Proximity:
  • *Intraposition,**.Share common and values .Companionate Passionate
  • **
  • **

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

This lecture introduces complexity theory. It covers polynomial time, nondeterministic polynomial time (NP), and polynomial-time reducibility.

More Like This

Use Quizgecko on...
Browser
Browser