Semester 6 Electives and Labs | BTech CSE Practical Guide
Semester 6 - Page 5: Electives and Labs. 24 numbered practical topics, highlighted rules, worked cases, answered viva questions, workflow diagrams, evidence tables and a complete Python demo. General practical guide, not an official course basket, lab list, syllabus or submission rule. Check your current approved scheme and faculty handout.
Topic map
- Electives and official course baskets
- Selection by preparation, interest and goal
- Lab aims and acceptance evidence
- Clean setup and reproducibility
- AI problem representation
- BFS and DFS practicals
- UCS and A* cost evidence
- Heuristic admissibility and consistency
- CSP and reasoning experiments
- Learning evaluation and leakage
- Lexer token evidence
- Parsing, precedence and ASTs
- Semantic checks and intermediate code
- Compiler negative tests
- Line rasterization and rounding
- Transform order and conventions
- Projection, clipping and perspective divide
- Textures, depth and rendered evidence
- Authorized security lab scope
- Security controls and privacy evidence
- Cross-subject test matrix
- Report, citations and contribution
- Viva demonstration and fallback
- Semester revision and next step
1. Electives and official course baskets
An elective is chosen from an approved list, not an unrestricted internet course catalog. Offerings, credits, prerequisites and assessment depend on the current department scheme.
Answer: No. The current official scheme and timetable decide.
2. Selection by preparation, interest and goal
Use interest, prerequisites, goals and support to compare available options. A preference score does not override eligibility or scheduling conflicts.
Answer: No. Availability, prerequisites and personal priorities still matter.
3. Lab aims and acceptance evidence
Define one observable outcome, input domain, expected result and environment before implementation. Distinguish a suggested exercise from a required experiment.
Answer: No. Use the actual assigned list and format.
4. Clean setup and reproducibility
Record tool/runtime versions, dependencies, commands and data. Test a clean run rather than relying on hidden state from an earlier attempt.
Answer: No. Reproducible code and actual run evidence are needed.
5. AI problem representation
Define state, start, goal test, legal successors and costs. Compare algorithms on exactly the same problem to isolate their behavior.
Answer: No. It mixes causes.
6. BFS and DFS practicals
BFS explores by depth and yields shortest edge count in an unweighted graph; DFS explores one branch deeply. Record visited handling and ordering.
Answer: No. Its shortest-path guarantee concerns equal/unit edge costs.
7. UCS and A* cost evidence
UCS prioritizes path cost; A* prioritizes g+h. State nonnegative-cost and heuristic assumptions, including graph-search handling.
Answer: No. Compare actual edge weights.
S -> A (4) -> G (4): cost 8 S -> B (1) -> C (1) -> G (1): cost 3
8. Heuristic admissibility and consistency
Admissibility means never overestimating remaining optimal cost; consistency requires h(u) <= c(u, v)+h(v). Implementation details matter for optimal graph search.
Answer: No. Check properties and algorithm handling.
9. CSP and reasoning experiments
Specify variables, domains and constraints, then test both satisfiable and impossible instances. Track pruning/branching evidence rather than only final answers.
Answer: No. It can expose failure or reduce search.
10. Learning evaluation and leakage
Split by the unit/time boundary required by the problem, fit preprocessing on training data only and report actual metric counts..
Answer: No. It becomes selection evidence.
11. Lexer token evidence
A lexer maps source characters to tokens with types, lexemes and positions. State identifier/number rules and reject invalid input rather than silently skipping it.
Answer: No. Parsing organizes tokens by grammar.
12. Parsing, precedence and ASTs
A parser checks grammar structure and builds a useful tree. Precedence and associativity must match the language specification.
Answer: No. It retains structure relevant to meaning.
+
/ \
2 *
/ \
3 413. Semantic checks and intermediate code
Separate valid syntax from declaration/type rules and later runtime behavior. Explain temporary values and evaluation dependencies in intermediate code.
Answer: No. Later checks are separate.
14. Compiler negative tests
Test invalid characters, missing delimiters, leftover tokens and semantic violations. Save the observed error category and location.
Answer: Not generally. That can hide errors or alter the accepted program.
15. Line rasterization and rounding
Compare DDA and Bresenham across horizontal, vertical, gentle, steep and reversed endpoints. State tie behavior and endpoint inclusion.
Answer: No. Rounding and tie conventions can differ.
16. Transform order and conventions
Record origin, axes, angle units and vector/matrix convention. Matrix composition order determines which operation acts first.
Answer: No. Their composition usually differs.
17. Projection, clipping and perspective divide
Separate model, view, projection, clipping and viewport stages. State orthographic/perspective choice and homogeneous-coordinate assumptions.
Answer: No. Actual rendering evidence is separate.
18. Textures, depth and rendered evidence
Compare filtering/mipmaps and depth behavior with repeatable camera/viewport settings. Record actual screenshots from the runtime being assessed.
Answer: No. It reports numbers/text, not rendered pixels.
19. Authorized security lab scope
Use dummy data and local training systems with explicit permission. Record allowed actions and stop outside them.
Answer: No. Permission and boundaries remain explicit.
20. Security controls and privacy evidence
Separate authentication, object authorization, query binding and output handling. Minimize collected fields and state a justified retention plan.
Answer: No. The server must check the action/resource.
21. Cross-subject test matrix
Each claimed behavior needs a specific expected/actual check. Keep negative cases and assumptions alongside positive results.
Answer: No. It illustrates separate contracts and explicit limits.
Four local contracts with explicit limits
import ast, heapq, math
# Tiny nonnegative weighted graph: this is UCS, not a complete AI lab suite.
graph = {"S": [("A", 4), ("B", 1)], "A": [("G", 4)], "B": [("C", 1)], "C": [("G", 1)], "G": []}
frontier = [(0, "S")]; best = {"S": 0}
while frontier:
cost, node = heapq.heappop(frontier)
if cost != best[node]: continue
if node == "G": break
for neighbor, weight in graph[node]:
candidate = cost + weight
if candidate < best.get(neighbor, math.inf):
best[neighbor] = candidate
heapq.heappush(frontier, (candidate, neighbor))
assert best["G"] == 3
# Safe whitelist interpreter of a Python AST, not a full compiler.
def arithmetic(node):
if isinstance(node, ast.Constant) and type(node.value) is int:
return node.value
if isinstance(node, ast.BinOp) and isinstance(node.op, (ast.Add, ast.Mult)):
left, right = arithmetic(node.left), arithmetic(node.right)
return left + right if isinstance(node.op, ast.Add) else left * right
raise ValueError("unsupported teaching expression")
result = arithmetic(ast.parse("2+3*4", mode="eval").body)
assert result == 14
try:
arithmetic(ast.parse("x+1", mode="eval").body)
except ValueError:
rejected = True
else:
rejected = False
assert rejected is True
# Exact +90-degree y-up integer rotation, not a rendering window.
x, y = 2, 1
rotated = (-y, x)
assert rotated == (-1, 2)
# Synthetic permission predicate; real identity must come from trusted auth.
record = {"owner": "Asha", "title": "Revise transforms"}
def permitted(user): return user == record["owner"]
assert permitted("Asha") is True
assert permitted("Ravi") is False
print("6 behavior assertions passed")
print("UCS goal cost:", best["G"])
print("arithmetic:", result, "unsupported name rejected:", rejected)
print("rotated point:", rotated)
print("owner/other:", permitted("Asha"), permitted("Ravi"))
print("Synthetic console checks only: no graphics window, real auth or full compiler.")
Checked output:
6 behavior assertions passed UCS goal cost: 3 arithmetic: 14 unsupported name rejected: True rotated point: (-1, 2) owner/other: True False Synthetic console checks only: no graphics window, real auth or full compiler.
22. Report, citations and contribution
Include aim, method, versions, test inputs, actual output, failures, limits and sources. Credit borrowed code and each contributor.
Answer: Submission must follow current academic rules and truthful attribution.
23. Viva demonstration and fallback
Run a complete story, explain a failure case and prepare a clean local fallback for unavailable hosted services. Do not claim the fallback proves the hosted path.
Answer: No. State the difference and show the verified path.
Demo: one complete story -> invalid/permission case -> actual test evidence -> honest limits + contribution
24. Semester revision and next step
Review AI search costs, lexer/parser/semantic boundaries, graphics conventions and authorization/privacy scope. Match final evidence to the actual assessment rubric.
Answer: Assigned requirements, clean execution, actual tests, attribution, private-data removal and honest limits.
Subject-to-practical evidence
| Subject | Practice | Evidence |
|---|---|---|
| AI | Same-graph search comparison | Cost, route and implementation assumptions |
| Compiler | Tokens/grammar/semantics | Positive plus precise error cases |
| Graphics | Rasterization/transforms/rendering | Conventions plus numeric/pixel evidence |
| Security | Owner checks and bound queries | Authorized dummy-data positive/negative tests |
| Privacy | Purpose and minimum fields | Use/access/retention rationale |
Test matrix
| Case | Expected | Evidence |
|---|---|---|
| Weighted search | Cheapest supported route | Exact edges and total |
| Expression precedence | 2+3*4 gives 14 | AST structure and actual result |
| Invalid syntax/input | Useful failure | Error category/location; no silent skip |
| Rotation | (-1,2) for y-up +90 degrees | Input/convention and actual output |
| Unauthorized owner | No protected record returned | Real identity boundary in production |
| Graphics window | Expected drawn output | Actual runtime screenshot, not console only |
Runtime distinctions
| Exercise | Environment | Limit |
|---|---|---|
| Portable Python numeric demo | Python 3 standard library | Console data/text only |
| LLVM frontend tutorial | Tutorial C++ build/runtime | Not every online compiler |
| OpenGL renderer | Suitable libraries + graphics context | Console matrix is not rendered proof |
| Security sandbox | Explicitly permitted local system | No arbitrary account/network testing |
| Elective course | Current official basket | Generic suggestions do not grant eligibility |
Submission and viva checklist
Check assigned experiments, course eligibility and format. Run clean setup, retain actual outputs and negative tests, cite sources and contributors, remove secrets/private records and state all limits. Additional linked lab files are resources, not a guarantee about your college requirements.
Resources and sources
Original links are preserved. The existing OWASP 2021 link is a historical resource, not a claim about the current ranking. Subject core pages and official documentation explain current concept/application assumptions.
Comments
Post a Comment