instruction
stringlengths
35
29.1k
I really cannot understand the key-differences between those fields of study. Can please someone explain it in detail? If one graduates from a Master program of Computer Science, how does he differ from the one graduated from a Software Engineering program, or one from IT?
I have the following grammar for a context-free language: $G = (\{S,A,B\}, \{x,y,z\}, P, S)$ with $P = \{S \rightarrow A, A \rightarrow xAz, A \rightarrow xBz, B \rightarrow y\}$ My question is: How to construct a pushdown automaton associated with the above grammar?
Essentially similar question to here Different boolean degrees polynomially related? (change being error condition $\epsilon\in(0,1)$). Let $p$ be the minimum degree (of degree $d_f$) real polynomial that represents boolean function $f$ such that $f(x)=p(x)$. Let $p_{0,\epsilon}$ be the minimum degree (of degree $d_{0...
where can i find very old books about old operating systems like CP/M and DOS and other OS that worked on the 8086 ?? second question isn't old books 20 year before and older should have an expired patent ?? where in general can i find books of expired patents ... thanx
I have a Turing Machine M with a binary alphabet {1,2} that accepts a language L(M) that has infinitely many strings that start with 1 and finitely many strings that start with 2. I'm trying to determine if L(M) is decidable, semi-decidable (computably enumerable) or undecidable. Using Rice's Theorem, I believe I can p...
Is the Subset-Sum Problem (SSP) with a changing target sum (which is dependent on the chosen subset) also NP-complete? If so, how would I reduce SSP to this or prove that it is NP-complete in another way? This is the last step on a larger problem I'm working on and greatly appreciate the help!
I am struggling to think of the context-free grammar that generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$, where $i$, $j$ and $m$ are natural numbers. Also, in general, are there any good methods or ways of thinking that help one to think of context free grammars that generate a given language. Any tips are much ap...
I have always wondered why is computer architecture in $2^n$ bits. We have 8 / 16 / 32 / 64-bit microprocessors or for that matter other parts of computer are also in power of 2 bits. The only logic I could understand from my reasoning is that usually computer design process starts from lower amount of bits. For examp...
Is there an algorithm to prepare all sums of pairs of a list ($L$, size $n$, max value $m$) in $< O(n^2)$ such that query "does this sum of pairs exist" takes $< O(n)$? In other words, can max value $m$ be used to advantage? E.g. in $L =\{1, 2, 4, 8\}$ and $m = 8$, all (distinct) sums of pairs are $S = \{2, 3, 4, 5, 6...
I'm reading about a Turing Machine $M$ and it says the problem of deciding whether M accepts a string is "$\Sigma^0_2$-hard and $\Pi^0_2$-hard". I haven't seen this kind of notation before and haven't found a good answer from searching. Is this a more specific form of saying NP-hard?
Assume you are getting a number $m$ (using $O(\log m)$ bits in binary encoding). How fast can you find (or determine such does not exist) $$n,k\in \mathbb N, 1<k\leq\frac{n}{2}:{n \choose k}=m$$ ? For example, given the input $m=8436285$, one may output $n=27, k=10$. A naive algorithm for the problem would go over al...
Problem: Suppose there is a graph, a source and a sink. Each edge has a capacity and an extra capacity that it can hold. If sink needs a defined amount of flow F, find a total extra capacity needed E so that maximum flow from source to sink is greater than or equal to F and flow in each edge that has nonzero flow. I do...
Problem: Suppose there is a graph, a source and a sink. Each edge has a capacity and an extra capacity that it can hold. If sink needs a defined amount of flow F, find a total extra capacity needed E so that maximum flow from source to sink is greater than or equal to F and flow in each edge that has nonzero flow. I do...
Given an English sentence, I am looking for a programmatic way to tell whether the sentence is written in passive voice. Currently, I just check if there is a was or were inside the sentence. If yes, then the function will say that the sentence is in passive voice (I do no not know even if this is true). Is there a be...
Recently it occurred to me that one could potentially design an interactive "compression" scheme which seems to allow for arbitrarily high compression ratios, at the sole expense of time. This already sounds pretty cranky, I realize that, but here is a formal description of the protocol which I hope makes sense: Defin...
Given two lists of non directional graph edges e.g. [(1,3),(3,5),(5,1),(5,7)] [(4,5),(2,3),(3,4),(4,2)] In order to check if the two graphs are isomorphic is it enough to count the vertices with the same degree between them? e.g. Vertice 1: 2 1: 0 2: 0 2: 2 3: 2 3: 2 ...
So theoretically, what sort of machine would we need to solve the tiling problem? (Given a set of tiles, decide if they will tile the plane or not.) I know we could have a Turing machine plus a "tiling oracle", but do we know what, specifically a Turing machine isn't able to do that keeps us from being able to compute ...
in 35.5 of CLRS i have read about algorithm to find sum as large as possible, but not larger than $t.$ Essential part of this algorithm is trimming. On every step you delete all numbers which close one to another, but one to represent them all. Good explanation of the algorithm. At page 7 from provided link or at pag...
Let $A$ and $B$ be two decision problems in $NP$. Consider three cases: (1) For any instance of problem $A$, one can produce, in polynomial time, an instance of problem $B$ having exactly the same number of solutions as $A$. (2) For any instance of problem $A$, one can produce, in polynomial time, an instance of proble...
I will soon have to be able to draw a suffix tree of a word on an exam. I tried to understand the different algorithms available, but they seem rather complicated to do "by hand". I do not see a simple way how to draw such a tree. Is there a simple step by step method for people not knowing the algorithms?
Suppose we have a tree in which leaves are labeled with a set of numbers $L$, and internal nodes with a set of operations $O$. In particular $L$ can be $\mathbb{N}, \mathbb{Z}$ or $\mathbb{Q}$, and can optionally contain $\pi$ and/or $e$. $O$ can be any subset of $\{+,-,\cdot,/,\hat\ \}$. Is equality with zero decidabl...
My understanding is that Karp many-one reductions are more general than Levin many-one reductions, and that Levin many-one reductions must allow for the number of certificates for a problem $A$ reduced to $B$ to be recovered from a single oracle call giving the number of certificates for $B$. So, what exactly is a Karp...
Given a number N, and some set $A=\{a, 1\le a\le N\}$, and let $B=\{\text{every integer} \in [1,N]\}$, and $C=B\setminus A$ (Set C has all values from B not in A) What is the best way of finding the smallest number ($S$) that can't be obtained from the sum of any subset of C? i.e. if $A=\emptyset$, the smallest number ...
Consider a machine that has nested interrupts (a higher priority interrupt can interrupt a lower priority one, the current instruction's address is saved and later restored). Why would a programmer want to disable all interrupts using instructions like x86's CLI when you know that even when your code gets interrupted i...
I have $n$ numbers that come one by one, and when the last element comes, I want to output $k$ largest elements and those that are ties with the minimal element from this top-$k$ element. For example, I have $[10, 7, 7, 9, 10, 10]$ and $k = 4$, then I want to output $[10, 9, 10, 10]$. However, if $[10, 7, 7, 9, 10]$ a...
Randomized Quick Sort is an extension of Quick Sort in which the pivot element is chosen randomly. What can be the worst case time complexity of this algorithm. According to me, it should be $O(n^2)$, as the worst case happens when randomly chosen pivot is selected in sorted or reverse sorted order. But in some texts [...
Given $G = (V,E )$ a directed graph, if $ X \subseteq V $ we write $$\begin{align*} \delta ^{+}(X) &= \{ xy\in E \mid x \in X, y\in V - X \} \\ \delta ^{-}(X) &= \delta ^{+}(V - X )\,. \end{align*}$$ $\delta^{+}(v)$ and $\delta^{-}(v)$ are short notation for $\delta^{+}(\{v\})$ and $\delta^{-}(\{v\...
Essentially similar question to here Different boolean degrees polynomially related? (change being error condition $\epsilon\in(0,1)$). Let $p$ be the minimum degree (of degree $d_f$) real polynomial that represents boolean function $f$ such that $f(x)=p(x)$. Let $p_{0,\epsilon}$ be the minimum degree (of degree $d_{0...
The $K$th Largest Subset problem is often given as an example of an NP-hard problem. However, the assumption is that $K$ is unconstrained, and can be as large as $2^n$. Clearly, if $K \le 3$ the solution in $O(n)$ time is trivial. Are there any general results for time complexity of this problem for a given (and potent...
I want to prototype and try some idea (some algorithm) in the field of text processing and nlp and if the results was good I want to publish some paper or journal article about that. I am familiar with Weka, RapidMiner, Matlab and Python for text processing and nlp but I don't know what is the most frequently tools for...
I want to study Artificial Intelligence from Artificial Intelligence: A Modern Approach by Russell and Norvig, in the mid-year vacation. I want to get prepared before diving into the book so I decided to review some relevant subjects like Discrete Mathematics. I know there is a good book for Discrete Mathematics by Ken...
In my opinion it seems fairly obvious that a $k$ nearest neighbours (KNN) Classifier would be fairly expensive in terms of memory, as the model is the training set itself. However, any notes I've read have only mentioned that the KNN-Classifier is computationally expensive, and have not mentioned any memory requirement...
I've sketched a very small transition system in paint that I'll use as an example. I want to see if $A(aUb)$ holds for this transition system. From my understanding, this CTL formula is asking if ALL paths satisfy $aUb$. The only path we can take in this example is S0S1S0S1S0S1S0S1... This path produces the output (1...
Has anyone studied the problem of converting a generic flowchart to a semantically equivalent "structured flowchart" (i.e. one that only uses the 'if' and 'while' block structure)? I can see this may be relevant to code generation and optimization but I've not been able to find anything on the topic. Intuitively, I wo...
Based on the notes of my Machine Learning lecturer, I am struggling to understand how the two algorithms differ? Both seem to select the most informative feature A (based on least entropy), then create subsets of the example set for each value of A. Then create a new branch on the tree by recursively calling ID3 on eac...
I need to prove: XY + ~XZ + YZ = XY + ~XZ I cannot think how to do this. I have tried factorising, but I just don't know of any rule that removes one of the terms like above. I start with the LHS, naturally: All I can do is get to: Y(X+Z) + ~XZ
We know that MAJSAT is PP-complete. Is it generally true that given an NP-complete problem, its majority variant is PP-complete? For example, MAJ-Set-Splitting: are the majority of partitions of items going to split the sets? MAJ-Subset-Sum: does the majority of partitions of items have a sum of exactly K? etc...
As the above question says. I'm wondering if a transition system is the same as a program graph or they are two different things? Thank you.
Many real world optimization tasks (especially black box optimization) have objective functions, which are quite expensive to evaluate. For example to find the optimal shape of an airplane wing, a computer model of the wing needs to be constructed and then a large physical simulation needs to be executed, usually takin...
Show that if $G$ is a graph with $|E| \geq 2|V|^{3/2}$, then $G$ must contain a $4$-cycle Can someone explain/point me in the right direction on this? Let's say we say $|V|= 4$, using the equation above we get $|E|= 16$. I drew it out and I was unable to come up with $16$ edges. Do I completely misunderstand the grap...
In Nisan and Szegedy's 1994 paper "On the degree of boolean functions as real polynomials"[1] Lemma 3.8, how does proof work for $\widetilde{\deg(f)}\geq \sqrt{\,\tfrac16\mathrm{bs}(f)\,}$? It clearly works for $\deg(f)$ and only this portion is shown in Jukna's book [2, Theorem 14.11]. Why does the proof work for $\wi...
Consider the following traditional integer knapsack problem: $\max \sum_{i=1}^k p_i \cdot x_i\\ \text{s.t.} \sum_{i=1}^k w_i \cdot x_i \leq W \\ x_i \in \{0,\ldots,k_i\} \text{ for each } i$ Now consider a laminar family $\mathcal{I}$ of sets, i.e., a collection of subsets of $\{1,\ldots,k\}$ such that for each pair $I...
I am given 2 list of admissible values for a graph, and the graph with the real cost to each of the nodes. Am I correct in thinking the way to see which one is admissible is add up all the values of the h(n) and compare it to the total real cost of the graph? Example: h1 total = 681 h2 total = 732 Total cost of graph...
In the paper "Item-Based Collaborative Filtering Recommendation Algorithms" In section 3.2.2 about regression, it is said the the user's actual rating of item N (Ru,n), is replaced with an estimate of that rating (R'u,n) via linear regression. The linear regression model seems to be mapping rating of the target item (...
Currently working on a past exam question which tells me to compute the product of two transition systems and then use DFS to find the reachable states of the product. I learnt how to compute the product of transition systems by looking at pages 43 and 44 in the "Principles of Model Checking" book by Christel Baier and...
I have an English dictionary (text file) and the frequency of 2-grams, 3-grams and 4-grams as the beginning of each word. I need to write an algorithm that, with a given word, calculates the possible anagrams (which have to be into the dictionary) based on transitions probability (my assignment requires that I use this...
Consider an integer ( of arbitrary length ). To find the number of digits it has, here is a known simple algorithm count = 1; while ( (value = value/10) ) count++; Now, what is the time cost of this algorithm? If we assume that k is the number of bits ( not digits) required to represent the number, then it is O(k)....
Suppose for simplicity we start off with starting amount $S = 1$ and we wish to reach target amount $T$. To do this we sequentially wager a certain amount and then win that amount with probability $p$ and lose that amount with probability $1-p$ ($p$ is known). We wish to reach target amount $T$ in the minimum expected ...
I have a string of digits $S$ and K queries $l_i, r_I$ - get the sum of all numbers contained in segment of $S$ from $l_i$ to $r_i$. For example, $S$ = 1034, $l = 1$, $r = 3$. So answer will be $1 + 10 + 103 + 3$ (note: $03$ was not counted, as it starts with $0$) It has an obvious solution with $O(K\cdot N)$ performan...
I'm looking at implementing type inference for a Hindley-Milner type system, and before I have even started to implement the Damas-Milner algorithm, while working through some examples, I hit some stumbling blocks. I'm trying to follow some notes on the algorithm. Given the following program: let id x = x in id id I...
I have been reading a lot of papers by John McCarthy lately. As early as 1963, he developed the situation calculus, but then starting in 1987, he developed what came to be known as the propositional logic of context (PLC) (McCarthy, 1987; McCarthy, 1993). Surprisingly, he doesn't really describe the relationship betwee...
Forgive my ignorance, but I am very new to the publishing process in Computer Science. I have some research that I have done involving analyzing data formats used in web-based image processing applications being presented in various IEEE papers. Some are conference papers and some actual IEEE transactions. They all see...
I'm interested to find the fastest possible way to find the first element of an intersection of two integers arrays (first match) Looking for the 'fastest' algorithm I have seen different methods with different time complexities (to calculate the arrays intersection) i.e: $O(N+M)$, $O(N * log(M)$,... Also I have seen s...
I'm still a beginner in the quantum aspect of computer science (self-studying). So please bear with me if this may sound like a stupid question. I know Hadamard gate transforms qubit into a superposition state with $\frac{1}{2}$ chance that the outcome would be 0 or 1 when the wave function collapses: $$\frac{\left|0\r...
[Reposted because the original question was deleted by the poster.] I'm looking for a way to add additional clauses (and maybe additional variables) to an already existing SAT instance so that solutions with non-unique assignments for certain variables are invalidated. Currently I enumerate all the original solutions, ...
Having found one minimum vertex cover of a connected undirected graph, is there a known polynomial-time algorithm for finding all the other minimum vertex covers of the graph, or is this problem NP-complete as well? Another question: what other ways (not necessarily polynomial-time) of finding the other MVCs when havin...
Suppose I have $k$ players $P_1,\dots,P_k$ that can communicate with each other directly by sending messages. For defining the inputs, we consider a fixed set of names $N$ which are integers in $[1,k^2]$. The input of each player $P_i$ consists of a unique name chosen from $N$ and a set $X_i$ of (up to $k-1$) other i...
I have tried to make a Post machine for that all words of the form $a^nb^n$ by the following steps. add a marker '#' read first 'a' read next 'a's and add them read first 'b' read next 'b's and add them read '#' (that we added in the first step) repeat steps while input tape is not empty but this algorithm also accep...
You and a friend lost each other on the line to a concert, and neither is sure which of you is further ahead. Formally, each is at some integer coordinate and may only walk towards a higher coordinate or stay in place. Assuming you and your friend are following the exact same algorithm (and no, you may not say "if (nam...
When you pick up some reading about CSP the main focus is how to solve it. My goal is to compute/decide if CSP is ambiguous (has 2 or more solutions) or not (has 1 solution). Of course brute-force approach would be to solve it and see the outcome. But I am looking for something simpler (read: way faster). Background: I...
I need to implement LU-decomposition in Kaira. In Kaira the programmer writes the "parallel part" as the diagram similar to Petri Nets. So, could you, please, recommend me some parallel algorithms for LU-decomposition which are really easy to understand and implement? The low difficulty of the implementation has the hi...
Could somebody please tell me if there is a way to create a DFA with 8 states for the regular expression $$(111 + 11111)^*$$ I was able to create a DFA with 8 states, but the place I saw the question has answer as 9 states. And if possible, could you please show me the DFA. Thanks
In the article ["Triangulating Planar Graphs While Minimizing the Maximum Degree"] by Kant and Bodlaender [1], Section 4 briefly mentions the extraction of elementary cycles (no repeating edges) from what I assume is an undirected graph $H$. It has the following to say: $H$ is planar and bipartite. ...using a simple m...
If the input for a subset sum problem is a multiset (with repetitions) instead of a set (without repetitions), e.g. Set $a = \{1282,1588,3590,5138,5505,5777,6198,7962,8827,9838,10137,12037,15296,16089\}$ Multiset $a = \{1282,1282,3590,3590,5505,5505,6198,6198,8827,8827,10137,10137,15296,15296\}$ (above sets are samples...
I have gone through few tutorials about how to perform range updates and range queries using Binary indexed tree. I have even gone through Range update + range query with binary indexed trees . I'm unable to understand the need of second tree. In the tutorial http://programmingcontests.quora.com/Tutorial-Range-Updates-...
So far I've read traversal techniques $(Pre-Order, In-Order, Post-Order)$ on binary trees. But In exam I've thrown up with a question, which requires me to find in-order traversal of a ternary tree. I got confused, Is there any generalized steps that we can follow to find traversals for any $m-ary$ tree.
Wikipedia claims that "each finite segment of noncomputable sequence of integers is computable". It continues to clarify: For any noncomputable function, "for any given value of n, [...] a trivial algorithm exists (even though it may never be known or produced by anyone)". While I do believe this for the given example ...
I am trying to understand Licklider’s idea of man-machine symbiosis in the real world, does anyone know of any real world examples of the use of a man-machine symbiosis? Would it be correct to say that safety critical systems such as an aircraft flight control system is an example of this, due to it fitting into the fo...
Can anyone please tell me the difference between them? A brief definition of Cognitive Computing would appreciated. Also how does cognitive computing relate to neural networks?
Sometimes I read about the term "scheduler" (offline-scheduler, online-scheduler,...) and then I see terms called "scheduling" (offline-scheduling, online-scheduling, preemptive scheduling, non preemptive scheduling). Currently I think, that scheduling is the real work and scheduler is just a umbrella term. Is that cor...
In my class we were trying to derive Shannon's Source Theorem, first by proving the equivalent form in a weaker version. The question is: Consider a biased coin with probability of heads $p \geq \frac{1}{2}$.We want to transfer this information with the code of minimum expected length. To prove this, we can construct ...
I was reading Tuple Relational Calculus from a textbook. I came across this query: For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, birth date and address. The solution query is: {p.Pnumber,p.Dnum,m.Lname,m.Bdate,m.Address | ...
$\newcommand{\bs}{\mathrm{bs}}$What is the largest gap known between block sensitivity ($\bs(f)$) of a boolean function ($f$) and degree of a polynomial ($\deg(f)$) that represents/approximates it? We know of lower bound $$\bs(f)\leq c\deg^2(f)$$ for some $c>0$. Is there a Boolean function that achieves this separation...
I get the main ideas of Turing machines. But I can't construct a Turing machine to solve a given question. The question I'm trying to solve is "Construct a Turing machine that recognises the set of all strings that contain an even number of $1$s." How can I think about all the cases? Is there a way to do it?
Suppose we have given $\Sigma=\{a,b\}$, Which one of the following set is not countable (a) Set of all languages over $\Sigma$ (b) Set of all regular languages over $\Sigma$ (c) Set of all languages over $\Sigma$ accepted by Turing machine I've read some techniques to find answer to the question like whether Is the ...
The Dual of a Boolean function $F(x_1, x_2, ..., x_n)$, written as $F^D$ is the same expression as that of $F$ with $+$ and $.$ swapped. $F$ is said to be self dual if $$F=F^D$$ How can we count total number of self dual function with $n$ Boolean variables. I know For $n$ variables total $2^n$ minterms or maxterms are ...
A file is downloaded from a server and is represented as $a = \{0, 1\}^n$. The server has that file as $b = \{0, 1\}^n$. We want to ensure a degree of certainty that $a=b$, using a randomized algorithm. So below is the procedure referenced from this lecture pdf . I can't get my head around why some of the steps are ne...
I want to prove that unique(reverse(L)) = reverse(unique(L)) where L is a List. List has the following constructors: [] : -> List [e] : Element -> List cons(e, L) : Element x List -> List I defined unique and reverse as follows: unique : List -> List reverse : List -> List unique([]) = [] unique([e]) = [e] unique(cons(...
Schwartz–Zippel lemma can solve the polynomial identity testing in expected poly-time. As far as I know, there is no deterministic poly-time algorithm for the problem, but we do not know if the problem is NP-hard or not, right? Is there any NP-hard problem that can be solved in expected poly-time using a randomized alg...
Function 1: $2^{\log_*n}$ Function 2: $\log(\log n)$ The first function is 2 to the log-star of $n$, the second function is log of log of $n$. What I need to know is which one is Big-Omega of the other one, which means, which one grows faster. How can I figure that out? I know the definition of log-star (iterative loga...
Problem: Longest Path Input: An undirected graph $G=(V,E)$ Question: Is there a path of length at least $\frac{|V|}4$? I know that in order to prove the simple version of $k$ longest path, we reduce the Hamiltonian path to longest path. How we can prove the $NP$-completeness in this special case? Should I use a reducti...
I'm tempted to phrase this question notationally, but I may be jumping the gun on the exact problem definition as well. So let me start with the real-world scenario and work forward from there. You're given a list of media items--songs, let's say--to play. You must play every song once, with no repetitions, but you get...
Assuming an adjacency list as data structure of a directed Graph, it is not completely clear to me how "contraction of an edge" is defined. Let me cite the definition I do have at hand: Source: JAMES B. ORLIN - A FASTER STRONGLY POLYNOMIAL MINIMUM COST FLOW ALGORITHM, Section 4.1. Contraction [...] any edge, say $(k, ...
I have a very silly question, as I am reading through all the proofs showing a problem is NP hard, one of the techniques is by showing an already-proven NP complete problem is a special case for that problem. I am wondering shouldn't that be another way around? I mean if you show your problem is a special case of a NP-...
I'm going camping. While I'm away, I plan to eat only s'mores, which consist of 20% chocolate, 50% marshmallow, and 30% graham cracker. I did a thorough clean-out of my pantry, which revealed multiple packages of each of these ingredients in various sizes. I'll need at least 5kg of food to get me through the weekend, b...
In the book "Advanced Data Structures", Chapter 2 ("Search Trees"), the author, Peter Braß, mentions two versions of binary trees (emphases in the quoted text are mine): "...two different models of search trees, either of which can be combined with much of the following material, but one of which is strongly pref...
Lets assume we have an array with 100 numbers and we want to find how many '1's there are. Best solution will be reading every numbers and counting. Now we get a hint that there are 50,51 or 52 '1' in the array, can this information help us count the '1's somehow? What bothering me here is that we have a lot of informa...
If you were given a "new operator" Wh and a formula a Wh b meaning that a holds for at least as long as b does (in all executions). How would you define this operator in CTL? This is an exercise question in the book "Principles of Model Checking" (page 303) if anyone has a copy. My first thoughts are that I'll defini...
Why we use context-free grammar for parsing? Why not regular expression and not context-sensitive grammar?
Suppose that we have $n$ points in 3D. I want to find a plane $ax + by + cz + d$ such that sum of all the orthogonal distances to the plane is minimum. I read this article. However, I need an algorithmic solution. So far, this answer from SO was the simplest one. However, this solution projects the points onto $z=0$ pl...
Given a problem, is it possible to prove what the best worst-case efficiency of an algorithm to solve this problem would be? For example, lets take the problem of sorting an array. Many of the simpler sort algorithms have a worst-case efficiency of $O(n^2)$ such as Quick Sort and Bubble Sort. However, there are other a...
This is the problem: I have some strings stored in the database. Each of the strings can be seen as a set of tokens separated by comma with no repetition (I mean a token cannot appear more than one time in a string). I want to know if a new string matches any of them without taking token order into account. The metric...
According to these scribe notes (and a paper), 3SAT-5 is NP-hard. The problem is defined to be: given a 3SAT formula, each variable occurs in at most 5 clauses. It is also proven that 3SAT-4 is NP-hard. What is the computational complexity of 3SAT-$k$ for $k \le 3$?
Suppose that I have 2 parties Alice and Bob. Alice gets an input $X$ and Bob gets input $Y$ where $X, Y$ are $n$-bit strings. In the classic communication complexity world, computing a function such as disjointness of $X$ and $Y$ requires $\Omega(n)$ bits assuming the input distributions of $X$ and $Y$ are chosen to be...
Is there an example of real polynomial representation of a Boolean function with $4$ variables whose polynomial degree is $2$ that depends on $4$ variables?
I've been looking for a reference for the above question. As far as I know the answer is: If we can make a solver that is efficient for all randomly generated instances, it should be efficient for any instance. i.e. if we make a solver that doesnt rely on any inherent structure, it will always be efficient. Is this co...
Is it possible to have a rounding error when you convert a floating point number which can only be in increments of 0.01 to an integer by multiplying by 100 first? I would think that the lack of precision in representing floating point numbers is so small that it would never cause a rounding error when you only have t...
There is a graph G, which is not known to me. Instead I am given the multiset of all graphs that are obtained by deleting a single vertex from G. My task is to figure out, from all of these subgraphs, whether the original graph G has a Hamiltonian cycle. My original idea was to assert that, if all of these subgraphs h...
I am reading Algorithms 4th edition by Robert Sedgewick and am stumped at a particular problem. On page 460 of the book the author is describing a technique to hash strings and use prime numbers for modular hashing. Starting from the fourth line: If R is greater than any character value, this computation would be equ...
The problem is rearranging furniture in a flat. We are given rectangular rooms of natural width and height with doors between them, (the walls have no width) and rectangular furniture at starting positions and goal positions. The operations are moving each piece of furniture one block each direction (up,down,right, lef...