instruction
stringlengths
35
29.1k
Backgroud. I'm reading papers about cutting stock problem (CSP). Said Ben Messaoud, Chengbin Chu, Marie-Laure Espinouse (2008) Characterization and modelling of guillotine constraints. European Journal of Operational Research 191 (2008) 112–126. D.A. Wuttke, H.S. Heese (2017) Two-dimensional cutting stock problem ...
I read in Sipser's book that a machine can make copies of itself using a special function $q(w)$ which takes a string $w$ as input and prints out the string $w$. A $TM$ $SELF$ can print out its own description $AB$ using two parts. For the first part $A$ prints out $<B>$ since it has the description for $B$ inside its ...
Here are the details: (1) We are given a number $f$ of units of flow that we wish to transmit from the source node to the sink node. For example, $f=5$ units of flow (data or goods) should be transmitted from the source node to the sink node. (2) We are not given any plan or policy to transmit the flow. However, we kn...
As I am going through learning about compilation , what I see is the approach to the subject through machines , known as automata , which change from one state to another depending on the input provided to them . And there is an accepting state in the automata , which when reached indicates a valid language input . I w...
My understanding is that in Hoare Type Theory every imperative statement has a type of the form {Pre}res:T{Post} where T is the type of the result of the computation and Pre and Post are propositions representing respectively the pre and postconditions of the statement and res is the result of type T which can appear i...
Since the same contradiction from the Turing machine is still there, we allow the oracle not always return an exact value, and say it solves the halting problem if the probability of returning "HALT" equals to the one that the program halt. If not possible, can it solve a weaker halting problem?
Let $W$ be a subset of $\mathbb{N} \times \mathbb{N}$. Suppose $W$ is the Godel universal enumerable set (for the class of all enumerable subsets of $\mathbb{N}$, i.e. for any enumerable set $V$ subset of $\mathbb{N} \times \mathbb{N}$ there exists a total computable function $s:\mathbb{N} \rightarrow \mathbb{N}$ s.t. ...
I am having trouble understanding the affine gap penalty in the following example - Waterman-Smith-Beyer Algorithm: \begin{align*} D_{0,0} &= 0\\ D_{0,j} &= g(j)\\ D_{i,0} &= g(i)\\ \forall i,j > 0,~ S_{i,j} &= \min \begin{Bmatrix} \min_{1 \leq k \leq j}{(D_{i,j-k} + g(k))}\\ D_{i-1,j-1} + w(a_i,b_j)\\ \min_{1 \leq k \...
I've written a subset-sum solver. It outputs all subsets that sum to a given value, iteratively. I'm measuring its performance by the average amount of time taken per subset found. However, I suspect it may be faster than existing solvers in "near-worst" cases, but I don't know how to check this. What are some concrete...
I have a number of players, ranging from [0..N]. Each round every player is assigned a specific role, either 1, 2 or 3. floor(N / 8) role 3's are assigned, floor(N / 4) role 2's are assigned and the rest are assigned role 1's. At the moment, I pick people completely at random for roles 3 and 2, however, this has the ...
This question is closely related to Does an abstract syntax tree have to be a tree? and is partially answered there, but I would like to be more precise and to have more concise answers. What is the origin of the term? Are there any formal definitions of AST? If I understand correctly the spirit of the use of "AST" te...
Definition: $\text{P}$ is the set of languages that can be decided by a deterministic Turing Machine in polynomial time. I wonder if $\text{P}$ equals to the set of languages that can be decided by a non-deterministic Turing Machine in polynomial time? I think this has to be true because a non-deterministic Turing Mach...
We have a set of elements, say a vector of $n$ elements (actually, the data structure really doesn't matter in this case). It is NOT sorted. We want to check whether at least $n/2 + 1$ elements are equal. I have been thinking about an efficient algorithm to do so but I don't know, the fact that it is not sorted makes ...
I need to test whether an integer $b$ divides another integer $a$. Both integers are “bignums”, in the cryptography range ($10^2$ to $10^4$ bits). The integers are represented in binary. Assume that the integers are positive. Obviously, the faster the better. I'm primarily interested in fast performance when $a$ turns ...
Let $\Sigma = \{ (, ), ? \}$ be an alphabet. For a given string $s \in \Sigma^*$, we denote by $f(s)$ the number of ways to replace each symbol $?$ either with $($ or with $)$ such that $s$ is correctly parenthesized. For example, for $s = ((????)))?$ the strings $((()(())))$ and $(()((())))$ are possible, so $f(s) \ge...
Given $K$...# key values, $n$...# pointers in a node. I read somewhere, that the maximum depth is defined as $\lceil\log_{\lceil\frac{n}{2}\rceil}(K)\rceil$. However, it is not correct, as I can come up with a counterexample. When the tree is minimum filled, it won't work. E.g.: This is a valid $B^+$-tree, the root h...
Given a sorted list of booleans with consecutive 0s followed by consecutive 1s such as [0,0,0,0,1,1,1], binary search is able to find the first 1 after all the 0s in log(n) time. Is this technique generalizable to find the index to the maximum of a unimodal boolean list with a single 1 sandwiched between 0s such as [0,...
I am looking for a good heuristic function for solving a 2D $n\times n$ Rubik's cube using A* search. There is a game already in the play store. The rules of the game: Swiping LEFT means the leftmost cube of that row will come to the rightmost position in that row. All other cubes will be moved one position to the le...
I've calculated the running time of an algorithm I'm interested in to be $$O(0.24\cdot K\cdot 2^{w})\,,$$ where $K$ and $w$ are both variables. ($K$ is the number of elements in some set, and $w$ is the log of the largest element, so both are variables.) What kind of growth does this function have? I'll say it is expo...
I have a numpy array of shape N_Samples x 360, as an example, consider the following: [ 89 94 56 - - - 55] <-360 length vector [ 56 98 55 - - - 98] | | | | [ 67 55 99 - - - 77] Total N such vectors There is one label 0 or 1 corresponding to each of the 360- length vector I am ask...
I am looking for error detection codes, which support addition in the encoded domain and are separate (a tuple of ($N$, $R(N)$), where $N$ denotes the functional value and $R(N)$ its redundancy). So far I know residue codes where $R(N)$ equals $N \text{ mod } p$ and $p$ is a chosen constant. This scheme is closed unde...
I found a pseudo algorithm which describes bit blasting: click (page 156,157). I am trying to implement it in C, but I don't understand it yet completely. Let's make an example: Assume our bit-vectors have only a length of 2 bits (for simplicity) and they are unsigned and out bit-vector formula looks as follows: $\phi ...
The usual regular expressions I have seen are those with non-null inputs (e.g. $a$, $b$). A few days ago, I saw, for the first time, a regular expression that has a null ($∅$) in it. $$ r_{1}= (cε + d∅)^{*}, Σ = \{c,d\} $$ This confused me since I do not know how a language would be created from $r_{1}$. What would a l...
Is there a general name for a tree in which the leaves have some arbitrary values and the value of every other node is some "aggregate" function of its children? An example where the aggregate function is the sum: 14 / \ 4 10 / | \ 7 1 2 The function could also be the min, max, or any other function of th...
I am reading a paper called Back to Thin-Core Massively Parallel Processors by Ami Marowka (Computer, 44(12):49–54, 2011; IEEE Xplore). However I have a question about the title of the article: what does "thin core" (and for that matter, "fat core") mean? Thank you!
The Haskell List: Type -> Type constructor implements the Functor typeclass with function fmap f = map f. This functor that applies the morphism f to each element of a list works, but there are other equally valid functors, for example fmap f = map f . rev which first reverses the list before mapping over it. Is there ...
I've being trying to understand this statement for quite a long time especially the "number of positions" part, but i can't seem to interpret it correctly.What i understand is that the statement means that there should be two 0's seperated by a number of symbols that are multiples of 4 i-e (0 , 4 , 8 , 16...), accordin...
For instance, Subset Sum is classified : W[1]-hard, in W[P] (parameter:k, subset cardinality) by the Compendium of Parameterized Problems, how the parameter could impact the membership of the problem on a specific class? Looks like Parametrized Complexity is trying to provide a better problem classification for NP...
show that $(\sqrt n)^\sqrt n=o(2^{n^{0.6}})$ i just know that small o-complexity of $\sqrt n=o(n)$ but how to prove this
I recently had to do the assignment to determine the space complexity of methods similar to the following. I need to state the recurrence equation (line by line), derive the closed form and use that to determine the Big Oh of the space complexity. I have already handed it in, but I still have trouble understanding how ...
I have a set of strings, lets call them RULES. I have a function F which given 2 strings deterministically returns boolean value. Given one string, lets call it QUERY, what is the fastest way to find longest prefix (lets call it P) of QUERY which is a member of RULES for which F(P,QUERY) returns true? That was very gen...
I'm trying to solve the following problem in the most efficient way I can find. I want to trade my items for someone elses items, every item have a price and a value. I want to maximize the value of the items I trade, so for example: My items: Banana, P: 10, V: 5 Pen, P: 3, V: 1 Paper, P: 1, V: 1 Their Items: ...
I am trying to solve the shortest path problem between n cities. Any single pair shortest path algorithm such as Dijkstra's and Bellman-Ford would work here, but if we add a simple additional constraint "the total time should not exceed T time units", then the problem becomes much harder. More formally: The input consi...
Given a finite alphabet $\Sigma$. We define the set of all words of finite length to be $\Sigma^{*}$. A partial function can become a total function with trivial modifications, thus we just consider about the total function. Is the following definition correct? We say a function $f \colon \Sigma^{*} \rightarrow \Sigma...
My question is pretty basic, I'm looking for a named method if you know one, but also proper terminology, further reading, and anything this reminds you of if you don't. (I'm new to this, don't have the right terminology and just need a starting point so I can help myself.) I'm trying to interpret the vector inputs to ...
I am trying to understand how to write the language given the predicates of the context free grammar. As an example, I have the following grammar: $S \to 0B \mid 1A$ $A \to 0 \mid 0S \mid 1AA$ $B \to 1 \mid 1S \mid 0BB$ What this says to me is that the first symbol can be either a 0 or 1, and the next could be 0 or 1 ...
I'm reading the appendix A of Williamson's "the design of approximation algorithms" about linear programming. In the definition of a linear programming it restricted the coefficients of cost function and conditions to be rational numbers. I guess that this restriction is because of time analysis consideration in terms ...
This is a problem I encountered in a recent interview test. I achieved a slow-ish solution to it, and I'm keen to figure out the most efficient. Problem Given a starting string $x$, a target string $y$, and a set of valid strings $V$, find the minimum edit distance between $x$ and $z$ where edits can only be character...
Question Is $L=\left \{ wxw \,\,|\,\,w,x \,\in \left ( a+b \right )^{+}\right \}$ regular? My Understanding/Doubt We can say that Language $L_{2}=\left \{ wxw \,\,|\,\,w,x \,\in \left ( a+b \right )^{*}\right \}$ is regular By making $x=(a+b)^{*}$ and $w=\epsilon$ Based on above Understanding , i can say that $L$...
How does a assembler (at very basic level) work in translation of Assembly language to machine code ? Just want to know that what is happening in RAM ? [What my understanding is that when when I type MOV A, B : in RAM :'M' >> some bytes (ASCII CODE) in memory (RAM)in form of 0v and 5v (voltage may be different but y...
I have to draw a DFA or NFA for a language that has two symbols lets say {0,1}. The condition is "such that exactly one of the two symbols 0 or 1 appears at least three times." I understood this as if 0 appears three times or more than 1 can be there for 0,1 or 2 times and if 1 appears for 3 times or more DFA fails and...
For many planar graphs of bounded degree (binary tree, lattice, cycle) the (1/4)-mixing time and the cover time are equal, up to log-factors. Is this always the case?
How might indexes be represented in the context of relational algebra? How would an optimizer transform a query to use indexes?
I tried some examples and found that LL(1) grammar always exist. I tried searching for formal proof but didn't find any. Can someone give a formal proof for the above statement?
There are two stacks $S_1$ and $S_2$ of books. Each book in stack has a weight. You are given a net weight $W$ of books that can be picked. You have to maximize the number of books that can be picked. Note that each time you can either pick from $S_1$ or $S_2$ only. eg: $S_1 = \langle 5, 1, 1\rangle$, $S_2 = \langle 1...
I mean, with the same code, if I modify a do while into a while in this way: do {$S;$} while ($B$) into a $S;$ while ($B$){$S;$} , there is any change in the code? B = condition S; = instructions
I'm wondering if there is an algorithm that calculates the optimal solution of a typical k-center problem (more than one dimension). I've tried, but without success, to find this algorithm. Does such an algorithm exist?
Last year I took a course on Theory of Computation. One of the questions made a reference to a Turing machine as a "Potato" (the course was root vegetable themed). A Turing machine is a Potato if on any input it either a) halts or b) reaches a configuration that it has already been in. I'm currently a TA for this cours...
I'm currently reading through Aho's "Theory of parsing, translation and compiling" on my own and I got a bit confused about the closure operator on language $L$ with alphabet $\Sigma$ ($L^*$). The book defines it recursively as follows: \begin{align*} 1)\ L^0&=\{e\}\\ 2)\ L^n&=LL^{n-1}\quad \text{for } n\ge1\\ 3)\ L^*&...
You're given a graph $G = (V, E)$ and a set of colors $C = \{c_1, \cdots, c_v\}$, and the task is as follows: Color the vertices using the colors in $C$. Remove any edges that have differing colors for its endpoints (of course, if a vertex eventually has all edges removed, it can be deleted - but it is not necessary)....
In a higher-order pattern rewrite system, one specifies rewrites on beta normal forms of terms. Is it possible to have a rewrite like: $\gamma := \lambda x . F(m) \to F(\lambda x . m)$ for some function symbol $F$ and $m$ in $\beta$-normal form? If so, then there is a "critical pair" between $\gamma$ and $\beta$ $F(...
This is the pseudo-code from the problem: procedure Foo(A,f,L) Precondition: A[f..L] is an array of integers, f,L, are two naturals >=1 with f<=L. if (f=L) then return A[f] else m <-- [(f+L)/2] return min(Foo(A,f,m), Foo(A, m+1,L)) endif The Question: Using induction, arg...
I have been struggling to visualize how is the AVL tree is stored in memory? Does it store data in array or list, If so how is it connected with its child and parents.
Is randomized quick sort runtime is independent of the sequence of input? but depends on the numbers in the input? Let say A1 = [1,2,3,4,5] , A2 = [5,2,3,4,1] A3 = [5,4,3,2,1] , Will the randomized Quick sort will have same runtime in terms of big O for A1, A2, A2 but for B1 = [1,2,3,4,5] B2 = [11,12,13,14,15] will hav...
  I am designing a bot to play Texas Hold'Em Poker on tables of up to ten players, and the design includes a few feed forward neural networks (FFNN). These neural nets each have 8 to 12 inputs, 2 to 6 outputs, and 1 or 2 hidden layers, so there are a few hundred weights that I have to optimize. My main issue with train...
Let me split my query into a few parts which possibly have overlapping answers, How do we prove that depth $3$ threshold circuits with polynomially bounded integral weights (call this $\hat{LT_3}$) are in $NP/poly$? (I saw this claimed in the conclusion of this recent paper https://arxiv.org/abs/1705.02397 without any...
$\lnot \forall x P(x) \models \forall x \lnot P(x)$ $P(x) : x$ is divisible by 2 or $P(x) : x$ is a dog. or $P(x) can be anything. I want to show the following sequents are not valid ..Isn't the following sequents equal or the first sequent the whole negation of the statement and the second sequent is the negation of t...
Let's say we have given unweighted directed graph with $N$ nodes and $M$ edges, and we want to find the $K$-th hamiltonian circuit, ordered in lexicographical order. For example, if we have complete graph with $4$ nodes, and $12$ edges. The smallest hamiltonian circuit is $1 - 2 - 3 - 4$, the second one is $1 - 2 - 4 -...
Any edge of a tree is a bridge. What is the minimum number of edges that I will need to add so that there are no more bridges in a tree? I have seen the solution from the internet the answer is $\frac{|V|}{2}$, where $|V|$ is the number of vertices in the tree. How can I prove it?
I am trying to generate models for the following sequent. $$\exists x \exists y \forall z (z = x \lor z = y)$$ What I have come up with is this. $$A= \{0,1\}$$ So in this model, for all the values of $z$ there exists $x$ such that $z = x$ or there exists $y$ such that $z = y$. Is this model correct? What other models a...
I read some definitions of the NDTM in several books. Something makes me confused. Some definitions say that the NDTM $M$ makes an arbitrary choice as to which of its transition functions to apply. So, if $x \in L(M)$, then $M$ can always guess a branch which leads to $q_{accept}$. And if $x \not\in L(M)$, then $M$ jus...
I was reading up on chunking and found Rabin fingerprinting is also used to break files into chunks. After reading about this algorithm, I understood how rolling hash is computed using Rabin fingerprint. This is explained almost everywhere. What I don't get is how in Rabin fingerprinting, we know to end one chunk here ...
I am working on the following algorithm time equation: T(n) = n^2 + n * T(n-1) What would be its Big O?
i recently asked a related question about the relationship between monads in category theory and Haskell. The answerer showed me the following classes and instances: class MyMonad t where fun :: (a -> b) -> (t a -> t b) -- functorial action, known as fmap eta :: a -> t a mu :: t (t a) -> t a class KleisliTriple ...
I've been trying to tease apart the definitions of type safety and type soundness and I'm having a heck of a time of it. I asked a professor recently and after a bit of thought he said that there really wasn't any difference. However after reading this it seems like: Type Safety is a property of the language that says...
Is the problem 'Given $m=\big\lceil{n^b}\big\rceil$ with $b\in(0,1)$ integers $a_1,\cdots,a_m$ each with $\lceil\log_2 |a_i|\rceil=\big\lceil n^a\big\rceil$ with $a\in[1,\infty)$ is there a subset that sums to zero?' $NP$ complete? The reason I ask is this problem can be solved in $2^{O(n^b)}=2^{o(n)}$ time.
Question: L is a language defined as $\ L = \{1^l | l\in primes\}$ (strings of 1s having a prime length). Show that this is not a regular language ($\ L \notin REG$). You may either use the theory of closure or the pumping lemma to prove this. My try: So far I have tried to take a word $\ w | w=1^p$ ($\ p$ being the ...
I would like to know if there is a rule to prove this. For example, if I use the distributive law I will get only $(A \lor A) \land (A \lor \neg B)$.
Suppose there exists a list of unsorted int numbers [91,89,90,90,90,89,91]. I need to maximize the profit by selecting an element, in as many steps as needed, which satisfies the condition that, when element(i) is chosen, the profit would be value of element(i) multiplied by its frequency/occurrence in list, an extra...
Suppose you have an array of size $n \geq 6$ containing integers from $1$ to $n − 5$, inclusive, with exactly five repeated. I need to propose an algorithm that can find the repeated numbers in $O(n)$ time. I cannot, for the life of me, think of anything. I think sorting, at best, would be $O(n\log n)$? Then traversing...
Given a database with usernames and the first six bytes of their hashed passwords. A standard hashing function has been used for hashing. admin 827ccb0eea8a user c3981fa8d26e operator 5f4dcc3b5aa7 guest 084e0343a048 The password of admin is 12345. What value of the hashed password will be added to the database after t...
In the space hierarchy theorem proof for PSPACE from Wikipedia, we reject the input after $2^{|f(x)|}$ steps on the machine $M$, reportedly to avoid infinite running time. My question is: how is it that $2^{|f(x)|}$ steps is enough to tell if machine $M$ will run forever or not?
I am aware that the question is asked before but i there is still a confusing part for me. In book the solution is like that: $T(n) = 2T(\sqrt{n}) + \log(n)$ $m = \log n$ yields $T(2^m) = 2T(2^{m/2}) + m$ Then $S(m) = T(2^m)$ produces the recurrence: $S(m) = 2S(m/2) + m$ So $T(n) = T(2^m) = S(m) = O(m\log m) = O(\log ...
I read that acceptance of languages by DPDA using empty stack is a subset of languages accepted by DPDA using final state because of prefix property. I understood this statement by taking an example of regular language a*. Here if we use stack then we can't decide when to pop the symbols from stack. If we pop all the s...
Supervised learning is: given $X$ and $Y$, we want to find a good predictive function $f$ such that $f(X)$ is "close" to $Y$. Examples include XGBoost (ensemble of decision trees), neural networks, $\ell_1$-regularized linear fit, etc. In the problem I am encountering I have $X$. Each row of $X$ describes each day's sc...
I am a CS novice who just recently encountered the P vs NP problem. And I was wondering whether plain multiplication is a P problem. If it is, does that mean there is a polynomial relationship between the increasing complexity and the time required to solve? I.e. Is there a polynomial relationship between the time requ...
Im having a lot of trouble proving that for the Regular expression $R_{1} = \left( a^{*} b^{*} \right)^{*}$ and $R_{2} = \left( a+b \right)^{*}$ that $L \left( R_{1} \right) = L \left( R_{2} \right)$. I was wondering if anyone could help me with this? thanks
After completing the time analysis for an algorithm I have been working on, I need some help to write its time complexity properly, let me describe how it works... The algorithm has two inputs $x$ and $y$. When $x < 15$, steps to solve are $2^y$, so I know this is $O(2^y)$. However when $ x >= 15$, the steps to solve b...
For example, which part will detect these errors, Parser or Semantic Routine? 1) int Array[10.5] ( wrong size ) 2) int x="some string" 3) A[10.5] + 3 (not in declaration, but in the middle of the code) The book that I'm reading says the first one will be detected by parser but the third one will be detected by Semant...
I create an individual in GP by using the full method. My individual trees have the same shape and size. I use a binary tree with all the leaves in maxdepth. The problem is, I can not use the mathematical function set because it accepts two values. therefore I changed mathematical function set like sin (val1) to sin (...
I am trying to generate a type of logic puzzle called starbattles. The puzzles consist of an nxn grid that is divided into n distinct regions. The rules of the puzzle are to place stars in the grid such that there are k stars in each column, row, and region of the puzzle. No stars may be adjacent to one another either ...
This describes how one can neatly store a binary search tree as an array. I'm looking for a way to store a BST that will allow me to traverse any root to leaf path by loading $\mathcal{O}(log_kn)$ blocks. I call a bunch of nodes a block, the blocks are of size $k$. My goal is to store a perfectly balanced binary search...
The role of $x$ in $\frac{\mathrm{d}}{\mathrm{d}x} y$ not only confuses my calculus students, it has also puzzled some well known mathematicians. Questions one might ask are: Does the $x$ in the denominator bind the $x$ in $y$? (Clearly no, since $\frac{dx^2}{dx}=2x$.) Can one substitute for $x$ in the denominator? ...
It states in my lecture notes that there is no CTL formula that is equivalent to A(FG p) in LTL and likewise, there is no LTL formula that is equivalent to CTL formula AG(EF p). I am just starting to pick up LTL & CTL and cannot figure out why it is not possible. Could someone shed some light? A(FG p): I would read it ...
I'd like to know whether recent graph coloring algorithms that one can find nicely listed here have found it's place in real world applications or are they just simply pushing boundaries in this particular field of combinatoral optimization? I already know that graph coloring naturally arises during register allocati...
I know to prove instability, we can simply provide a counter-example. But is there a general way to prove that a sorting algorithm is stable? Could you please tell a general method and then show an example perhaps on insertion or merge sort.
I was recently in Maastricht and visited the caves and tunnels that lie under the city. (http://www.atlasobscura.com/places/fort-saint-pieter) While on a tour we were told that on numerous occaisions people have lost their light sources and have been unable to make their way out. https://nltimes.nl/2015/08/05/21-hour-o...
∃x (P(x) → Q(x)), ∃x P(x) ⊨ ∃x Q(x) I am trying to find the invalidity of the following sequents. A = Set of natural number P(x) : x is odd Q(x) : x is not divisible by 2 What i don't understand is how can this be invalid ? There will always exist an x that is not divisible by 2 . How can we make this false. If ...
The problem (from MIT 6.006 course) is the following: In this problem, you are given a $2D$ array of integers $A$ that has $n$ rows and $m$ columns. (Assume $m$ is much (e.g., exponentially) smaller than $n$.) Array $A$ has one special property: the integers in every row of $A$ and every column of $A$ are non-decreasi...
Say one is given a Vandermonde matrix (https://en.wikipedia.org/wiki/Vandermonde_matrix) of dimension $2^q \times k$ such that the elements of the first column of it are $\{0,1,2,..,-1+2^q\}$. (This then uniquely specifies the matrix). Now say one enlarges this to a matrix of dimension $2^q \times (1+q(k-1))$ over $\{0...
Consider an interval $[x-2^n,x+2^n]$ defined by a binary float $x$ and a power of two $2^n$ typically much smaller than $x$. I would like to know whether an efficient algorithm exists to determine the shortest decimal expansion within the interval. What is the basic idea of such an algorithm? Perhaps such an algorithm ...
I was digging through research articles to find a data structure that solves the dynamic sorted dictionary problem (representing any subset $S$ of a universe $U = \{0, \ldots, u\}$ with member/predecessor/successor queries), but sadly I was able to find none. I did find succinct solutions to the following problems: Dy...
Given a single IDB rule $$R(x) \ \mathop{:\!\!-} \ A(x), \lnot B(x)$$ Where $A$ and $B$ are EDB predicates, how would I go about calculating changes to $R$ as tuples are added to $B$? As I understand, when tuples are added to $B$, tuples may need to be removed from $R$. This paper says We present the DRed algorithm...
Description of the problem in question: Say I have a complete graph with positive weighted edges. 1 vertex is specified as the "end". A subset of the other vertices are designated as "start" vertices. I want to find paths from each start vertex to the end vertex with the following conditions: As input, each path is gi...
A select statement waits on $n$ channels until channel $0$ or $1$ or ... or $n-1$ have data. A barrier lock waits on $n$ channels until channel $0$ and $1$ and ... and $n-1$ have data. These two constructs seem to mirror co-product and product, respectively, in category theory. While I know there are category theory in...
I'm trying to construct a greater than or equal to operation by adding some logic gates or building blocks (i.e. multiplexor and decoder) to my current 32-bit ALU I'm not quite sure how to do this and nothing on google comes up for this operation from what I could tell. ALU Design: Question: How do I add a greater tha...
So I'm currently studying theory of computation, and I was wondering if you could theoretically have more than one initial state in a DFA and if you can prove that a DFA with more than one initial state can depict a regular language? So essentially, can we prove that a language is regular if and only if it is accepted ...
I'm having a lot of trouble with two problems the first is: 1) (y*w) + y + w What I tried here is applying the distributive law as follows (y*w) + (y+w) ((y+w) + y) * ((y+w) + w) ((y*w) + y) * ((y*w) + w) then applying the absorption law and getting y*w but the answer is y + w, so I'm unsure how to get it using t...
In compiler at phase lexical analyzer, how does lexical analyze strip out white spaces from source file?.
Are there quantum algorithms that solve the boolean satisfiability problem in subexponential time? Do they just give a determination as to whether an expression can ever evaluate to true, or can they also tell which input will cause the expression to evaluate to true?