a) Prolog Program for TSP (4 cities)
% Distances
dist(a,b,10). dist(a,c,15). dist(a,d,20).
dist(b,c,35). dist(b,d,25).
dist(c,d,30).
dist(X,Y,D) :- dist(Y,X,D).
% Path cost
path_cost([_],0).
path_cost([A,B|T],Cost) :- dist(A,B,D), path_cost([B|T],C), Cost is D+C.
% All tours starting at Start
tsp(Start,Path,Cost) :-
Cities = [a,b,c,d],
select(Start,Cities,Rest),
permutation(Rest,Perm),
append([Start|Perm],[Start],Path),
path_cost(Path,Cost).
% Find shortest
shortest_
| # | Key Term | Quick Meaning | Example |
|---|---|---|---|
| 1 | Subject | The doer of the action. | She runs fast. |
| 2 | Verb | An action or state word. | She runs. |
| 3 | Auxiliary Verbs | Helping verbs. | She is running. |
| 4 | Predicate | The verb and all info about the subject. | The dog barked loudly. |
| 5 | Subject-Verb Agreement | Verb must match the subject (singular/plural). | He walks, they walk. |
| 6 | Simple Sentence | One complete idea (IC). | I love pizza. |
| 7 | Capital Letters | Start sentences |
#1. Initial Setting Time:It is the time interval between the moment water is added to the cement and the time at which the paste starts losing its plasticity.
#
2. Final Setting Time:It is the time taken from the moment water is added to thecement until the paste has completely lost its plasticity and has attained sufficient firmness to resist certain pressure.
#The water-cement ratio (w/c ratio) is the ratio of the weight of water to the weight of cement used in a concrete mix.
effect of water
Here's a concise and clear introduction to Regular Expressions (RegExp) in JavaScript, covering usage, modifiers, patterns, methods, and string integration:
Regular Expressions are powerful patterns used to match, search, and manipulate strings. In JavaScript, regular expressions are objects used with string methods to perform pattern matching.
const pattern = /expression/modifiers;
Or using the constructor:
const pattern =...
BIOMECHANICS OF HUMAN MOTION – FINAL EXAM CHEAT SHEET
1. KINEMATICS (Motion Without Forces)
Key Formulas:
Displacement:
Δx = x₂ − x₁
E.g.: If a sprinter moves from 2 m to 8 m → Δx = 6 m
Velocity (v):
v = Δx / Δt
E.g.: 6 m in 2 s → v = 6 / 2 = 3 m/s
Acceleration (a):
a = Δv / Δt
E.g.: Speed changes from 2 m/s to 6 m/s in 2 s → a = (6−2)/2 = 2 m/s²
Angular Motion:
θ (rad) = arc length / radius
ω = Δθ / Δt
α = Δω / Δt
E.g.: A joint rotates 90° (π/2 rad) in 0.5 s → ω...
Software Project Management (SPM) is the discipline of planning, organizing, and managing software projects, focusing on scope, time, cost, and quality.
Define scope and objectives
Identify tasks (WBS)
Estimate resources and time
Schedule tasks
Assign responsibilities
Plan risk management
Monitor and control progress
Finalize and review
Pros:
Predictable timelines and budgets
Clear
Overlapping histograms semi-transparent parameter-alpha Data structure is best for implementing BFS-collections.deque Grid value with obstacle = 1 Markdown jupyter-# Least squares via normal equations-Direct matrix inversion(normal - XTXβ=XTy closed-form-β=(XTX)−1XTy) Integration method for simulating orbits-Runge–Kutta 4th Technique brute-force search-Nested loops(loop in loop)
Python Basics Dynamic typing: variables have no fixed type; type determined at runtime | Indentation: 4 spaces
teractions, forming the foundation for life on Earth. It provides essential resources and regulates vital systems, but human activities have led to significant environmental degradation. Addressing this issue requires understanding the impacts of pollution, deforestation, and resource depletion, along with implementing sustainable practices for protection and restoration.
The Importance of the Environment
The environment is crucial for the survival of all living organisms, including humans....
Data reduction is a technique used in data mining to reduce the size of a dataset while still preserving the most important information. This can be beneficial in situations where the dataset is too large to be processed efficiently, or where the dataset contains a large amount of irrelevant or redundant information.