6. Theory of Computation and Computer Graphics (ACtE06)
Computer Engineering - Nec (Nepal Engineering Council)
Chapters
- 1. Concept of Basic Electrical and Electronics Engineering
- 2. Digital Logic and Microprocessor (AExE02)
- 3. Programming Language and Its Applications
- 4. Computer Organization and Embedded System (ACtE04)
- 5. Concept of Computer Network and Network Security System (ACtE05)
- 6. Theory of Computation and Computer Graphics (ACtE06)
- 7. Data Structures and Algorithm, Database System, and Operating System (ACtE07)
- 8. Software Engineering and Information System (ACtE08)
- 9. Artificial Intelligence, Data Science, and Internet of Things (ACtE09)
- 10. Project Management and Innovation (ACtE10)
6. Theory of Computation and Computer Graphics (ACtE06)
6.1 Introduction to Finite Automata (ACtE0601)
Finite Automata (FA)
- Definition: A mathematical model of computation used to recognize patterns.
- Components:
- States (): Finite set of states.
- Alphabet (): Set of input symbols.
- Transition Function (): Defines state changes.
- Start State (): Initial state.
- Final State (): Accepting states.
Types of Finite Automata
- Deterministic Finite Automata (DFA):
- One possible transition per input symbol.
- Defined as:
- Non-Deterministic Finite Automata (NDFA):
- Multiple transitions per input symbol.
- Uses epsilon () transitions (moves without input).
- Can be converted to DFA.
Regular Expressions and Finite Automata
- Regular Expressions: Notations for defining regular languages.
- Equivalence of Regular Expressions and Finite Automata: Every regular expression has an equivalent FA.
Pumping Lemma for Regular Languages
- Used to prove that a language is not regular.
- Statement:
If is a regular language, there exists a constant such that any string in with can be split into: where:- ,
- ,
- is in for all .
6.2 Introduction to Context-Free Language (ACtE0602)
Context-Free Grammar (CFG)
- Definition: A set of recursive rewriting rules used to generate patterns of strings.
- Notation:
where:
- = Set of non-terminal symbols.
- = Set of terminal symbols.
- = Set of production rules.
- = Start symbol.
Parse Tree & Ambiguous Grammar
- Parse Tree: Visual representation of the structure of a string based on CFG.
- Ambiguous Grammar: A grammar is ambiguous if a string has multiple parse trees.
Normal Forms of CFG
- Chomsky Normal Form (CNF):
- Each production is of the form:
- Greibach Normal Form (GNF):
- Each production is of the form: where is a terminal and is a sequence of non-terminals.
Pushdown Automata (PDA)
- Automaton that recognizes context-free languages.
- Has a stack for memory.
Pumping Lemma for Context-Free Languages
- Used to prove a language is not context-free.
6.3 Turing Machine (ACtE0603)
Definition and Notation
- Turing Machine (TM): A more powerful model of computation than FA and PDA.
- Notation:
where:
- = Tape alphabet.
- = Transition function.
Types of Turing Machines
- Multi-Tape Turing Machine: Uses multiple tapes.
- Non-Deterministic Turing Machine (NDTM): Can transition to multiple states.
- Universal Turing Machine: Simulates any other Turing machine.
Church-Turing Thesis
- States that any computation performed by a mechanical process can be done by a Turing Machine.
Computational Complexity
- Time Complexity: Measures running time based on input size.
- Space Complexity: Measures memory usage.
- Intractability: Problems that cannot be solved efficiently.
6.4 Introduction to Computer Graphics (ACtE0604)
Overview of Computer Graphics
- Definition: The creation, manipulation, and representation of visual images using a computer.
- Applications: Gaming, UI design, Animation.
Graphics Hardware
- Display Technology: CRT, LCD, LED, OLED.
- Raster-Scan Display: Uses pixels (bitmap).
- Vector Display: Uses mathematical equations.
- Output Devices: Monitors, Printers.
- Input Devices: Mouse, Graphics Tablet.
Graphics Software
- Software Standards: OpenGL, DirectX.
6.5 Two-Dimensional (2D) Transformations (ACtE0605)
Basic 2D Transformations
- Translation: Moves objects in space.
- Rotation: Rotates around an origin.
- Scaling: Changes the size of objects.
- Reflection & Shear: Used for mirroring and skewing.
2D Viewing Pipeline & Clipping
- Cohen-Sutherland Line Clipping: Determines which lines are inside the viewing window.
- Liang-Barsky Clipping: More efficient than Cohen-Sutherland.
6.6 Three-Dimensional (3D) Transformations (ACtE0606)
Basic 3D Transformations
- Translation, Rotation, Scaling, Reflection, Shearing (similar to 2D).
3D Viewing Pipeline
- Process:
- Modeling Transformation: Defines the object’s shape.
- Viewing Transformation: Defines the camera’s position.
- Projection Transformation: Converts 3D objects into 2D images.
Projection Types
- Orthographic Projection: Parallel projection (used in engineering drawings).
- Perspective Projection: Objects appear smaller as they move farther.