instruction
stringlengths
35
29.1k
A simple walk is a path that does not contain the same edge twice. A simple walk can contain circuits and can be a circuit itself. It just shouldn't have the same edge twice. A simple undirected graph is an undirected graph with no loops and multiple edges. A complete graph is a simple undirected graph in which every p...
I am doing some image processing involving solving a system of linear equations. I am getting some errors and bits of the image looks corrupted. I would like to know what is the most stable way to solve these systems (I don't care how much cpu it takes to compute). It should try to avoid roundoff, catastrophic cancella...
I'm brushing up on stuff related to analysis of algorithms. And I have a question about this PDF I found. This is where I'm confused: Question 2: What if instead we decide to double the size of the array when we resize? Answer 2: This is much better. Now, in any sequence of n operations, the total cost for resizing is...
I need to proof the following by turing reduction. Given two languages: $Q= \{(\langle M_1 \rangle , \langle M_2 \rangle ) \mid L(M_1) = L(M_2)\}$ $I= \{\langle M \rangle \mid \;\vert L(M) \vert = \infty \}$ Where $\langle M_1 \rangle$ is the encoding of Turing Machine $M_1$. I need to show that $ I \le_T Q $ ($I$ can ...
Question 1: Why we can/can't solve the following problem using a geometric constraint solver? Question 2: Is there any algorithm to solve this problem? Question 3: Can we reduce this problem into some known computational problems? Input: 1. $C_1, ..., C_n$: Centres of $n$ circular rings. 2. $S$: A polygon of arbitra...
In what king of application, in which we insert or delete objects, we always delete the oldest one (the least recently stored, more precisely which was the first object stored) ?
Given two languages: $Q= \{(\langle M_1 \rangle , \langle M_2 \rangle ) \mid L(M_1) = L(M_2)\}$ $I= \{\langle M \rangle \mid \;\vert L(M) \vert = \infty \}$ I'm trying to Turing reduce $Q$ to $I$ ($Q \le_T I$), not the other way around as solved here Any ideas on how to solve this? What exactly will the Turing machine ...
I am using the following algorithm to solve an optimization problem I have. I was wondering if there is a proper name for this algorithm in the literature. Let $f(x)$ be my objective function. I guess some $x_0$ and see have it performs. Next, I randomly generate around $x_0$, some $\{x_k \}$ for $k \in [1:K]$ and s...
Assume we have a perfectly balanced Binary tree. We have the following algorithm: For each passed node, traverse through all its ancestors and then do the same algorithm for the left and right child of the node. So, the way I try to find the Big-O complexity is this: There are O(N) nodes in the tree and each has O(log2...
Horn3SAT is $P$-complete problem under logspace reductions. Since Horn3SAT is in $P$ its complement must have short witnesses. I am looking for natural short proof that a Horn3SAT formula is not satisfiable. Examples for similar problems in $P$ are 2-coloring problem and planarity problem. A graph is not 2-colorable if...
Be $H_0$ the special halting problem with $$H_0 = \lbrace \langle M \rangle \in \lbrace 0,1 \rbrace^* | \varepsilon \in L(M)\rbrace$$ and $\overline{H_0}$ being its complement. Is $H_0$ reducible to $\overline{H_0}$? $$H_0 \leq \overline{H_0}$$ I guess that this is not possible as $\overline H_0$ is not semi-decidabl...
I have a set of $n$ points which are defined in a metric space – so I can measure a 'distance' between points but nothing else. I want to find the most central point within this set, which I define as the point with the minimum sum of distances to all other points. The metric computation is slow, so needs to be avoided...
I am trying to develop an ant colony optimization algorithm that will minimize the electricity load shedding on a given graph. The graph has some supply vertices and some demand vertices. Supply vertices have the electricity to supply to the other demand vertices. It assume that the supply vertices fulfil its demand t...
I am currently trying to implement the divide and conquer method of computing the 3D convex hull given by Preparata, outlined here: http://www.cs.jhu.edu/~misha/Spring14/Preparata77.pdf On page 91 it reads: The convex hull CH(A, B) of A and B may be obtained by the following operations (see Figure 4 for an intuiti...
Imagine villages (or Internet Routers) scattered all over the world (or World Wide Web) connected by roads or shipping lanes (or Cables). All villages (nodes) has the same amount of villagers which visit some other villages (their intentions are undefined, so it's basically random) through shortest paths over the roads...
This is a somewhat big question since there are many variations on the VRP. The most studied seems to be the capacitated version, the CVRP, but variations considering time windows, backhaul/linehaul, etc. are also studied, and of course characteristics of the graph and number of vehicles matter too. The most general VR...
The $n$-qubit Hadamard gate acts as, $$H (\otimes^n \vert 0 \rangle ) = \otimes ^n ( H | 0 \rangle ) = \otimes ^n ( \frac { |0\rangle + |1\rangle }{\sqrt{2} } ) = \frac{1}{\sqrt{2^n} } \sum_{x \in \{ 0,1\}^n} |x\rangle $$ So it is capable of producing the uniform superposition state over an exponential number of states...
I have an adjacency matrix, call it A, representing a directed graph. I want to find all paths of length k. I know that A^k gives me the number of paths of length k between i and j, for each entry (i, j). But I want to know the actual edges in these k-length paths. What's the best way to find all k-length paths in my ...
Both Linear Bound Automata (LBA) and Turing machine (TM) can be used to express the language accepted by below Finite Automaton (FA). Which of LBA or TM would you choose to express the given language and why? Justify your decision with logical reasons.
Currently I'm writing my thesis and I made the assumption that all programming languages are made for humans and humans alone. There's no reason to make compromises to fit the machine needs. Developers should care about readability for humans, not for machines. I don't want to discuss whether I'm right or not, because ...
Consider the most naïve backtracking for CNF-SAT. It only checks if an assignment satisfies the input formula $\phi$ when all the $n$ variables have values assigned. Let $m$ be the size of $\phi$. Then the time complexity for this backtracking is $O(m 2^n)$. Now, consider DPLL. This algorithm is just a simple backtrack...
I was reading Operating Systems by Galvin and came across the below line, Not all unsafe states are deadlock, however. An unsafe state may lead to deadlock Can someone please explain how deadlock != unsafe state ? I also caught the same line here If a safe sequence does not exist, then the system is in an unsafe ...
Let's define: $ a_i:a_j \Longleftrightarrow a_i < a_j;\ a_i=a_j;\ a_i > a_j $ So it is similiar to normal operation $<$, but $:$ give information when elements are equal. I want show that lower bound for sort array of $n$ elements with this operation is $\Omega (n\log n)$. I know proof for normal comparison. Neverthel...
input : $array[1...n]$ output: permutated array Our algorithm should be probablistic and complexity should be $O(n)$. Could you give me hint ? My weakness is probability theory and it is why I have a problem.
Say I have a black box $f : 2^n \to 2$ and I want to determine if it is satisfiable. That is, does there exist an input how which it returns true. I am for the purposes of this considering $n$ to be the size of the problem. Perhaps that is a bad assumption to make but it seems a reasonable assumption. Clearly I can re...
As I'm currently preparing for my Algorithms and Complexity exam, I was facing today an other reduction and I'm not quite sure if I solved it correctly. Given are two languages $L_{finite}$ and $L_{nonuniversal}$: $L_{finite} = \{\langle M \rangle \mid \vert L(M) \vert < \infty \}$ $L_{nonuniversal} = \{\langle M \ran...
I'm trying to understand how Slab Allocation works and why it is different or better than ordinary paging. I found this diagram which I believe would be helpful if it had more explanation. Some questions: What do the 3KB and 7KB items represent? Must they be related somehow? Why are they packaged that way? In the cach...
I have a tricky problem, look: $n, \le 100, m\le 1000 $ where $m$ is number of edges and $n$ is number of nodes. On every directed edge there is word $w$ such that $|w| \le 1000$. There is given one word $s$ ($|s|\le 100000$). Our task is asnwer to question: Is there transition in this graph such that we build this wo...
From time to time you can write a grammar that creates shift/reduce conflict (for example) but after reading the grammar you notice that if you rewrite the productions the conflict will go away, despite the fact that the rewritten grammar is obviously equivalent and accepts exactly the same language. Are there some aut...
ONE = {(G) : G is a CFG such that L(G) contains exactly one string} . I know to prove this is decidable I need to create a DTM that would recognize it and HALT on all input. I am struggling at coming up with a high level definition. My Possible Solution: On input G, where G is a Context-free grammar, If non-terminal h...
What's an easy-to-program way of listing all 6-cycles in a directed graph? I've done some reading on the general case of even cycles, but it's rather complicated. I found a really neat approach for 4-cycles, in this post, and I was wondering if there's something similar for 6-cycles. My graph isn't that big (maybe a fe...
I'm trying to get myself more familiar with Timed Automata theory. At some point I came across the expression "side-effect free" like in the following: A guard is a side-effect free expression that evaluates to a boolean. But except for the following definition¹ I couldn't find any good source that explains what it a...
If I have $n$ training observations, $m$ number of features per observation, and my neural network has $x$ neurons in the 1st layer, $y$ neurons in the 2nd layer, and 1 output neuron, what is the runtime of finding the parameters for my neural network? Using backpropagation? Using the best algorithm out there to do so?...
Two examples, one in PHP: function adder($i){ static $a = 0; $a += $i; return $a; } A similar effect can be achieved with closures in javascript: var adder = (function(){ var a = 0; return function(i){ a += i; return a; } })(); In javascript I've really just created an object. Implementation...
What is a regular expression or finite automaton that will accept words in the alphabet $\{a,b,c \}$ where each letter appears at least once? Acceptable words: $ abc, cba, cbcbcba, abbbcaabb$ Unacceptable words: $aab, babababababa, bbbbbaaaaa$ I would be interested in seeing both the regex and the automaton. Then I c...
L = {w belongs to {0, 1}* ∣ w has at most three 0’s}. Why is this regular language? According to pumping lemma, what I think is that.... Suppose $x$=$0^2$, $y$=$0^1$, $z$=$1^n$ ($w=xyz$=${0^2}{0^1}{1^n}$), then if we pump $y$, we may have more than three $0$s. What am I missing?
I know that quadtree could be used in collision detection. But most articles I found are related with quadtree construction and retrieval. I wonder if there are some circumstances which involve both a great number of insert and remove operations? If any, please list out the papers. I am planning to develop the quadtree...
If I have an array a of arrays, in many languages they may have different size. Is there a word for an array of arrays where all the arrays have the same length? Edit: An array of arrays may have the following form: [ [ 1, 2, 3 ] [ 1, 2, 3, 4 ] [ 1, 2 ] ] But in order to convert this to a matrix you would have...
I am studying (on my own, this is not homework) Papadimitriou's "Computational Complexity" textbook, 1st edition. On page 66, we have: 3.4.1. Problem: For each of the following problems involving Turing machines determine whether or not it is recursive: (a) Given a Turing machine $M$, does it halt on the empty string? ...
I have a collection of non-empty sets $S_i$, where $1 \le i \le n$, which are constructed from elements of a universe $U$. I need an algorithm that gives me a set $T$ of minimum cardinality ($T \subseteq U$), such that $T \cap S_i \ne \phi, \forall i$, where $1 \le i \le n$. I am not sure whether it is an NP-complete p...
Why does $\Pi_i^p \subseteq \Sigma_i^p$ imply $\Pi_i^p = \Sigma_i^p$?
Let's say there are two lists of objects, list1 and list2, and that there is a function that can generate the "distance" between an object in list1 and an object in list2. What I would like to do is create a list of pairs of objects from each list such that the sum of all the distances of each of the pairs is minimal. ...
Is there ANY compression type that can compress a file, and then that compressed file can be searched without uncompressing the file?
Let $H$ be a $s$-wise independent family of hash functions from $\{1,\ldots,M\}$ to $\{1,\ldots,N\}$. It is easy to bound one collision, but are there good bounds for muliple collision ?
I'm looking for a problem that is NP-Complete (even) if the number of input values is at most a polylog of the input size. So some or each value in the input should be so large that the number of values is "negligable". One way to do this is to say that there is only one input value that should be split and represents ...
Is there a difference between a "data dependence graph" and a "data dependency graph"? I have seen both terms - sometimes used interchangeably sometimes not. To make things even more complicated, a "data dependency graph" is sometimes also called a "data flow graph" (see e.g. here). The term "data dependence graph" i...
Given an unsorted array $A$ of $n$ numbers and inputs $i$ and $j$, can we find the number of values $i<k<j$ in $A$ in O(1) time complexity by doing some preprocessing? An additional requirement is that the preprocessing should be $O(n)$ in both time and space. I tried calculating an auxiliary array $B$ of size $M$ (whe...
Is there a characterization of graphs whose edge set decomposes into a disjoint union of perfect matchings? One trivial class of such graphs are $d$-regular $(n,n)$-bipartite graphs. Their edge set will decompose into $d$ disjoint perfect matchings.
$N$ Aliens want to reach their Moon ($D$ meters away), but they can only put on each other, making a vertical chain. Every $Alien(i)$ has an height $X(i)$ and a lenght of their arms $Y(i)$. When the vertical chain is made we enumerate the Aliens from $1$ to $N$ ( $Alien(1)$ is the alien at the bottom of the chain...
Background: I'm working on an application which is supposed to teach users how to write Japanese kanji. Each kanji is represented as an array of strokes. Each stroke is an array of 2d points. Strokes (2d paths) are supposed to be drawn in certain order, so my question is limited to recognizing similarity b/w single dra...
How do conjunctive regular path queries and subgraph isomorphism relate to each other? It seems that conjunctive regular path queries are a specialised form of subgraph isomorphism. The follow is the definition of a conjunctive regular path query given in "Expressive Languages for Path Queries over Graph-Structured D...
So here is the problem: There are n objects in a super market that you need to retrieve, then you need to go to the cashier register in the end. How do you find the best path of traversing the least distance to retrieve the objects and finally go to the cashier register? I could only find a brute force method of findin...
I need to generate random number in a given interval using random bits. For example, If I want to generate a random number between 1 to 6, inclusive, I can concatenate three random bits which gives me a possible range of 000 to 111 (0 to 7), inclusive. My intuition says after concatenating 3 random bits, if the result ...
I was wondering if there were any paradigms that describe how to save "state checkpoints" in a program so that a user may go back and reopen a program to the given state. In my situation I see that there are many ways to do it each with their own drawbacks. I wanted to know if there is a way that has proved to have th...
If we are given an analysis of an algorithm to be, for example, $5n^3 + 100n^2 + 32n$, can we therefore say that $T(n) = O(n^3)$, and $T(n) = \Theta(n^2)$, and $T(n) = \Omega(n)$, and all of those be correct for that analysis? I have read the formal definitions for all of these and it does not help me to understand the...
I would like to use a data structure allowing fast access, either a balanced binary search tree (BST) for $O(\log n)$ access time or an open hash table for constant access time. 1) What is the exact memory usage of a BST or hash table, for storing $n$ values? For instance, if we consider a BST, are $n$ pointers suffici...
Assume that we have $l \leq \frac{u}{v}$ and assume that $u=O(x^2)$ and $v=\Omega(x)$. Can we say that $l=O(x)$? Thank you.
I was wondering if there were relation between the complexity classes $P^{\#P}$, $NP^{\#P}$, $(Co-NP)^{\#P}$ ?(except the trivial inclusions) I've the feeling that when taking a $NP^{\#P}$ machine, we can transfer the non-determinism inside the non determinism of the counting oracle, and thus leading to the inclusion $...
In the Welch-Berlekamp algorithm for decoding Reed-Solomon codes, one is given a list of points $(a_i, b_i)$ representing a message with $e$ errors on the $b_i$ in unknown locations (and $e$ is given to the algorithm). The output is a polynomial passing through all of the given points except those in which errors occur...
Suppose that an algorithm uses only comparisons to find the $i$-th smallest element in a set of $n$ elements. Show that it can also find the $i−1$ smaller elements and the $n−i$ larger elements without performing any additional comparisons. I would like to show my solution. I ask you for checking it :) Let $k$ will be ...
While reading this solved quiz on concurrency control, I got stuck on exercise 2, which reads as follows: 2) Consider the following schedule: S: r1(X), w2(X), r3(X), r1(Y), w2(Z), r3(Y), w3(Z), w1(Y) (a) (2 points) Draw the precedence graph. (b) (1 point) Is S conflict serializable? No. After reading that S is not c...
There are 2n product and their prices: P={p_1, p_2, ..., p_2n}. When we buy the products in pairs we get the product with lower price for free. I'm trying to prove formally that the following algorithm results in optimal solution: Sort P from high to low. Return the sorted prices as pairs. This solution is pretty str...
Continuation Passing Style (CPS) is a form of code where the control is passed explicitly, by passing the continuation of the code at each call point, unlike direct style. There are many descriptions in the literature for how to convert from direct style to CPS. The following pseudo-JavaScript: function direct() { ...
In the book, Algorithm Design Manual by Steven S. Skiena, he states "Becoming familiar with many different algorithmic graph problems is more important than understanding the details of particular graph algorithms." Unfortunately, I don't quite understand this phrase, as this is my first experience with Algorithm Desig...
In the [Kushilevitz and Nisan 2006, P.10] they give an exercise which says as following: Exercise 1.18: Let $X=Y=\{1,\ldots,n\}$. A geometric rectangle is a set of the form $\{(x,y)|x_{\min} \leq x \leq x_{\max}, y_{\min} \leq y \leq y_{\max}\}$, for some values $x_{\min},x_{\max},y_{\min}$, and $y_{\max}$ in $\{1,\ld...
A lot of activation functions in neural networks (sigmoid, tanh, softmax) are monotonic, continuous and differentiable (except of may be a couple of points, where derivative does not exist). I understand the reason for continuity and differentiability, but can not really understand a reason for monotonisity.
In some languages (such as C), arrays seem very simple to me. When allocating memory for these, all you need to do is pick a starting point in memory and then allocate the next dataTypeSize * arrayLength bytes as reserved. Retrieving items just means looking at the memory address startPoint + (index * dataTypeSize). Bu...
What's the difference between the regular expressions $a^*+b^*$ and $(a+b)^*$. Do both of these generate the same language? I was told in a lecture that $(a+b)^*$ will generate string concatenation of $a$ and $b$. How could this be possible?
I just read in Effective Java about the hashCode method: Store some constant nonzero value, say, 17, in an int variable called result. For each significant field f in your object (each field taken into account by the equals method, that is), do the following: a. Compute an int hash code c for the field. b. Combine th...
The syntax of a language is a structure. The semantic of a language is a structure. The semantic of a language is a model of its syntax. And that's all ? The duality syntax/semantic is just model theory applied to languages ? (A short answer could be ok; I have already read the wikipedia pages !)
For years, I've been told (and I've been advocating) that problems which could be solved in polynomial time are "easy". But now I realize that I don't know the exact reason why this is so. Intuitively, I can guess what the relation between P problems and easy problems is. Experience tells me that P problems are easy to...
Say you execute a clear interrupt instruction (CLI) in a pipelined CPU. While that instruction is being fetched, an interrupt occurs, so the instruction after the CLI is from the interrupt handler. You excepted no interrupts because of the CLI instruction but you still got one. How is this problem solved?
If I've understood gamma correction correctly (and I probably haven't), a gamma transform to an image raises the value of the intensity level of the input pixel to the power of gamma, where gamma can be greater than one or less than one. Pout = (some_constant) x Pin^(gamma) In every example that I've seen, a gamma valu...
How do I interpret this equation? Decimal value of signed fixed point number $-2^3+2^0+2^{-1}+2^{-2}$ $$ V = (-1)^{b_{N-1}}\times 2^{N-P-1} + \sum_{i=0}^{N-2}(b_i\times 2^i)\times 2^{-P}\,.$$ $N$ is the number of bits. The point is at a fixed position, $P$ from the right. Another question: why is it $-2^3$ inste...
I want to ask exactly what is the relationship between problems and languages. We know that the set of all languages uncountable. Is the set of problems also uncountable? Can every problem be defined by a language? Can a language solve more than one problem and vice versa? Is there one-to-one correspondence between p...
Last couple of days I've been pulling my hair trying to find the name of a bomberman-esque algorithm which finds solutions to the question of where to place a single bomb so as to blow all targets up, either directly if all targets are within the blast radius (and axis) of a single bomb (placed in an empty cell) or vi...
I'm studying CS online, and I'm reading this lecture on recursion, see "3.2. A Mathematical Example". I understood the beginning and I even made a program that calculates $X$ to the power of $N$ using recursion. Reading on, I quote from the lesson's content: Find an algorithm for raising a number $X$ to the power $N$,...
If I have two sorted lists. list A => 1 -> 2 -> 4 -> 11 -> 31 list B => 2 -> 31 -> 54 Now what should be the order of (sorted) merge and why? According to the rule, If the list lengths are m and n, the merge takes $O(m+n)$ operations, the order should be $O(5 + 3)$. Am I right? I would appreciate if someone help me o...
Does anyone know any constant factor approximation hardness results on Group Steiner Tree when the groups partition the terminals, i.e. every terminal belongs to exactly one group? The (intuitive) reduction from Set-Cover seems to fail in that case, and it also feels easier. It seems to me you could solve this if the ...
I am looking for a way to split a tree into $k$ clusters so that the cluster with largest diameter is as small as possible. All edges have the same length. I'm hoping for an algorithm that can handle arbitrary trees (with arbitrary branching factor), not just binary trees.
I just started reading Vazirani's book "Approximation Algorithms". It is legally available online here. On page 5 (23 in the pdf), it says that the following decision problems are in NP: Is the size of the minimum vertex cover in $G$ at most $k$? Is the size of the maximum matching in $G$ at least $l$? I can't see wh...
I am calibrating a camera and estimating the projection matrix using the least-squares technique described here. So far, I thought that the projection matrix that I got with this method was invariant, e.g., I could use it disregarding if the camera was moved or not. However, I have been doing some additional reading,...
I'm currently working on a project discussing applications of the Delaunay Triangulation, and the primary use-case is applications to TSP (or relaxations of the problem). See: http://www.lancaster.ac.uk/staff/letchfoa/articles/triangulations.pdf for context. One snag in the approach is that it occasionally produces no...
I have at hand a linear program related to load balancing. However I have no idea what this is and wikipedia gives me something too simplified/abstract to be useful. I wonder if someone can explain the basic lingo used in the formulation of the linear program. The goal of the program is of course to introduce the maxim...
It was asked in an exam why a color video compress better than a black and white (grayscale) video using MPEG but can't find anything explaining it. In other words, we would apparently get a better compression ratio when compressing color videos than when compressing BW videos.
The following O(n^2) sorting algorithm works but I can't figure out why. array a // length n, indexed 0 to n-1 for ( i = 0; i < n; i++) for ( j = 0; j < n; j++) if(a[i]<=a[j]) swap(a[i],a[j]); It seems it is not bubble sort as after a single iteration neither the minimum or maximum is in place....
Give an array of integer has been sorted (non-decreasing order), we need find the index of minimum number number that is greater than key given, I wrote two functions, they're identical except the return lines. int minimum_index_greater(int *a, int lo, int hi, int key) { int left = lo - 1; int right = hi + 1; ...
I've heard that YouTube had a problem with the view count on Gangnam style since the number of views exceeded the variable byte size. What's the problem with creating really large variables? Why does it end with unsigned long, for example? Can you create bigger and bigger variables to hold more and more bytes? Is the...
Let's say we have some function, float distance(String a, String b) { /*...*/ } to find the Levenshtein distance between two strings, and we have a large array of strings. String[] strings = new String[1_000_000]; What would be an acceptable approach to map a String a to its closest match (i.e., the String b that pr...
There is a lot of similarity between Propositional logic and Boolean algebraic expressions. Similar aspects : 1) Both has variables of two states. 2) Operations of Boolean algebra and propositional logic are similar. 3) Simplification of formula expressed in logic can be minimized using Boolean algebra and vice versa....
I'm trying to solve the problem of transferring data from a pdf file to another file type. When extracting data from PDF files I am to use the exact coordinates (where each unit is 1/72 of an inch in a pdf file) to the same position in another file type. Say a text file or a word document etc? I'm having trouble ma...
We are given a graph $G = (V,E)$ and we need to find an assignment of non-negative edge weights (You must give every edge a non-negative weight). We are also given a set $R\subseteq V$ and mapping $c_{a,b}: R\times R \rightarrow \mathbb{R^+}$ where $\mathbb{R}^+$ is all positive ($> 0$) reals ($c_{a,b} = c_{b,a}$ for a...
According to the Bell-Lapadula model, write access is only to Subject $S$ on object $O$ provided if: $L(S) \leq L(O)$ where $L$ is the clearance level for $S$ and classification for $O$. This seams counter intuitive. Are there any attacks that this protects against and what other benefits are presented by it?
I'm interested in the time complexity of the following problem: Given an undirected graph $G=(V,E)$ and a weight function $w: E \rightarrow \mathbb{Z}$ (so weights can be negative, too), color the vertices in such a way that the sum of the weights of the monochromatic edges (i.e. those between same color vertices) is ...
Let a convex bounded polytope be given by an intersection of half planes: $Ax \leq b$. Let $z=Cx$ be a vector (in my case $z$ is 2-dimensional, while $x$ has a higher dimension). How can I compute $D$ and $e$ such that $Dz \leq e$ is a projection of $Ax \leq b$ into the $z$-space.
I would like to prove that we need at least five comparisons to find median amoung five numbers. And my proposition: Let's consider tree of comparisons. There are at least $5 \cdot {4\choose 2} = 30$ possiblities, so in our tree we have at least $30$ leaves. So what is minimal height of this tree when we have at least...
Are there any benefits of having grammar in CNF/GNF for LR parser? I have those in mind: total speed of creating a parser (that is time for creating CNF/GNF out of the grammar, and then creating action table), the size of action/goto table (in total) is there any "side-effect" of removing some of shift-reduce conflict...
I looked at some old OS theory books of mine and noticed that one glaring omission in all of these OS books is how to actually keep track of physical pages that are free (i.e. algorithms for actually implementing the free list). I know pretty well how userland memory allocators work, but a big difference with physical ...
Here I read that: Haskell definitely does not have the most advanced type system (not even close if you count research languages) but out of all languages that are actually used in production Haskell is probably at the top. So I am asking two things: which research languages have more powerful type systems than...
Let $G=(V, E)$ be an unweighted and undirected graph, and $s, t \in E$. The problems starts with $n$ tokens on $s$. The goal is to move theses tokens to $t$ in a minimum of rounds with these rules : Each token can be moved up to once per round (a movement being when you transfer the token from $v$ the vertex that ho...