instruction
stringlengths
35
29.1k
I am new to grammars and I want to learn context free grammars which are the base of programming languages. After solving some problems, I encountered the language $$\{a^nb^nc^n\mid n\geq 1\}\,.$$ Can anybody tell me if this is a context free language? I can't make any context free grammar for it and I don't know any o...
I currently have a working implementation of A* using navigation meshes. Agents are moving around a 3d navigation mesh, reaching their target, however often a sub-optimal path is chosen, when considered from the user's perspective. I have narrowed this down to the cost calculations for long edges when the agent is tryi...
I know that IS (is there independent set of size at least $k$?) on planar cubic graphs is NP-Complete, and IS on triangle-free graphs is also NP-Complete. But how about IS on triangle-free planar cubic graphs? Is it still an NP-Complete problem, or there are some polynomial time solutions? Any ideas or referrences are...
CBMC is a Bounded Model Checker for ANSI-C and C++ programs. It also supports SystemC using Scoot. It allows verifying array bounds (buffer overflows), pointer safety, ex­cep­tions and user-specified as­ser­tions. For the pigeon-hole principle I understand that the constraints are: Each Pigeon is in some Hole. Two d...
I am building some simple system software for the Microblaze FPGA (actually being run on OVPsim at least for now). The system is to experiment with various memory management regimes. The first system I want needs to have a very simple paging mechanism and so I want to build a software controlled (only option on a Micro...
Suppose that we have an array of size n and we want to build an interval tree for all possible ranges that can be created inside this array. So in our leafs we have the ranges [0], [1], [2], [3], ... , [n], and merging two of them together we end up having the root node holding the range [0, n]. For example we have the...
I'm trying to solve this problem: Let $L$ be some infinite language, show that there exists a sub-language of $L$ that is not regular But can this be correct? If I have the language $\{a\}^*$ for example, that's infinite but you can make a DFA for any sub-language of it, right? There's a hint that this can be proved ...
I'm working in the time analysis for an algorithm with two optional optimizations variant applied and followed next approach: Create inputs of different lengths for the algorithm Using these inputs to execute the two algorithm variants and count the asymptopic number of operations (steps) Graph the operations count Gr...
Consider the generator of the selections: for (i1 = 0; i1 < 10; i1++) for (i2 = i1; i2 < 10; i2++) for (i3 = i2; i3 < 10; i3++) for (i4 = i3; i4 < 10; i4++) printf("%d%d%d%d", i1, i2, i3, i4); Result: 0000 0001 0002 ... 0009 0011 <-- 0010 is skipped 0012 ... 0019 0022 <-- 0020 ...
In some definitions of Turing machine, there is only a set of accepting states and no mention of a set of rejecting states. But it seems to me that the definition that includes only a set of accepting states and that includes also a set of rejecting states will differ. How can they actually be shown to be equivalent? ...
This was a challenge problem I read some time ago and just remembered it: Say you have two people, $A$ and $B$, collect objects distinctly labeled $1,...,n$. They will each separately collect sets $S_A$ and $S_B$ such that $|S_A \cup S_B| = n-k$ where $k\leq \sqrt n$. There is no guarantee in what order any of these ...
I can't figure out how to solve this recurrence relation using the iteration method: $$T(n) = \begin{cases} 0, & \text{if $n=0$} \\ 1, & \text{if $n=1$} \\ 3T(n-1)+ 4T(n-2), & \text{if $n >1$} \end{cases}$$
Suppose you have a task selection algorithm to select the largest subset of tasks that do no overlap. The greedy algorithm that selects tasks based on their finish time will always produce an optimal answer, but what will a task selection algorithm that selects tasks based on the fewest incompatibilities produce (i.e. ...
Both programs and simple graphs can be enumerated using natural numbers (positive integers). However, what languages or ideas most naturally combine the two? For example enumerating programs using graphs instead of natural numbers. Or executing graphs, in other words code described by a graphs shape instead of by text,...
How to calculate genus of arbitrary graph? I am interested in any algorithm, even it based on full search.
Assume that we choose randomly $k$ distinct numbers $N_1$, $\dots$, $N_k$ in $\{1, \dots, k\}$ and we have a file of $k$ parts. We have these two cases : We read (or write) sequentially from part $1$ to part $k$. We read (or write) the part indexed $N_1$, then the part indexed $N_2$, ..., and the part indexed $N_k$. ...
I have a generator of non-decreasing sequences of numbers 0..M: M = 9; c = 0; //counter for (i1 = 0; i1 <= M; i1++) for (i2 = i1; i2 <= M; i2++) for (i3 = i2; i3 <= M; i3++) for (i4 = i3; i4 <= M; i4++) printf("%d. %d%d%d%d", ++c, i1, i2, i3, i4); Result: 1. 0000 2. 0001 3. 00...
Valiant & Vazirani proved SAT is reducible to UNIQUE SAT under randomized probabilistic reductions in polynomial time. Calabro et al. showed that UNIQUE k-SAT is as hard as k-SAT. Now the question is, if someone shows that UNIQUE k-SAT is in P, does it imply P=NP? References L. G. Valiant and V. V. Vazirani, "NP is ...
I'm trying in vain to find some online (classical) algorithms problems to deeply exercise "complexity" and maybe see (even try) mathematical demonstrations. As far as I can see, the sites that I found (CodeChef, Project Euler) seem to be more programming oriented, even if I like the format and their challenge. That is...
I've got a pretty basic question concerning the Earley parser: In case of syntactic ambiguity ( S -> NP VP(V NP(NP PP)) vs. S -> NP VP(VP((V NP) PP) ), are both parses stored in one chart or in two? the grammar im talking about is the following: S -> VP NP VP -> V VP VP -> VP PP NP -> NP PP NP -> Det N PP -> P NP so ...
I am trying to learn CFG. Now to make a CFG from a CFL it is really difficult for me. Is there any simple rule or steps so that I can easily find a CFG for a CFL. I am trying to solve one problem for generating a CFG. The Problem statement is to find a CFG that generates the following CFL: $$\{a^ib^jc^k \mid i,j,k\geq...
I find the need to use an explicit level numbering for a tree. i.e. in the tree: A / \ B B /\ /\ C C C C should I number the level C the 3rd and A as the first, or the opposite? As going 'up' the tree is going towards A; should the numbering reflect that as well? If can, please supply an authorized CS...
Let's say you have a standard doubly link list implementation: struct List { int Number; struct List *blink; struct List *flink; }; and that you have the following list: 1 <--> 2 <--> 3 <--> 4 <--> 5 Now, in my case, I've been using the flink as a terminator of sorts, and unlinking nodes in a single direc...
I am trying to understand the concept of CNF satisfiability, can someone throw some light on 1) what does 3- CNF, 4- CNF etc.. mean? 2) What does yes and no instance mean and can someone provide an example for the same ? I am learning this subject at school and having hard time gathering basics of this concept. Any he...
If we can reduce a language y to x. x ≤P y how do I prove x(complement) ≤P y (complement)
Given $n$, I am trying to count the number of values $(a,b,c)$ that satisfy the following equation in $O(n\log n)$ time. I do not need the values themselves only the number of total values that satisfy the equation $$a^2 + b^3 = c^4 \mod n\,,$$ where $a,b,c \in\{0,1,....,n-1\}$ and $n$ is any natural number. Does anybo...
In case we have an algorithm which is pseudo-polynomial and runs in $O(n^2C)$ for some $C$ that is encoded in binary. Is it correct to say that if $C=2^n$ then $O(n^2C)=O(n^22^n)$ and because $n=\log C$ we can write that $O((\log C)^22^n)=O(2^n)$ because $2^n$ grows more rapidly than $\log C$?
I have some trouble understanding Lamport's paper about the Byzantine generals problem when it comes to signed messages. He showed that, with signed messages, the number of generals must be at least $m+2$ to tolerate $m$ malicious units\faults (for fewer generals, the problem is vacuous).If that's fulfilled it's guaran...
I could describe JQuery as a library that allows you to easily select elements on and traverse the DOM, the DOM would be the name of the tree or organizational structure of the HTML. When you are describing what JS (or any other language) scope bubbles up from the local scope, to its parent scope, to its parent scope, ...
I'm building a compiler. I already have a parse tree which I built using Bison for a grammar similar to the ANSI C grammar in this link. I see that for multiplicative expression in my parse tree, there can be 3 children e.g. child 1: multiplicative_expression child 2: '*' child 3: cast_expression I expect to impleme...
This is the exercise: Let A be a language defined over the alphabet Σ = {0, 1} composed by the strings with the property that in every prefix, the number of 0s and the number of 1s differ by at most 2. Determine if A is a regular language and prove it. Ok, as @roi-divon commented, A is a regular language. I've tried ...
Given that $G$ is some connected and undirected graph, and I want to run BFS on it from some starting vertex. How can I show that $T = \{ \{\text{predecessor}[u], u\} \mid u \text{ is a vertex}\}$ is a spanning tree of $G$?
Where $N$ is the size of the input, $M$ is the size of your main memory and $B$ the amount of elements that you can transfer in one I/O. My idea is that since $B$ is usually much smaller than $M$ we can have $O\left(\frac{N}{B}\log_{\frac{M}{B}}\frac{N}{M}\right) = O\left(\frac{N}{B}\log_{\frac{M}{B}}\frac{NB}{MB}\righ...
I am learning compilers and I am troubled by how to create the context-free grammar of a language. Is there a method I can follow to create the context-free grammar for most language ? I'm new to this field so the question is basic,and I hope you can help me.
Has it been proven that Dijkstra's algorithm is optimal for asymptotic worst case of single-source shortest path on directed graphs? (Assume no preprocessing) I became curious when Wikipedia mentioned it as the 'best known' rather than the 'best possible'. Is a proof of its optimality an open problem?
Suppose i have a cyclic weighted ($\mathbb{Z}$) directed graph where nodes are either simple or complex. a simple node is just a usual node whilst a complex node is a node that contains a set of integers which act as conditions. Consider the graph $G=(V,E)$ where $V= \{v_1,v_2,c\}$ and $E=\{(v_1,v_1,2),(v_1,v_1,-1),(v_...
I am asked to find Prove that the following languages are regular languages: (a) $\{a^nb^ma^k \mid n\geq3,m\geq1,k\geq1\}$ (b) $\{a^n \mid n\neq3 \text{ and } n\not\equiv2 \mod7\}$ (c) $\{a^nb \mid n\geq2\}\cup\{ab^m \mid m≥3\}$ I have a vague understanding of pumping lemma, and how to prove a language is not regular...
I am trying to find the sum of 1 bits in the range between A and B inclusive, where -2^31 <= A <= B <= 2^31 - 1 Input Format: The first line contains the number of test cases T (<=1000). Each of the next T lines contains two integers A and B. I have used Hamming Weight algorithm to solve this problem. Though I have us...
I am asked to find Prove that the following languages are regular languages: (a) $\{a^nb^ma^k \mid n\geq3,m\geq1,k\geq1\}$ (b) $\{a^n \mid n\neq3 \text{ and } n\not\equiv2 \mod7\}$ (c) $\{a^nb \mid n\geq2\}\cup\{ab^m \mid m≥3\}$ I have a vague understanding of pumping lemma, and how to prove a language is not regular...
I'm looking for subgraph isomorphism of at least K vertex between Graph A and B. I only can come up with the dumbest algorithm, which is: Compute all combination of vertices with length K of Graph A. Run subgraph isomorphism test for every combination vertices against Graph B, probably using VF2 algorithm. Upon resea...
I know that most of the efficient sort algorithms can run with a complexity of $O(n\cdot log(n))$, but this is given an unsorted array. However, given that the initial array is already sorted, is there an algorithm that can sort the array after multiplying several elements by 2 (or increasing them by some value) with ...
I did study applied math and dealed almost exclusively with the creation of ode/pde solver code. Now, I want to increase my knowledge in some aspects and I want to learn some basic algorithms like A*, MinMax, ... (not limited to searching; I am also interested in the basics of optimization and machine learning) and the...
I'm doing a presentation for a distributed systems and networks course. I'm using the book "Design and Analysis of Distributed Algorithms", written by Nicola Santoro. This book contains the proof of equivalence between SPT and leader election but there are some points that I don't understand at all. Santoro uses this m...
I encountered the following question: Given a relation R(A, B, C, D) with the following functional dependencies: A -> B, C -> D, B -> C. The BCNF Decomposition of R is: A) {(A,B), (C,D), (B,C)} B) {(A,B), (C,D), (A,C)} C) {(B,C), (A,D), (A,B)} D) All of the above According to my understanding the solution should be D...
I'm trying to do decryption using el gamal. The formula to get the message M is $$ M=\frac{b}{a^x} mod \:P $$ In one case, we may have $$ M=\frac{18}{62^{62}} mod \: 71 $$ This value cannot be computed on a calculator as $62^{62}$ gives an infinite value. How do we get the value of M?
I need to prove that the following language is not regular $\{c^mb^na^n \mid n>0,m\geq0\}$ But I am not sure how to do that for this particular one. I vaguely understand pumping lemma, but every example I see is in the form $\{a^nb^n \mid n>0\}$ Or something similiar. This does not help me with my problem, becaus...
We have $k$ sorted arrays, $A_1[1...n_1],...,A_k[1..n_k]$, where $n_1+n_2+...+n_k=n$. How can we get the $m$ greatest elements in running time $O(k + m\lg k)$? I have tried to use MIN-HEAP size of $k$ since we have $k$ arrays. I have to navigate through the ends of the $k$ array somehow. By extracting the min of heap a...
My friend got me this really interesting puzzle Each node can be slided or docked around the Truncated Octahedron, creating knots and tangles in the middle of the puzzle. The idea is to move the nodes around until there's a bunch of knots and then unravel the knots. To solve this puzzle, you need to following conditio...
I'm working through an example that looks like a fairly simple Karnaugh map and simplification, but I feel stupid that I can't seem to understand the correct answer. This is the map: My groupings: This is the equation: But I don't know how it simplifies to the correct answer here: I understand why the NOT A goes ou...
Consider we have $n$ vertices, $v_1,\ldots,v_n$. We have two positive values $(a_i,b_i)$ associated with each $v_i$. The edge weight $w(v_iv_j)=a_ia_j+b_ib_j$. Is it NP-hard to solve the traveling salesman problem on this graph? In the special case where all the $b_i$ are $0$, this is solvable in $O(n\log n)$ time. Bec...
I'm having some trouble writing a DFA for the language $$\{w =b_1\dots b_k \in\{0, 1\}^* \mid b \ge 2 \text{ and } b_2=b_k\}\,.$$ What I thought for this is writing a DFA where there are 4 states, that accepts at the states (00) and (11), where the 1st element in the state is the 2nd element in the string, and the 2nd...
I am trying to figure out what the time complexity is for a "Look and Say" sequence generator which receives an integer n and outputs the nth term in the look and say sequence. I'm looking at the below code. It is a tail recursion, but I can't get the summation properly. Can someone please provide an explanation along ...
I am new to this topic, Linear Time Temporal Logic and I am trying to prove this equivalence -- $\Box\Diamond f \Leftrightarrow \Diamond\Box f$ This is my take -- Basic definitions: $(\sigma, j) \models \Box f: \forall k \, [(k \ge j) \Rightarrow ((\sigma, k) \models f)]$ $(\sigma, j) \models \Diamond f: \exists k \, [...
I am trying to understand how camera matching (or match moving) works. I need to build a program that can move the camera in a way to match a 3D object to its projection on an image. For eg. if I had an image of a cube at some angle, the virtual camera must be moved in such a way that the points/vertices of the 3D cube...
We've been given a weighted graph with marked nodes. We want to make a minimum-weight subtree from this graph that contains all marked nodes. I want to show that this problem is NP-hard. Is there any idea to which problem is the best for reduction to this problem?
For proving language $\{a^nb^mc^nd^m \mid n,m > 0\}$ is not context free. Do I have to use $z = a^pb^pc^pd^p$ as pumping lemma string where $p$ is pumping length? Or do I have to use a string that would reflect than $n$ and $m$ does not have to be the same length?
Given two $n$-bits numbers $a$ and $b$, I am not sure on how to find the runtime of the euclidean algorithm for finding the $\gcd$ of $a,b$. The problem (for me) in here is that apart from the size of $a$ and $b$, I don't feel like I have any other information that will help me to know what is the runtime of the algor...
Given the sum of weights of shortest paths between all vertices in a graph, how can I construct a connected graph that satisfies the given sum? That is, how can a graph with a given wiener index be created?
I'm exploring an algorithm that solves k-SAT. It uses a ton of preprocessing, so I'm thinking that this will be a circuit bounds. Without knowing the runtime, I speculate on how quickly it will solve k-SAT instances. It will either solve all instances of k-SAT with probability $p$, or it won't be able to solve any in...
Let a binary counter with the operations INCREMENT and DECREMENT. I need to show that you can't implement this kind of counter with constant amortized time per operation. Hence, I need to show that there's a series of $N$ operations with amortized time of $\omega(N)$. My Try: Let's assume we made $2^k-1$ INCREMENT op...
Sorry ahead of time if some of my terminology is inaccurate, my formal training isn't quite to the level it should be. Almost all programming languages with types separate built-in functions a + b and user defined functions f(x) into different steps of the compiler. a + b is dictated by some grammar that says something...
Let $\qquad \mathrm{DISJOINT} = \{ \langle M_1,M_2 \rangle : M_1, M_2 \text{ are TMs and } L(M_1) \cap L(M_2) = \emptyset\}$. How do I know if this language is decidable or not? And How do I prove my answer?
I'm making a compiler/interpreter for a language similar to C. I already have a parse tree. I was able to evaluate expression statements by converting my code to another language and then using an evaluation engine. How do I properly evaluate functions using a parse tree? Let's say my function x looks like the followin...
What is the time complexity of the following problem? Definitions A FIFO is a queue functional unit supporting four commands: PUSH (data to back of queue), POP (the head of the queue), PNP (POP the head of queue and PUSH it to the back), NOP (do nothing). Each command takes one unit of time to execute. FIFO code (or a ...
Let's say I have a struct_declaration_list of the following type. How do I reverse it? struct_declaration_list : struct_declaration | struct_declaration_list struct_declaration ; P.S. Sorry I don't know the exact name of this kind of list so I can't search. I just have this grammar.
Suppose that we have a tape restricted to $n$ cells on binaryalphabet $\Sigma = \{0,1\}$ and initially filled with zeroes. We want to build a Turing machine $M_n$ (or better a Linear Bounded Automata) that "prints" all the $2^n$ numbers on the tape, i.e. for all $x \in [0..2^{n-1}]$ there is a time $t_x$ during the co...
$L = \{x \in \{a,b\}^* \mid \text{$x$ starts with $ab$ but does not end with $ab$}\}$ I'm having trouble making a table for this NFA. I tried a few sketches out of the diagram and I can post them onto an image site if necessary. However if you choose to help, you can always put them in a table. I get the main part, bu...
A multitape Turing machine is defined to have input only appear on one tape, with the rest of the tapes blank. Are there any formulations of a Turing machine that allow other tapes to be not blank? Why does the condition that the input only appears on one tape exist?
I need to understand a distinction to check if I understood a document classification problem right. Given a training set of documents with ratings, that a user has given, let's say rating $r_{k} \in \{"like", "not \ like"\}$ of documents $ d_{k}$ with the features $f_{i} \in d_{k}$ (words, with their frequencies). Do ...
I'm trying to prove that a language is not regular. That language is: {w ∈ {a, b}* | amount of a's in w is equivalent to the amount of b's in w, mod 2}. I have an inkling that this language is not regular, so when I go to apply the pumping lemma, I would apply it on some subset of the language, and the pump on that, r...
Problem formulation: Given a list $L$ of $n$ points in the Euclidian plane and a reference point $R$ also in that plane, find a closest point $P\in L$ such that, for all $X\in L$, $|PR|\le|XR|$. Aditional constrains: Trivial algorithm will just iterate all candidate points in $L$, compute their distance to $R$ and sele...
Language $A$ can also be represented as, $$A = \{ uvw \mid u,w \in \Sigma^*\text{ and, }v \in \Sigma^* 1 \Sigma^*\text{ and, }|u| = |w| \ge |v| \}$$ Language $B$ can also be represented as, $$B = \{ uvw \mid u,w \in \Sigma^*\text{ and, }v \in \Sigma^* 1 \Sigma^* 1 \Sigma^*\text{ and, }|u| = |w| \ge |v| \}$$ I have to p...
We are given finite sets $A$ and $B$ and a set $S\subseteq \mathcal{P}(A)$. The members of $\mathcal{S}$ may have arbitrary intersections with one another and their union is not necessarily $A$. We wish to determine whether there is a function $A\to B$ so that no member of $B$ is the image of more than $k$ members of...
The max-flow min-cut theorem states that the value of the maximum flow is equal to the minimum cut capacity. It is possible that the max-flow and min-cut is equal to $\infty$. However, reading Introduction to Linear Optimization by Bertsimas and Tsitsiklis, I get the impression that the max-flow and min-cut problems ar...
In the lecture notes I have got in class I have the following proof for the halting problem not being recursive Assume $H$ is recursive and TM $M_1$ decides it. Construct $M_2$ that gets input $x$ in $\{0,1\}^*$ and transform it into $x*code(x)$ applies $M_1$ to $x * code(x)$ if x is in SA (Self Accepting), $M_1$...
Having trouble with this homework problem. In order to show that A is Turing recognizable and decidable. $\text{EVEN} = \text{binary strings with even length}$ $Let\;A = \{(M) | \,M\; \text{is a DFA such that L(M) is not the same as EVEN}$ $\text{Show that A is Turing-recognizable}$ $\text{Show that A is decidable}$ ...
Which domain does this problem belong to? Given a set of products some are classified as cheap and some not. The task is to determine the price range (probabilistic) for cheap products. Supervised classifiers arrive at a function and can classify a new instance but does not provide the range of feature values. This see...
I am reviewing things I learned, and I can't suddenly come up with an example of reduction that is not many-one, but Turing reduction. Can anyone present such an example?
Let G = (V,E) be a unit-capacity graph with n vertices and m edges. Let T denote all the spanning trees in G. If we run Karger's algorithm, we will get a random spanning tree in T formed by the contracted edges, we denote this distribution of spanning trees by D1. On the other hand, if we assign a random weight in (0,1...
Why learn finite automata when Turing machines do exactly the same thing? Turing machines accepts the same languages and more so what's the point?
I understand how you can use a contradiction in regard to a DPDA to show a language has finitely many Myhill-Nerode equivalence classes, but what is the method used to show each string of a language accepting palindromes is in its own Myhill-Nerode class? Thanks
Suppose $L$ is an infinite CFL, and $G$ is a grammar with finitely many ambiguous strings which generates $L$. Is it possible to convert $G$ into an unambiguous grammar which also generates $L$? If so, how would I go about doing this? One starting approach I see is to have rules of the form $S \longrightarrow w $ in...
The Böhm-Jacopini theorem states that any 'unstructured' program can be rewritten in structured way. There is a companion theorem that states that in this structuring process the tests that are performed may not be the same as the original. Does anyone have a reference for this other theorem?
I was looking in here, and I noticed the best runtime for multiplication of two $n$-bits numbers is $O(n\cdot \log n \cdot 2^{O(\log^* n)}$, but I can easily notice an algorithm that runs in $O(n\cdot \log n)$. After all, we know how to multiply two polynomials from degree $n$ in $O(n \log n)$ runtime. But multiplying...
In Pierce's book, on page 26-27 it is given a definition of terms for a simple language using inference rules. In the picture below it is marked by red highlighting the problematic part. What is Pierce referring to exactly by the red-highlighted word term in this context? Is he referring to the terms given by the gra...
I am trying to implement a natural language query preprocessing module which would, given a query formulated in natural language, extract the keywords from that query and submit it to an IR (information retrieval system) system. At first, I thought about using some training set to compute TF-IDF values of terms and use...
i have to demonstrate that under the assumptions{Bidirectional Links, Total Reliability (no error during the execution), Connectivity, Distincts ids values, Multiple inititators (entities that starts the algorithm} the problems of constructing a spanning tree takes at least $\Omega(m)$ messages, where $m=|E|$
Let a dictionary with the operations insert(), delete() and search(). Each one of them has time complexity of $O(logn)$. Implement (efficiently) opposite() operation which return true if there are two opposite numbers in the dictionary (i.e. $5$ and $(-5)$) I advised to use another data structure. I thought about a ...
Imagine I have a turing machine that can decide on a specific problem using a language. My question is that that problem (that can be decided by a TM M, with language L) can be encoded in a new language that is recursive enumerable. If yes, this would mean that every solvable problem can encoded in recursive language; ...
How do you write the CFG for the following language: {ax by c ax+y} Is there some formula or rules I need to follow? An explanation will be so appreciated. What I tried is: First I broke ax+y into axay which gives: {ax by c axay} Then S ---> aSa | B B ---> bB | c The problem I am facing now is how to include ay.
There's been a fair amount of research on mutual exclusion algorithms - e.g. a lot of it is presented in classic textbooks such as The Art of Multiprocessor Programming, where an entire chapter is devoted to them. I'm wondering what are the practical situations where one might need these algorithms during engineering o...
So I wasn't sure weather or not this counted as "research level" or not but I figured it wasn't so I decided to post it here. There is a paper by S. Bellantoni et al. called "Higher Type Recursion, Ramification and Polynomial Time (1999)" which can be found here. It mentions a notation of a complete type denoted $!\sig...
In MIT's open courseware (http://courses.csail.mit.edu/6.006/spring11/lectures/lec15.pdf), I do not see how computing a set of numbers on the edge and the vertex will produce the shortest path. Can someone please explain what information I can get by looking at the above example? How can I tell what is the shortest p...
The notion of low information content is used to describe sparse sets and tally sets in complexity theory. Such sets can not be $NP$-complete unless $P=NP$. I am not aware of a formal information-theoretic definition which I hope would lead to insights into the phenomena of complexity hierarchy inside $NP$. What are t...
I am trying to solve this problem using a binary indexed tree. The problem can be summarized as follows: You are given a series of commands that operate on an array initially all zeroes. 1) Invert all bits from [a, b] (1 becomes a 0 and vice-versa) 2) Find the number of set bits from [a, b] (bits that have value ...
$$ x_1 + x_2 + \cdots +x_n = c_1 $$ $$ \frac{x_1^2}{2} + \frac{x_2^2}{2} + \cdots +\frac{x_n^2}{2} = c_2 $$ $$ \cdots $$ $$ \frac{x_1^n}{n!} + \frac{x_2^n}{n!} + \cdots +\frac{x_n^n}{n!} = c_n $$ $c_1,\cdots,c_n$ are known constants. $x_1 \cdots x_n$ are the unknown variables to solve.
I'm having trouble understanding the definition of Turing Decidable. The definition goes something like this: TM M decides language L iff the strings in L put M into the Accept state and the strings NOT IN L put M into the Reject state My problem is.. the strings "NOT IN L"? How can the definition be based on what'...
I'm struggling to understand a question I've been given. The question asks: Let $\psi$ be a boolean formula in $n$ variables. There are $2^n$ different combinations of assigning values to the variables. Consider the problem of deciding whether (strictly) more than $2^{n−1}$ of these assignments satisfy the formula $\ps...
I want to scheduling $n$ teams using divide and conquer method for $n \in \mathbb{N}$.My approach is that if $n$ is even divide it to to group $\frac{n}{2}$ and $\frac{n}{2}$ but if $n$ is odd, add auxiliary team and scheduling $n+1$ team at the end we remove the last team and in table every match between $n+1$ team a...
I am familiar with free and bound variables theory , but while learning I somewhere saw this lambda expression ((lambda var ((fn1 var) & (fn2 var))) argument) From what I have learned it seems to me as var is bounded in both fn1 and fn2. But the reference from where the expression is taken says that both var are fr...