Problem Detail: A certain political party wants to encourage women to participate in their primary elections, so they decide, that the 4th position is reserved for a woman. That is, if there is no woman in the top 4 positions, then Read More …
Author: ignougroup
[Solved]: Why don’t we emphasize “length of input string” when considering time complexity of sorting algorithms?
Problem Detail: The knapsack problem is $O(c,n)$ where $c$ is the capacity of knapsack and $n$ is the number of items. Yet it’s exponential because the size of the input is $log(c)$. However, why don’t we emphasize length of input in Read More …
[Solved]: Selecting random points at general position
Problem Detail: How will you find a random collection of $n$ points in the plane, all with integer coordinates in a specified range (e.g. -1000 to 1000), such that no 3 of them are on the same line? The following algorithm Read More …
[Solved]: Partition points in a plane with a straigth line
Problem Detail: Given are a 2D plane and a array of points in this plane, with every point having an integer value assigned. Is there an algorithm which, when given a ratio a/b, divides the plane with a straight line, so Read More …
[Solved]: How to prove “The power set of a countable set must be uncountable”?
Problem Detail: I’m not sure if this statement is correct, but my friend said so. The problem arose from this T/F question: Let $F={f: f$ be a primitive recursive function from $mathbb{N}$ to $mathbb{N}}$, then $2^F$ (Power set of $F$) is Read More …
[Solved]: Check if adding an edge to a DAG results in a cycle
Problem Detail: On the begining: It is a programming contest problem, but not from on-going one. Unfortunatelly, I can’t provide any link to this task, because it is not publically available. It was from one of the Polish local programming contest Read More …
[Solved]: Facts about internal and external path lengths of binary tree
Problem Detail: While learning binary tree’s properties, I came across internal path length and external path length, number of comparisons required for successful and unsuccessful search. My book specifies some facts about these as follows: $S_n=1+frac{U_0+U_1+…+U_{n-1}}{n}$ For large $n$, $S_n=2 log_en$ Read More …
[Solved]: Family of types in type theory
Problem Detail: Can anyone simplify the meaning of families of types index by a type. It looks i get it but quite not understood it. What do you mean by a “family” ? I understand index by a value (n length Read More …
[Solved]: regular expression: sum of positive fixed point decimal numbers
Problem Detail: I need help with this exercise. Indicate the regular expression for the following Languages. Explain your expression in one sentence and indicate the basis form of the alphabet. Indicate also every assumption you make. i) Sums of positive fixed-point Read More …
[Solved]: Difference between edges in Depth First Trees
Problem Detail: I have a directed graph, where each node has an alphabetical value. The graph is to be traversed with topological DFS by descending alphabetical values (Z-A). The result is $M,N,P,O,Q,S,R,T$ (after reversing). Several DFS trees are created during this Read More …