This page contains English translations and solutions for the Relational Programming (Bevezetés a programozásba or bevprog) problems of ELTE. I've solved them myself, and they haven't been independently verified yet, so don't take them at face value.
You can read a cursory introduction, and find some links in this Advogato article.
- 01. Bounds: Given an integer function f and a non-empty interval [m, n], compute the minimal and maximal values and positions of f in the interval. [Formal specification | Solution]
- 02. Greatest Common Denominator: Given two natural numbers x and y, compute the greatest common denominator. [Formal specification | Solution]
- 04. n-th Power: Calculate the nth power of x. [Formal specification | Solution]
- 05. Division: Given two natural numbers a and b, compute the quotient and remainder of a/b, using only subtraction, addition, and the comparision operators. [Formal specification | Solution]
- 11. Matrices: Sum: Given a square matrix m[1..n, 1..n], compute the sum of the lower half triangle. [Formal specification | Solution]
- 24. Number of Digits: Given two natural numbers x and k, compute the number of digits needed to represent x in base-k. [Formal specification | Solution]
- 25. Sum of Digits: Given two natural numbers x and k, compute the sum of digits representing x in base-k. [Formal specification | Solution]