- Find the minimum element and the position of all its entries in the list.
- Calculate the statistics of the entries in the list.
Divide a given list into several lists, writing down in the first list values less than 1!, in the second - less than 2! but not on the previous list, in the third - less than 3! but did not get to the previous two lists, the fourth is less than 4! but not in the previous lists, etc.
Find all the "top peaks" of the list and their positions. A list item is an upper peak if it is larger than its existing neighbors. Consider that the list consists of different items. For example, in the list [5, 4, 2, 8, 3, 1, 6, 9, 5]
the upper peaks and their positions are: (5,1), (8,4), (9,8)
.
For given words v and w, determine if the finite state machine admits at least one word that can be represented as vywy for some word y. If yes, give an example of the corresponding word vywy.
For each non-terminal A find:
minLengthR(A) = min{length (w) | A =>+ Aw, w is a word in the terminal alphabet}
and
wordsMinLenR(A) = {x | A =>* Ax, x is a word in the terminal alphabet, length(x) = minLengthR(A)}
Develop a simple expert system with more than 8 entities, generalizing terms, and properties that have multiple alternatives.
- Program and test three unary Maybe-functions to calculate the given three formulas.
- Using monad operations, program and test the Maybe-function to calculate the superposition of the above three functions:
- Submit the desired function using do-notation.
- (Optional). Submit the desired function without using do-notation.
- (Optional). Program and test the binary Maybe-function to calculate the last of the three given formulas (here n is considered a real number).
- (Optional). Using monad operations, program and test the Maybe-function to calculate such a superposition, when the above-mentioned binary function is replaced by the first function from point 1 instead of its first argument, and the second instead of the second argument:
- Submit the desired function using do-notation.
- Submit the desired function without using do-notation.