instruction
stringlengths
35
29.1k
I'm not sure if this is the correct stack exchange or correct tags, but my question is as follows: I am working on a sort-of ratings system for players in a particular game. After allowing the ratings to develop for many games, I have set up a "database" (not sure if this is the correct term) for matches: a point in t...
I try to understand the details regarding using Hidden Markov Model in Tagging Problem. The best concise description that I found is the Course notes by Michal Collins. The goal is to find a function $f(x)=arg max_{y \in Y} p(y|x)$, where $y$ is the tag set for sentence $x$. Question 1. It's suggested to use a generat...
How would you determine big O notation for $\log^b x$? I don't think you can simply say $O(\log^b x)$, can you? If you can, then here is a better question: $x^3 + \log^b x$. How would you know if it's $O(x^3)$ or something else depending on the $b$ value?
I want to estimate with big O the following expressions: $$ \begin{align*} f_1(x) &= \frac{x^4 + x^2 + 1}{x^4 + 1}, \\ f_2(x) &= \frac{x^3 + 5 \log x}{x^4 + 1}. \end{align*} $$ How do you eliminate the constant on the bottom of the fraction? How would you work to solve these types of problems?
I have the following grammar G: $$ \begin{align*} &S \to aB|bA \\ &A \to a|aS|bAA \\ &B \to b|bS|aBB \end{align*} $$ I am going to prove that this language L(G) consists of words with the same number of a's and b's by strong induction. Inductive hypothesis: $S$ produces $m$ $a$'s and $m$ $b$'s, $A$ produces $m+1$ $a$'s...
I've been reading these: Fast Reduction from RSA to SAT CNF Generator for Factoring Problems (Also have C code implementation) I don't understand how the reduction from FACT to $3\text{-SAT}$ works. Are there any simple articles in which I can read about it? My final goal is to eventually implement a reduction from $...
I've had this question on my exam today and I couldn't figure it out, I would like to know the answer. The question: Given relations $R$, $S$ on a set $U$. $R$ is transitive, $S$ is reflexive. Prove that $(R;S;R)^2$ is a subset of $(R;S)^3$. Partial answer of mine: By using associativity you get an equivalent questi...
How can we systematically convert a non-deterministic Turing machine into a deterministic Turing machine that recognizes the same language?
A book I read states "Since $G$ is planar, $G$ has a vertex $v$ of degree at most 5". Is this true? Why? Does this theorem have a name?
I'm studing P and NP complexity classes. I like know, why is SAT not in P? Is it because I can not determine if any Boolean expression is satisfiable?
This question is motivated by an older question about tiling an orthogonal polygon with squares.         Given a $3\times 2$ rectangle like the first image, the second image is a square partition of that rectangle. A square partitioning is a covering by non-overlapping squares; the entire rectangle must be covered,...
I have the following problem, which seems to be similar to Set Cover. We are given a set $U$ of elements (the universe, e.g., $U=\{1,2,3,4,5\}$). We're also given a set $S$ of subsets (e.g., $S=\{\{1\},\{2\},\{3\},\{4\},\{5\},\{1,2,5\},\{1,3,4\},\{2,3,4,5\}\}$). The standard set cover problem asks for the minimum subse...
Consider the following 3-SAT variant defined over the variables $x_1,\ldots,x_n$. In the $k$P$k$N-3SAT problem each variable $x_j$, $j \in [n]$, occurs exactly $k$ times as a positive literal in $\phi$, and exactly $k$ times as a negative literal in $\phi$, where $\phi$ is a 3-CNF formula. The problem is then to decide...
I came across the following dynamic subtraction game: There is one pile of n chips. The first player to move may remove as many chips as desired, at least one chip but not the whole pile. Thereafter, the players alternate moving, each player not being allowed to remove more chips than his opponent took on the previ...
Here is a variation of a job-scheduling Problem. Let $J = \{j_1,...j_n\}$ be a set of Jobs for $1 \leq i \leq n$. Given Job length $|j_i|\in \mathbb{N}$, deadline $f_i \in \mathbb{N}$, profit $p_i \ge 0$ and starting-time $s_i \in \mathbb{N}$. I am looking for a greedy approximation factor given that the Job length ma...
I've been researching ways of modeling and executing tasks which are dependent on each other (but in an acyclic way) and came up with task graphs. But the question that's bugging me is how can I find out the maximum degree of concurrency in a given task graph. In my case, I'm talking of a relatively small graph, around...
This question is motivated by an older question about tiling an orthogonal polygon with squares. It is a generalisation of my former question about how to prove that the minimum square partition of a 3X2 rectangle has 3 squares). Let: An almost-square-rectangle be a rectangle that has a width $w$ and height $h=w-1$. ...
I am searching for an algorithm to check whether a complete, undirected graph is fullfilling the triangle inequality( $\text{weight}(u,v) \le \text{weight}(u,w) + \text{weight}(w,v)$ for all vertices $u, v, w$). My first naive try was to use an algorithm for solving the all-pairs-shortest-path-problem and compare the r...
Half a decade ago I was sitting in a data structures class where the professor offered extra credit if anyone could traverse a tree without using recursion, a stack, queue, etc. (or any other similar data structures) and just a few pointers. I came up with what I thought was an obvious answer to that question which wa...
My task is to convert the following grammar to CNF: $S \to SS \mid (S) \mid \lambda$ after removing lambda productions: $S\to SS, S\to (S), S\to(), S\to S$ after removing unit productions: $S\to SS, S\to (S), S\to()$ I got upto this point. Do not know how this grammar will be in CNF coz I am not sure if using () make...
I'm talking about this one research project: but MS closed it in 2008. I've read many articles about it, about high perfomance (30+% faster against tradinional monolithic kernels), much more secure etc. So it should be really a revolution in OS designing. Why they did it? I would be really happy if they didn't... So on...
For a given acyclic graph $G$, a topological sort is an ordering $v_1, \dots, v_n$ of the vertices such that the arrows in the graph are all directed forward under that ordering. Question: can all topological orders of a graph $G$ be obtained from a single ordering by iteratively swapping two vertices that are not conn...
Dominosa is a relatively new puzzle game. It is played on an $(n+1)\times(n+2)$ grid. Before the game begins, the domino bones $\left(0,0\right),\left(0,1\right),\ldots,\left(n,n\right)$ are placed on the grid (constituting a perfect tiling). In the next step, the domino bones are hidden, leaving only the numbers ...
recently there have been a few questions on teaching CS in both cs.se & tcs.se and there are many high-rated related questions on the two sites on the topic. thinking over the latest one made me realize that a lot of students get exposed to some aspects of STEM through the media (sometimes inaccurately), and one of the...
It seems odd to me that the TSP denies the possibility of repeated cities. The goal of this traveling salesman is to go as fast as possible and visit all of the cities, right? So what if it is faster to travel through a city you have already been to?
I have a professor who is really poor at explaining the material, which is what makes answering his questions very hard. Here is the question: Recursive language with non-recursive subsets. Does one exist? I'm sure it is a very simple and easy answer but I can't figure it out. Don't give me the answer just point me i...
I'm struggling to understand this question: Give an encoding of the Turing machine with lowest index that accepts anything but the empty set. I know what an encoding of a Turing Machine is. But my professor didn't explain what the index of a Turing machine is and how I know that it is lower or higher? Can someone exp...
I have been given a graph with n nodes. Now, I have to color every node of this graph by k colors, number from 0 to k-1. Now, there is a rule. For a node $x$ with adjacent nodes $y_1 , y_2, y_3, y_4,... y_m$, $color(x)=(color(y_1)+color(y_2)+color(y_3)+...+color(y_m)) \pmod k $ where $color(a)$ indicates a color number...
Two matrices can be stored in either row major or column major order in contiguous memory. Does the time complexity of computing their multiplication vary depending on the storage scheme? That is, I want to know whether it will work faster if stored in row major or column major order.
I've been thinking about this one for a while: Consider the language of TMs which do not recognize themselves: $L_{s}=\{ \langle M\rangle ~|~ M \text{ does not accept } \langle M\rangle \}$. If $N$ is a TM where $L(N) \subseteq L_s$, then is $\langle N\rangle \in L_s$? Intuitively, I'm pretty sure it is true. I pictu...
One of my seniors had a job interview and he was asked why it is called dynamic. He couldn't answer and after he gave up the interviewer said that there's nothing dynamic about it, its just called like that. That is hard for me to believe. Does it refer to the fact that the subproblems are solved during run-time and us...
Let $\text{NOT-SELF} = \{\langle M \rangle : M \text{ is a TM that does not accept } \langle M \rangle \}$. How do you prove the following claim? If $Q$ is a TM so that $L(Q) \subseteq \text{NOT-SELF}$, prove that $\langle Q \rangle \in \text{NOT-SELF}$.
According to Wikipedia (link), patience sort finds the longest increasing subsequence of a given sequence. Lets say the longest increasing subsequence of seq has length correct(seq) Patience sort works like this: Parameters: A sequence of integers called seq Output: A number between 0 and the length of seq. Lets call i...
I'm trying to show that $L=\left\{w^rww^r:w \in \{0,1\}^*\right\}$ is not context free using the pumping lemma. I thought picking the string, $0^p0^p0^p$, would be a good candidate for this, but someone told me I might want to consider another string. Why is this? Any way in which I divide the string and then pump the ...
Consider these 2 languages: $L_{\ge5} = \left \{ \left< M \right> : M \text{ accepts at least 5 strings} \right\} $ $L_{<5} = \left \{ \left< M \right> : M \text{ accepts fewer than 5 strings} \right\}$ Are these recursive, R.E., or not R.E. sets (languages)? I would say that they are not recursive, based on app...
Solve the following recurrence equations a. T(n) = T(n/2) + 18 b. T(n) = 2T(n/2) + 5n c. T(n) = 3T(n/2) + 5n d. T(n) = T(n/2) + 5n This is only a sample of what I was given but I am not sure what the question is asking me or how to solve it? Can someone please explain this to me? The only thing I really know about them...
I'm trying to prove that the following language is undecidable:$$ \{ \langle M, w \rangle ~|~ M \text{ is a TM where its head moves left a finite number of times on } w \} $$ But I'm having a bit of trouble. I know I have to do some type of reduction, but I'm not really sure what. Can a Turing Machine be simulated b...
I'm looking for the name of the following concept. Given a monoid $(M,\oplus)$, and a finite set of generators $x_1,\ldots,x_n$. The generators are the alphabets. We define the regular expression on the words formed by the generators. We treat those words just like strings. For words $x$ and $y$, we write $x\equiv y$ ...
Would switching the accept and reject states of an LBA A create a new LBA we'll say A' in which the language of A' is the complement of the language of A? I believe the answer is yes just by working out an example...but I'm not sure on a solid proof...nor am I sure if the fact that I am working with an LBA vs a regular...
This is homework, so please only hints. I didn't want to put this on StackOverflow since this is mostly about theory, and SO gets inundated with too many questions. I am asked to find a method of arranging items in a skiplist, with height limited to 3 and unlimited number of elements, in such a way such that searching ...
This is a problem that I was given for my data structures and algorithms class. I am not sure how to tackle this problem. Can I get some assistance? At Hogwarts a new shipment of $n$ goblins has arrived. To be of any use, a goblin must be completely truthful (never lies). Unfortunately, not all of the $n$ goblins in...
Suppose we have a $n\times n$ symmetric matrix $\mathbf A$. I want to know if there exists two elements of a vector $\mathbf x$, let's call them $x_i,x_j,i\ne j$, such that $x_i +x_j+[A]_{i,j}\ge y$ for some vector $\mathbf x$ of size $n$. So: $$ f\left(\mathbf x \in \mathbb N^n,y\right)= \begin{cases} 1&\text{if }\exi...
I'm trying to use gates that do addition and multiplication modulo 5 to emulate logic gates. Assuming false and true are mapped to 0 and 1 respectively (with 2, 3, and 4 being invalid), I figured out I can map the operations like this: a and b -> a*b (mod 5) a or b -> 2*(a+b)*(a+b+2) (mod 5) I was wondering if there w...
I'm looking for an efficient algorithm for the following problem or a proof of NP-hardness. Let $\Sigma$ be a set and $A\subseteq\mathcal{P}(\Sigma)$ a set of subsets of $\Sigma$. Find a sequence $w\in \Sigma^*$ of least length such that for each $L\in A$, there is a $k\in\mathbb{N}$ such that $\{ w_{k+i} \mid 0\leq i ...
Following up on vonbrand's answer I want to write a small document about stronger master theorems for our students, one of which is the Akra-Bazzi theorem. I have copied the theorem from their paper [1] and found -- besides a small notational confusion² -- the following problem. The authors require (emphasis mine): $g...
Let $G$ be a graph, and let $s$ and $t$ be two vertices of $G$. Can we efficiently sample a shortest $s$-$t$ path uniformly and independently at random from the set of all shortest paths between $s$ and $t$? For simplicity, we can assume $G$ is simple, undirected and unweighted. Even in many restricted graphs, the numb...
An OS contains 10 identical processes that were initiated at the same time.Each process contains 15 identical requests. Each request consume 20 msec of CPU time.A request is followed by an I/O operation which consumes 10 msec.The CPU scheduling overhead is 2 msec. The system uses Round Robin scheduling with the time qu...
$L$ is defined over the alphabet $\{a,b\}$ and it's decidable. The language is $\mathrm{perm}(L)$ which is the set of all permutations of all words in $L$. So far my proof is the following: Construct a TM $M$ that decides the language $\mathrm{perm}(L)$. $M$ has input $w$. Let $\pi(w)$ be a random permutation of w. The...
Is there an algorithm/systematic procedure to test whether a language is context-free? In other words, given a language specified in algebraic form (think of something like $L=\{a^n b^n a^n : n \in \mathbb{N}\}$), test whether the language is context-free or not. Imagine we are writing a web service to help students w...
I had a question on an assignment where we were supposed to write a regular expression for a language where every $a$ in $w$ is immediately preceded and followed by a $b$. My answer was $\epsilon + (b + bab)^*$. The teacher pointed out that my answer makes an $a$ surrounded by at least two $b$s, which isn't correct. I ...
I understand how a the language of turing machines which do not accept themselves is not recognizable but I'm not sure if the same proof could be used to describe a DFA... i.e a proof by contradiction in which a recognizer M recognizes a TM which does not accept itself on input ...creates a contradiction in which if M ...
Well everything is in the title. After all Siri voice was made from someone, so can I use software to make a computer generated voice sound like my voice or anybody else?
In trying to understand how Turing Machine encoding works, there is a question that I have come across that goes something like this: Given that the diagonal language, $L_d = \{ w_i \mid w_i \space is \space not \space accepted \space by \space M_i \}$, what is the first string of the encoding of the complement of $L_d...
I am reading about disk redudancy. I read the following: Suppose that the mean time to failure of a disk is 100,000 hours. Then the mean time to failure of some disk in an array of 100 disks will be 100,000/100 = 1000 hours I don't understand this. Why isn't it 100,000^100 instead? Then the same textbook says...
I'm trying to figure out how to prove or disprove the following statement: Infinite union of recursive languages is recursively enumerable. I know how to prove that infinite union of regular languages is not recursive, but I can't figure out how to prove the statement above. Intuition is telling me that the statemen...
I am trying to subtract these two binary numbers: $ 1110 - 1011$ First I convert 1011 to two's complement by doing 1011 to 0100 and then adding 1 to get 0101. Then I add the first number to the converted two's complement number: $1110$ $+$ $0101$ $-----$ $0011$ 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1 carry 1 + 1 + 0 = 0...
Given the language with alphabet: $\{a, b, c\}$ Draw an NFA or DFA for all the strings that have exactly twice substrings $ab$ and at least on $c$. I'm stuck with "exactly twice $ab$". Can somebody give me some ideas. It's also very good if you can suggest me the regular expression of this statement.
I was reading about synchronization problems for cooperating processes and i learned that only hardware solutions like test_and_wait() and compare_and_set() are performed atomically at the hardware level and in all other software solutions like mutex, semaphore the code needs to be executed atomically and hence these h...
I would like to show that Quadratic Programming is NP-hard. I am currently reading a couple of papers which state that QP is NP-Hard and prove it by transforming SAT to QP, however I am finding the diction quite tough since I am just a beginner in the field. Would anyone happen to know the answer to this question who c...
I have a question about preparing the dataset of positive samples for a cascaded classifier that will be used for object detection. As positive samples, I have been given 3 sets of images: a set of colored images in full size (about 1200x600) with a white background and with the object displayed at a different angles ...
I am a professor at a university of applied sciences and will teach computer science next semester. My question is if you know resources which use the R project as the basis, i.e. not using it primarily for statistics (I do this already in this semester) but for other topics in informatics, mentioned e.g. in this wikip...
void Sort(int A[], int left, int right) { int p; if (left < right) { p = (right + left + 2)/3; Sort(A, left, left+p-1); Sort(A, left+p, left+2*p-1); MergeSort(A, left+2*p, right); Merge3(A, left, left+p, left+2*p, right); } } I need to convert this function i...
While thinking about this question on a recurrence I checked out some stronger master theorems. Unfortunately, they do not seem to apply because terms $\qquad\displaystyle T(n) = \dots + T(n-1) + \dots$ are not covered. Roura [1] investigates (in the discrete case) recurrences of the form $\qquad\displaystyle T(n) = t...
1-in-3 SAT is the set of 3CNF formulas with no negated variables such that there is a satisfying assignment that makes exactly one variable in each clause true. Show 1-in-3 SAT is NP-complete Plan on doing a reduction from 3SAT. My confusion arises from the "no negated variables". You need some way of representing nega...
Is it true that if A is a subset of B, and B is decidable, than A is guaranteed to be decidable? I believe it would be true because all the subsets of B should also be decidable making A decidable. I'm not sure if my thought process is right or if there's a easier more intuitive way to explain this.
I know this has been a question but based on a past experience, i thought i would rewrite it so i can get input and ask questions faster. Suppose we have $$\text{NOT-SELF}=\{\langle M\rangle \mid M \text{ is a Turing machine that does not accept }\langle M\rangle\}$$ the set of all machines that don't accept their ow...
So say we have a bipartite graph G=(X,Y,E). Let's make a game out of it. I go first. I pick a node in X. You go next. You pick a node in Y that is connected by an edge to the node I picked. Next it's my turn. I pick another node in X (must be a new one that hasn't been used before) that is also connected to the node in...
I wonder how I can go about proving that if a language L is decidable in o(nlog(n)) then L must be regular. I should probably mention that by "decidable" I mean "being decidable by single-tape deterministic turing machine". Thanks and regards Guillermo
I've been thinking about how to show this but I'm stuck. I'm required to prove this: Show that the language $$\mathrm{TOT}= \{\langle M \rangle : M\text{ is a Turing Machine that halts with all inputs} \}$$ is not recursively enumerable nor its complement. ($\langle M \rangle$ is an encoded Turing Machine with only ze...
Is it possible to modify Dijkstra´s algorithm in order to get the longest path from $s$ to $t$ ?. My intuition says that I´ll need a different algorithm entirely. Finding the longest path is the same as finding the shortest path on a graph with negative weights. However, Dijkstra’s algorithm requires that the weights ...
I have two large sets of integers $A$ and $B$. Each set has about a million entries, and each entry is a positive integer that is at most 10 digits long. What is the best algorithm to compute $A\setminus B$ and $B\setminus A$? In other words, how can I efficiently compute the list of entries of $A$ that are not in $...
I program in Python, which is a well-known dynamically typed language. I understand dynamic typing to mean mainly that "operations" (in a loose sense) in the language are either allowed or denied (raise an exception) based on the type of their operands, and that this type-checking is deferred as long as possible. My qu...
I encountered these few recursive relations: T(n) = (n/2)T(n/2) + O(n^2) T(n) = T(n/2) + T(n/2-1) + ... + T(1) + O(n^2) I do notice that these recursions can be solved faster by DP. I'm just curious as to: What's the big-O of the running time of these relations, if we follow the resursive formula How do you analysis r...
I'm a little stuck on this question, any help would be appreciated! Given that the Hamiltonian Path (HP) and the Hamiltonian Circuit/Cycles (HC) problems are known to be NP-complete, show that HCE is NP-complete. HCE: Given an undirected graph G and an edge e of G, does G have a Hamiltonian circuit/cycle that uses e? I...
When we are trying to learn a new language without any help from native speakers, the first thing we need is something/someone to correct our grammatical mistakes/improper word selection. So is there any research done on building tools to help critique our spoken language? I often hear people saying that the more you t...
The following is my proof for $P$ being closed under union. I wish to know if my proof is correct in addition to what it means for the union of two problems. Proof: Let $p_1, p_2 \in P$ Then by definition of $P$ $p_1$ is solvable in $O(n^k)$ for some $k\in\mathbb{N}$. Similarly $p_2$ is solvable in $O(n^{k_2}$) for som...
I have seen this question: Are regular expressions $LR(k)$? and my question is slightly related. Suppose I have a regular expression: RE=(aa)?(aa) and I convert it to a grammar: G ::= A B A ::= C | (empty) C ::= D D D ::= aD | empty B ::= D D Can an LALR(1) parser such as Bison generate matches such that I can perform ...
Situation: Alice has selected a positive integer $a$, and Bob has selected a positive integer $b$. Alice and Bob want to know whether $a > b$, $a = b$, or $a < b$, but neither wishes to reveal their chosen number to the other party. How can Alice and Bob make this determination?
My aim is to classify types of cars (Sedans,SUV,Hatchbacks) and earlier I was using corner features for classification but it didn't work out very well so now I am trying Gabor features. code from here Now the features are extracted and suppose when I give an image as input then for 5 scales and 8 orientations I get 2 ...
Is there an algorithm/systematic procedure to test whether a language is regular? In other words, given a language specified in algebraic form (think of something like $L=\{a^n b^n : n \in \mathbb{N}\}$), test whether the language is regular or not. Imagine we are writing a web service to help students with all their ...
Im designing a program to play Connect 6, a variation of connect 4. I have narrowed down my options to the following: 1) Minimax with Alpha-Beta Proning 2) A Neural Net 3) Machine Learning My program has one second to make a move, so I can only branch out 2 moves ahead with Minimax. Which solution would best perform ...
I am asked to check if a vector contains another vector as a subvector. For example: $$v_1 = (4, \underline{3, 4}, 9, 10, 28, 5, 12, \underline{3, 4})$$ $$v_2 = (3, 4)$$ The answer here will be two, since there are two instances of $v_2$ in $v_1$. I know I have to use "if" but I dont really know how to write it down (I...
I know that for every $k$-tape DTM that runs in time $O(t(n))$, there exists a 1-tape DTM that runs in $O(t^2(n))$, no matter how large the $k$ (the $k$-part is a formulation from Wikipedia). But what if $k=\infty$? If I understand it right, if $k=\infty$, then the alphabet of the $\infty$-tape DTM is infinite and ther...
I use Google a lot for searching articles and publications. Occasionally, I find Google totally misses what I am looking for and I get completely unexpected results for some search queries. What are the published or widely known failures of PageRank algorithm? EDIT: Changed the post to address comments.
I am trying to solve a 25k clauses 5k variables SAT problem. As it has been running for an hour (precosat) and I'd like to solve bigger ones afterwards, I'm looking for a multi-core SAT-Solver. As there seem to be many SAT-Solvers, I'm quite lost. Could anyone point me out the best one for my case? I'd also be happy if...
Are there problems that are in NP class but not in #P class? According to Wiki definition: More formally, #P is the class of function problems of the form "compute ƒ(x)," where ƒ is the number of accepting paths of a nondeterministic Turing machine running in polynomial time" So I am thinking, if you already have a...
I have to estimate the computational complexity of some algorithm that does $\psi_q(m)$ iterations. Assume that all inputs $m$ are coprime to $q$. So I need to know what growth the $\psi(m)$ has.
My Problem is like this: I have a physical layout represented as a graph. The Nodes represents hooks/ducts where a wire can anchor and Edges are the possible connection between 2 nodes from where wire can go. There are some special Nodes, called splitters, from where a single wire can be splitted to 2 or more up to k...
This came up while I was trying to answer this question on Wiring Length Minimization. I was going to call this the "polygamous marriage" problem, but the internet, so kittens. Yay! Suppose we have $M$ kittens that need to be adopted by $N$ people, $M > N$. For each kitten, $i$ and each person $j$ there is a cost $...
I'm writing a context-free grammar that I hope will be in Chomsky Normal Form, and I have two questions: Can I use a single variable (a non-terminal) on the left-hand side of multiple rules? Can I use a single variable (a non-terminal) twice on the right-hand side of a single rule? For instance, is the following gram...
My Problem is: to define a "repeat until"-construct in terms of Denotational semantics. I made an attempt and now i need to know if i made it right. The Conditions are: i used the language "While" as specified in "Semantics with Applications" by Nielson & Nielson (1992) (pdf) (WorldCat). I do not want to use the help o...
Consider a standard feasibility problem. The goal is to examine the state of feasible solutions for $Ax=b$ to find an $x$ that satisfies some property. Does the dual of this problem tell us anything about the solution? Since there is no objective function that we're examining I think the dual looks like $A^Tx \leq 0$. ...
I've been struggling with this problem for quite a while now and every explanation I have managed to find doesn't seem to correctly solve it. We have the language L = {$ { a^{2^n} \ | \ n \ge 0 } $} and we need to prove that it is not regular by use of the pumping lemma. (i.e. L is words whose length is a power of 2: a...
Consider a certicate for 3SAT that lists an assignment for each occurrence of a variable in the order of appearence,e.g. 100000 for ($x\bigvee$$y\bigvee$z)$\bigwedge$($\neg(w)$$\bigvee$$y\bigvee$z). This certicate is of polynomial length and can be read once to check the satisability of the given formula. Does this pro...
This sub-problem is motivated by Algorithm to test whether a language is regular. Suppose we have two languages $L_1,L_2$ that are expressed in "algebraic" form, as formalized below. I want to determine whether $L_1 = L_2$. Is this decidable? If yes, can anyone suggest an algorithm for this? If not, can anyone sugge...
here is a competitive programming question: You have a number of chores to do. You can only do one chore at a time and some of them depend on others. Suppose you have four tasks to complete. For convenience, we assume the tasks are numbered from 1 to 4. Suppose that task 4 depends on both task 2 and task 3, and task 2...
I'm trying to create a PDA for $\{xy \mid |x|=|y| \text{ and } x \ne y\}$ over the alphabet $\Sigma = \{a, b\}$. But I don't know how the PDA will know if the two strings $x$ and $y$ are not equal. Please help me create this PDA step by step.
I will be given some kind of this graph as in the picture below. I've searched some algorithms but it seams as if it is something impossible for me to figure them out. In fact using Floyd–Warshall algorithm it is kinda of possible, but unfortunately I'm only allowed to use stacks (instead of matrices). I also looked fo...
I know when we access elements in rows it will be much faster than if it is accessed column wise. In matrix multiplication one of the matrices must be accessed column wise. In GPUs with CUDA/OpenCL I could resolve this issue by explicitly copying both matrices row-wise into user-managed shared(cache)-memory (or local...
Sipser example 9.29 He says: "one way to do so (compute the parity function with O(n) gates. One way to do so is build a binary tree that computes the XOR function, where the XOR function is the same as parity on 2 variables, and then implement each XOR gate with two NOTs and two ANDs, and one OR. ... Let A be the lang...