4. Task and order of execution / Завдання та порядок виконання
Source of tasks. The three tasks below are taken exactly from the assignment. Implement the described behaviour; the input/output examples are authoritative.
Order of execution
The tasks are grouped into three difficulty bands. Implement them in order and test each against its example; your score corresponds to the band of tasks you complete correctly.
Easy tasks (60–74 points)
Task 1 — Combinatorics Calculator
Objective: Write a program that calculates the number of Permutations,
Arrangements, and Combinations for given n (total elements) and k
(selection size).
- Input: Total elements (n):
5; Selection size (k):3 - Output:
- Permutations ():
120 - Arrangements ():
60 - Combinations ():
10
- Permutations ():
Medium tasks (75–89 points)
Task 2 — Statistics Analyzer
Objective: Implement a program that reads a set of values and calculates the Mathematical Expectation (Mean), Variance, and Standard Deviation.
- Input: Dataset:
{2, 4, 4, 4, 5, 5, 7, 9} - Output:
- Mathematical Expectation (E[X]):
5.0 - Variance (D[X]):
4.0 - Standard Deviation ():
2.0
- Mathematical Expectation (E[X]):
Hard tasks (90–100 points)
Task 3 — Combinatorial Generator
Objective: Write a program that generates and outputs all specific Permutations, Arrangements, or Combinations for a given set of elements.
- Input: Set:
{A, B, C}; Operation: Generate Permutations - Output:
- Result:
(A, B, C), (A, C, B), (B, A, C), (B, C, A), (C, A, B), (C, B, A) - Total count:
6
- Result: