Posts

Machine Learning Foundations & Definitions

Machine Learning focuses on algorithms that allow computers to learn patterns directly from data without being explicitly programmed. [1]  *  * Tom Mitchell's Definition: A computer program is said to learn from Experience ($E$) with respect to some class of Tasks ($T$) and Performance measure ($P$), if its performance at tasks in $T$, as measured by $P$, improves with experience $E$. * Data: The raw foundation, which can be structured, semi-structured, or unstructured. * Model: A mathematical representation of a real-world process derived from data. * Loss Function: A mathematical metric quantifying how much a model's prediction deviates from the true target value. [1, 2, 3]  *  ------------------------------ ## Machine Learning Frameworks & Paradigm Comparison                          [ Machine Learning Paradigms ]                        ...

Optimization Techniques (MCA555) – Unit 2: Linear Programming (LP)

Optimization Techniques (MCA555) – Unit 1: Introduction to Optimization and Operations Research

  Based on MCA Semester III Syllabus  --- Introduction to Optimization Optimization is the process of finding the best possible solution from all feasible solutions while satisfying given constraints. The main objective of optimization is to: Maximize profit Minimize cost Minimize time Maximize efficiency Minimize resource usage --- Definition of Optimization Optimization is a mathematical technique used to obtain the best value of an objective function under specified constraints. Examples Finding the shortest route for delivery. Maximizing company profit. Minimizing production cost. Scheduling employees efficiently. --- Real-Life Applications of Optimization Optimization is used in almost every field. Engineering Machine design Structural design Electrical circuits Business Profit maximization Inventory management Production planning Transportation Route optimization Vehicle scheduling Healthcare Hospital scheduling Medicine dosage optimization Artificial Intelligence Machin...

Compiler Design (MCA554) – Unit 5: Code Generation and Code Optimization

  Based on MCA Semester III Syllabus  --- Introduction to Code Generation Code Generation is the final phase of a compiler. Its purpose is to convert intermediate code into target machine code. Compiler Flow: Source Program       ↓ Lexical Analysis       ↓ Syntax Analysis       ↓ Semantic Analysis       ↓ Intermediate Code       ↓ Code Generation       ↓ Machine Code --- Objectives of Code Generation A good code generator should: Produce correct code Produce efficient code Use memory efficiently Reduce execution time --- Inputs to Code Generator The code generator receives: Intermediate Code Symbol Table Runtime Information Example: t1 = a + b t2 = t1 * c --- Outputs of Code Generator The output is machine code or assembly code. Example: MOV R1, a ADD R1, b MUL R1, c --- Machine Dependent Code Generation Machine-dependent code generation considers: CPU architecture Number of registers Mem...

Compiler Design (MCA554) – Unit 4: Type Checking and Run Time Environments

 Compiler Design (MCA554) – Unit 4: Type Checking and Run Time Environments Based on MCA Semester III Syllabus  --- Introduction to Type Checking Type Checking is the process of verifying that operands and expressions are used with compatible data types. Its purpose is to detect type errors before program execution. Example: int x; x = 10; Valid Assignment. Example: int x; x = "Hello"; Type Error. --- Need for Type Checking Type checking helps: Detect programming errors Improve reliability Ensure correct operations Prevent invalid assignments --- Type Expressions A Type Expression represents the type of a variable, function, or expression. Examples: int a; float b; char c; Type Expressions: a → int b → float c → char --- Primitive Data Types Basic data types available in programming languages. Examples: int float char double boolean --- Constructed Data Types Created using primitive types. Examples: Array Pointer Structure Function --- Type Equivalence Determines whether two ...

Compiler Design (MCA554) – Unit 3: Syntax Directed Translation and Intermediate Code Generation

Compiler Design (MCA554) – Unit 3: Syntax Directed Translation and Intermediate Code Generation Based on MCA Semester III Syllabus  --- Introduction to Syntax Directed Translation Syntax Directed Translation (SDT) is a method in which semantic actions are associated with grammar rules. It helps the compiler: Generate intermediate code Perform type checking Build syntax trees Translate source code into machine-independent representation --- Need for Syntax Directed Translation A parser only checks syntax. The compiler must also: Understand meaning Generate code Perform semantic analysis Syntax Directed Translation helps achieve these tasks. --- Syntax Directed Definition (SDD) A Syntax Directed Definition is a Context Free Grammar (CFG) with attributes and semantic rules attached to productions. General Form: A → B C Semantic Rule: A.val = B.val + C.val --- Attributes Attributes store information about grammar symbols. Types: 1. Synthesized Attributes Information flows upward in the...

Compiler Design (MCA554) – Unit 2: Parsing and Syntax Analysis

 Compiler Design (MCA554) – Unit 2: Parsing and Syntax Analysis Based on MCA Semester III Syllabus  --- Introduction to Parsing Parsing is the second phase of a compiler. After Lexical Analysis generates tokens, the Parser checks whether the sequence of tokens follows the grammar rules of the programming language. Example Source Code: a = b + c; Tokens: id = id + id ; Parser verifies whether the token sequence is grammatically correct. --- Role of Parser The parser performs the following tasks: Checks syntax errors Builds parse trees Verifies grammar rules Reports syntax violations Position in Compiler Source Program       ↓ Lexical Analyzer       ↓ Parser       ↓ Semantic Analyzer --- Context Free Grammar (CFG) A Context Free Grammar is used to describe the syntax of programming languages. A CFG consists of: Terminals Non-terminals Productions Start Symbol Example Grammar E → E + T E → T T → id Where: E = Expression T = Term id = I...