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 |
Admin.division of SK - our conditions, 8 self-governing regions, 79 districts, EU-NUTS N1: SR N2: units: BA, wSK, central, eastern N3: 8 self-governing regions N4: 79 districts N5: 2891 towns and villages municipality - settlement - place where peoplelive Area size region: smallest - BA, biggest - BB, most pop. - Prešov, least pop. - Trnava, most D pop - BA, least DP - BB Pop.pyramids: 1. expanding - preproductive dominate, triangular shape 2. contracting - SK most, post/productive dominate,
#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
Administrative Divisions of Slovakia Slovakia is divided into an administrative division with 8 self-governing regions- NUTS 1: The Slovat Republic- NUTS 2: 4 units - Bratislava,w Slovakia, C Slovakia, and E Slovakia- NUTS 3: 8 self-governing regions- NUTS 4: 79 districts- NUTS 5: 2891 towns and villages The largest region is Banska Bystrica, while the smallest is Bratislava most populated region is Presov, and the most densely populated is Bratislava. least populated region is Trnava, and the last
...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