instruction
stringlengths
35
29.1k
I need to find an example of a pseudo-peripheral vertex which is not a peripheral vertex. I came up with this example, where diameter is 4 and pseudo-peripheral vertices labeled aqua. Am i right here? $$\mbox{dia} = 4$$ $$e(9) = e(4) < \mbox{dia}, e(8) = e(4) < \mbox{dia}$$ Could you provide other examples? Maybe some...
Is there an efficient way to find a path from root to a leaf such that it has the maximum sum of degrees of nodes from all the paths possible in the tree. For example if a tree is defined as the one in which each node is an integer and it has as many child nodes as the perfect divisors of the integer. And the root node...
Let's take the function $f = \{(0,\pi)\}$. If I want to prove that such function is uncomputable I can simply say that calculating $\pi$ from $0$ would necessarily require infinitely many steps, since a Turing Machine can only write a single digit to its tape in each step. Is this argument well constructed enough to b...
Let $x_1, x_2, \dots, x_n \in \mathbb R$ and $b_1, b_2, \dots, b_n \in \{0,1\}$. I want to know which of all the possible boolean combinations is maximal. For example, if $x_1 = 2$ and $x_2 = -2$, $$\max \sum_i b_i x_i = 2 \implies b_1 = 1, b_2 = 0$$ I can see that a brute force algorithm will have a running time comp...
I am exploring some ideas around dating site matching, and I can do with some ideas as to which is the better solution Senario: We have a boy and girl, the boy has completed his profile/bio thoroughly while the girl hasn't or maybe she just doesn't like a lot of things, so this is what the data looks like Boy likes: ...
I am trying to calculate $$V = (H^TH+I)^{-1} U$$ where $H\in\mathbb{R}^{m\times m}$ is a circulant convolution matrix corresponding to a convolution kernel $h$, and $U\in\mathbb{R}^{m\times n}$. The computation of $V$ can be done using the FFT algorithm. I am confused about the computational complexity of using the F...
I understand that a PDA is an automata with a stack (LIFO) but I still can't understand how to answer a very simple question like this one. I've read so many pages on it, searched all over Google, watched countless videos on YouTube & yet I still can't grasp this for the life of me. This is my last resort. I know i...
Given the following function, $$f(n)=\prod_2^n \log i. $$ How can I find $f(n)=\Omega (?)$ and $f(n)=O(?)$ ? I tried to do it, but I have no idea how to do it ..
What would be the differences between these two branches of research? For what I know the theoretical research is the one that will not necessarily end up with an application part, but the applied research deals with experimentation. So it would be safe to say that applied research = experimental research? Could anybod...
Let's say I have this NFA automaton A: [q1] [reject] [q1] 0 -> [q2] [q2] [reject] [q2] 1 -> [q3] [q3] [accept] [q0] [reject][initial] [q0] 1 -> [q1] [q0] 0 -> [q0] [q0] 1 -> [q0] The output of Brzozowsky's minimization method, executed manually using JFLAP and confirmed by my own implementation is:...
I'm having trouble figuring out why the 1s and 0s are where they are in this game tree for the game Nim: There is a statement in the book that explains the numbers but it's still not clear to me, In implementing minimax, we label each level in the search space according to whose move it is at that point in the game, M...
I am reading Compilers and am unable to understand difference between these two terms. I could not find any text which has clearly mentioned how they differ but these two separate terms are being used. Can someone please explain me?
I understand that a big advantage of round robin scheduling over non-preemptive schedulers is that it dramatically improves average response times. By limiting each task to a certain amount of time, the operating system can ensure that it can cycle through all ready tasks, giving each one a chance to run, and the lengt...
Suppose we have $S=\{1,2,\ldots,n\}$, a binary variable $x$ and an integer $p$. I would like to model the following constraint using integer linear programming: If $x = 1$, then there must exists a unique $i\in S$ such that: $x_j=1$ for all $j\in\{i,i+1,\ldots,i+p-1\}$. How can I do this?
I have an algorithm problem that I want to share with you and I want to get some idea how can I solve it. Problem statement: You have to reach th Nth floor of a building by using a particular elevator: there is only one button that will take you from floor i to floor i+1 with probability p(i) or to floor 1 with probabi...
Is the first function big oh, theta or omega of the second function in the following examples. $(\log n)^{\log n} $ and $ \frac{n}{\log n}$ I am not sure how fast the first function grows. $n2^n$ and $3^n$ I think the second function grows faster but not sure how to prove it. $(\log n)^{\log n} $ and $2^{(\log_2n...
Referring to this reference... I'm trying to work out the details of an integer arithmetic implementation of the CORDIC iteration. The CORDIC pseudo-rotations can be summarized as $$ \left( \begin{array}{l} x_{n+1} \\ y_{n+1} \\ z_{n+1} \end{array} \right) = \left( \begin{array}{l} x_n - d_n2^{-n} y_n \\ x_n + d_n2^{-...
I want to know about the early invention/use of the adversary argument (see the lecture note by Jeff Erickson) which is a technique for establishing lower bounds of problems. I cannot find the original papers which invented/advocated adversary argument or the first problems whose lower bounds are obtained by adversary...
I am trying to understand how the reduction proof for non r.e. languages works by following the examples from this website. In most cases to prove that a language is not r.e., you can reduce the language to the non halting problem which is not r.e. For example, if I have $$L_2 = \{\langle M\rangle\mid M \text{ is a T...
I am wondering how to go from a language such as this: L = {a^n b^m c^k | n = m or m != k} To a Context Free Grammar. I know that I would have to turn it into two separate languages but I don't know how to create the production rules for each of those languages.
I have a matrix $A$ with dimensions $M \times N$ and I want to compute $A'$ such that: $$ A'_{i,j} = \alpha A'_{i,j-1} + (1 - \alpha) A_{i,j} \\ 1 \leq i \leq M, 1 \leq j \leq N, \alpha \in [0, 1] $$ Where $A'_{i,0}$ is some given constant. I want to perform this computation as part of a machine learning training proce...
When using Gauss-Jordan elimination to convert a matrix to an upper triangular matrix, truncation errors can drastically change the answer. For example, when performing row operations with excel, with the following matrix: Is reduced to: The value in the red cell is a truncation error and should be zero. The next ste...
Given an array of size $N$. I need to find the count of values in range $[L, R]$ which are repeated at least three times in successive positions (i.e., the value occurs contiguously three times). For eg- \begin{align*} A&= 1,1,1,2,2,1,5,1,1,2,2,2,5,5 \\ L&=0,\ R=3\,, \end{align*} the answer would be 1 (1,1,1)...
I have a language L = {a^n b^m c^k | n = m or m != k} When I was working the problem out this is what I got: S -> S1|S2 S1 -> AC A -> aAb|$\lambda$ C -> Cc |$\lambda$ S2 -> BD B -> aB|$\lambda$ D -> bDcc|E E -> Ecc|$\lambda$ I feel like this is right but at the same time I am not too certain it is. Is this the correct ...
Let $ \mathcal{X} $ be a domain set, $ \mathcal{Y}=\{0,1\} $ and $ \mathcal{H}$ an arbitary hypothesis class. Assuming that there's an algorithm $ \mathcal{A} $ such that for every distribution $ \mathcal{D} $ realizable by $ \mathcal{H}$, it holds that $ \mathbb{E}_{S \sim \mathcal{D} ^M}[L^{0-1}_{\mathcal{D}}(\mathc...
Given two DFA's , $M_1$ and $M_2$, I want to create an algorithm that determines if their languages are disjoint or not. The algorithm will run in polynomial time. My idea is this: Let's say WLOG that $M_1$ has 1 accepting state. We run DFS from that state and look at paths from the state to a starting state. Ideally, ...
I have been given that $n$ make-sets and $m \ge k$ finds and $k$ unions can be performed in $O(n + m \log^*(k))$ time (I'm aware of the ackermann function but am not interested in proving that). Where $log^*(k)$ is $0$ if $k \le 1$ and $1 + log^*(log(k))$ otherwise. The $n$ part is easy -- that's due to the number of m...
I cannot go on with this exercise: Determine whether $L = \{a^nb^m \mid n > 2^m \}$ is context-free. Let's suppose that $L$ is context-free. According to the pumping lemma, there exists $N > 0$ such that every $z \in L$ of size at least $N$ has a decomposition $z = uvwxy$ such that $|vwx| \leq N$. $|vx| \geq 1$. For...
I've seen a question asking if $A \le_m B$, then if $A$ is decidable, $B$ is also decidable. My initial intuition is that this is not the case, and that there are decidable problems that are reducible to undecidable problems. While I am not sure if this is completely correct, or even how to prove this if it is correct,...
Can anyone help me with Multiple Sequence Alignment (MSA) using Hidden Markov Model (HMM) by giving an example or a reference except these 2 references: 1-Eddy, Sea.R., et al.Multiple alignment using hidden markov models, 2-Boer Jonas, Multiple alignment using hidden Markov models, Seminar Hot Topics in Bioinformatics....
Suppose that $X$ is a finite set with a probability measure $P$. I want to find the subset $A \subset X$ so that the information gain of conditioning on ${A, A^c}$ is maximal. That is, I want to find $A$ that maximizes $$H(X) -H(X|\{A,A^c\}) = H(X) - (P(A)H(A) + P(A^c) H(A^c)),$$ where $H(A)$ refers to the entropy of t...
This is exercise 2 of the lecture note by Jeff Erickson on decision tree lower bounds. We say that an array $A[1 \ldots n]$ is $k$-sorted if it can be divided into $k$ blocks, each of size $n/k$ (we assume that $n/k$ is an integer), such that the elements in each block are larger than the elements in earlier blocks an...
I'm new to SIFT and was surprised by how much the features changed after resizing an image. Here's the images I used for testing: Original: Resized: Cropped: After running SIFT on those 3 images, I was surprised to find out that the original image was more "similar" to the cropped one than the resized one (I tested ...
Suppose that $\Omega$ is a finite probability space,with measure $P$ (we can take $P$ uniform). Let $C \in \{\pm 1 \}$ be a random variable on $\Omega$, the classifier. Let $$H(C) = H(C, \Omega, P) = \sum_{i \in \pm 1} P(C = i) \log P(C = i)$$ be the entropy of $C$. For a random variable $Y$ on $\Omega$ and $r \in \ma...
folks. My question is about explaining the each step of regular expressions. The task is to find the regular expression that contains 101 as a substring. I already know that the regular expression for this is $$ (0 + 1)^*101(0 + 1)^*. $$ The question is that how we should show each step for explaining the regular expr...
I know how to prove it by reduction, but I couldn't find an explanation why it is true. $\langle M \rangle$ represents the encoding of a turing machine $M$.
To find a solution for the Traveling Salesman Problem (TSP), one way to go is an algorithm called 2-opt, which is explained below. The 2-opt algorithm basically removes two edges from the tour, and reconnects the two paths created. This is often refered to as a 2-opt move. There is only one way to reconnect the two pat...
im new at OS and I want to know how to calculate the page size of this virtual memory system? Information: Physical Memory - 32 KB Virtual Address - 16 bit Offset - 12 bits Current content of the page table is this: I just want a formula for this and not the answer. Thank you
Let $L$ be a linear language. Then there is a constant $p$ such that for all $w$ in $L$ with $|w| \ge p$, $w$ can be written as $uvxyz$ where (i) $|uvyz| \le p$ (ii) $|vy| > 0$ (iii) $uv^ixy^iz$ is in $L$, for all $i \ge 0$. How do I prove the first condition? I am having difficulty proving the bound and relating the b...
I have some difficulties proving that the language of unary primes ($L=\{1^p\mid p\text{ is prime}\}$) is not regular using the pumping lemma. Any suggestions?
So I'm having a tad bit of a problem deciphering the formal definition of NP. In my text book (Algorithm Design, Tardos et al) it says that a problem $X$ belongs to $NP$ iff; there exists a "certificate" string $t$ such that $|t| \le p(|s|)$ for a polynomial function $p$ and an input string $s$. there exists an effic...
Given a list of real numbers $p_1, \dots, p_n$, I am looking for a most efficient algorithm to sort this list in a "probabilistic ascending order", meaning that $p_i < p_j$ implies that it is likely for $i$ to be placed before $j$, but not certain. In principle, every permutation is a possible output, but the less sort...
Problem And Question I am looking for pointers for an efficient algorithm for the following problem. It is hard to explain without some data so first I will provide some example data: Destination 1: Source 1: Cost 26 Source 2: Cost 32 Source 3: Cost 98 Create New Source: Cost 100 Destination 2: Source 1...
I'm trying to prove formaly this claim, given that $\mathcal{H}$ is a hypothesis class of binary classifiers. According to the definition, Hypothesis class $\mathcal{H}$ is agnostic PAC-learnable with respect to $ \mathcal{Z}=\mathcal{X}\times \mathcal{Y}$, if exists a function $ m_\mathcal{H}:(0,1)^2\rightarrow \mathb...
I have multiple sets, e.g., $$\{1, 2\}, \{2, 3, 4\}, \{1, 4\}$$ Each variable $1, 2, 3, 4$ is binary. I need to represent the following condition without additional variables $$(1 \land 2) \lor (2 \land 3 \land 4) \lor (1 \land 4)$$ Basically, I need to enforce that either $1$ and $2$ are 1s, or $2$ and $3$ and $4$ are...
I'm going to simulate an asynchronous distributed system. In a distributed system, when a node sends a message, after $\Delta t$ seconds the message reaches to its destination. My Question: What is the probability distribution of $\Delta t$s?
I'm trying to apply the CFL pumping lemma. And, I've already tried words $a^pb^p$ and $a^pb^pc^p$. Not sure where to go from here.
Let's suppose that I have a monodimensional numeric domain and a list of ranges in this domain defined as class Range { int lowerBound; int upperBound; } then it's trivial to check if the union of the List<Range> is covering the entire domain. However in case of a bidimensional domain I have a List<Pair<Range>...
I need to prove that $n^2$ is not $o(n^2+10^{10}n)$. I thought of the limit test: $$ \lim_{n \to \infty} \frac{n^2}{n^2+10^{10}n} = 1 \Rightarrow n^2 = \Theta(n^2+10^{10}n) $$ However I'm not sure if the result of the test rules out the possibility of $o(n^2+10^{10}n)$.
Given a N * N maze, and string of N,E,W,S denoting positions to move to. I need to determine how many moves are possible in sequence out of a string (containing these 4 letters only) from each cell as starting point. The maze cells are denoted by 0,1 ,where 0 denotes an obstacle and 1 denotes free path to move on. For...
I was reading "COMPUTERS AND INTRACTABILITY. A Guide to the Theory of NP-Completeness", and I am stuck at this part (page 236, SS22): In the second paragraph, 3rd line, the authors said that: "The general problem can be solved in polynomial time if $K=0$ [Lawler, 1973], or if $\lessdot$ is empty [Moore, 1968], [Sidney,...
I am implementing the techniques described in the classic Local Type Inference paper. Specifically, I am implementing the type argument synthesis algorithm from section 3. My algorithm seems to mostly work, but it doesn’t seem to produce reasonable results when a quantified type variable appears in the result of a func...
After my Theory of Computation class today this question popped in my mind: If a problem can be solved by a finite automaton, this problem belongs to P. I think its true, since automata recognize very simple languages, therefore all these languages would have polynomial algorithms to solve them. Thus, is it true that ...
This is something that has bugged me for a while, so I hope you can help me. Suppose: $A'$ is the set of all programs, $halt?$ is the halting problem solver, $D$ is the program that is constructed in the proof to show HP is undecidable Obviously $halt? \in A'$ and $D \in A'$. $A' - halt? = A$ is the set of all progra...
Rice-Shapiro theorem is: Let $Γ$ be a set of computable functions such that the set $R_Γ$ is recursively enumerable. We have $f ∈ Γ$ if and only if there exists a finite function $θ ∈ Γ$ such that $θ ⊆ f$. If $Γ$ is singleton set, for example $Γ = \lbrace ϕ_{10}\rbrace$ then $R_Γ = \lbrace 10 \rbrace$ and is recursiv...
Under the assumption that $P \ne NP$, why is it impossible to reduce a problem that is known to be NP-complete to a problem that is known to be of polynomial time complexity? What kind of fundamental theorems would this contradict if it was possible?
I noticed in a paper that the mate-in-n problem of chess, even played on an infinite board is decidable. The mate-in-n problem of infinite chess is decidable I believe the paper assumes only traditional chess pieces are used. What if one of the chess pieces is a huygens? (A huygens is a chess piece which jumps prime num...
I am trying to prove the following: Let $\Sigma $ be an alphabet not containing the symbol "$;$", and suppose that $L \subseteq \Sigma^*$; $\Sigma^*$ is recursively enumerable. If this is the case language $L' = \{x \in \Sigma^*: x; y \in L \ for \ some \ y \in \Sigma^*\}$ is recursively enumerable. which left me a li...
I am looking for the portion of LTL formula that can be expressed by deterministic buchi automata. Is there any classification of this such?
I am trying to answer this question: Consider a computer with a byte-addressable memory. A 40-bit memory address is divided as follows for cache processing. First, the 8 low-order bits are chopped off to expose the cache-line number. Second, the next 17 low-order bits are inspected to get the cache-container index. Th...
If someone were to build a universal quantum computer, would that have any implications on the problem of P vs. NP?
I am implementing an approximate similarity search using multi-index hashing. I have a set (T) of millions of strings (of same length) and I have a query string(P) (or set of strings) that needs to find similar strings former set. My implementation is the following (assuming length is 64 and similarity is defined as h...
Are there any decision complexity classes, where the "-Hard" version of the class does not intersect with the original class?
I am struggling to understand how the known oracle, and conditional derandomization results connecting $BPP$ and $P$, relate to each other. My understanding is that if there is a suitably strong pseduo-random number generator that only uses $O(\log n)$ seed bits, then we can derandomize $BPP$ to $P$ by simulating $BPP$...
QV Le et al. show in Building high-level features using large scale unsupervised learning (2012) how to use unsupervised learning of a deep neural net to recognize faces and cats. Working through this paper, I have a few questions: 1) Their neural net has an input layer (200x200 pixels times 3 channels) and then nine l...
I got an alphabet E={x,y,z}. And i want to create a finite state automaton that accepts strings consisting of at least two x's, followed by at most three y's followed by any number of z's. And i want to draw a transition diagram for this. And i am new to this concept, So far i got here. And i know i am wrong so if some...
Let $n \in \mathbb{Z^+}$. Find, with proof, the number of distinct graphs with the vertex set $V = \{1, 2, \ldots,n\}$. We say two such graphs are distinct if one of them has an edge $(u, v)$ and the other one does not have this edge with the same vertices.
Does anyone have an idea about the idea of implementing a data structure so that - the following things will happen? The structure should save the amount of money that n people have, each person has for example a "cell" that contains the amount of money he has. And then, how can you implement this data structure so...
Note: overline denotes complement I am trying to show that $\overline{\text{HALT}'}\leq_1 \{i\colon\Phi_i=\Phi_e\}:= A$ for some fixed $e$ but I am misunderstanding the problem or method and can't figure out where I'm going wrong. I am using the construction of the proof of Rice's theorem to prove this and I thus do th...
So from what I understand, if a language is recognisable then using a TM it can be accepted and halted or rejected or halted, however a language that is decidable can be accepted and always halts on rejection? Given the language $A_{\mathrm{DFA}} = \{\langle A \rangle\mid A \text{ is a DFA and } L(A) = \{0, 1\}^∗\}$ , ...
Consider the page table below (all numbers are in hex) and assume 1 KB page size. Assume 16-bit logical address and 20-bit physical address. a.What are the page numbers and offsets for the following logical addresses: 1.1CC4 2.3A98 3.43FC 4.600C 5.2BD0 6.0 b.provide the physical address for each part a: I figured out ...
Given the following algorithm (pseudocode): alg1(A[1,..,n]) i <- 1 candidate <- NULL count <- 0 while(i <= n) if(count = 0) candidate <- A[i] count <- count + 1 else if(candidate = A[i]) count <- count + 1 else count <- count - 1 ...
I'm trying to see if I can find an algorithm such that given a range [m,n], I want to output the number such that on application of either of these steps, I can reduce the number to 1 in the minimal steps. If odd, multiply by 3 and add 1. If even, divide by 2. m,n are small enough to ensure the collatz conjecture hol...
Suppose you have some programming language with manual memory management. What features does this language need to have in order to be able to implement precise garbage collection as a library, and not as a fundamental language construct? By a precise GC I mean one where only pointers to the heap are traversed to ascer...
Given a 3D greyscale image (particularly a dental scan) I have localized a jaw on it, i.e. made jaw's voxel intensity values much higher than others. Using this, how can I create a 2D panoramas from that 3D image? I have tried reduce_max across axis but results are far from perfect. Is there a better approach? Thanks i...
In regard to the critical section problem, an algorithm that switches between allowing one of two processes, P1 or P2, to complete their critical section would cause starvation for P1 if P2 stayed in its non-critical section forever. However, if P2 exited, descriptions of this algorithm also classified it as only star...
I have set of 1000 samples. each sample represents MEAN of X amount transactions response time. Now I have a running transaction , I know it's current response time but I want to know if this particular transactions elapsed time is normal relative to my all previously collected sample. is there a statistical method t...
I am trying to design an algorithm that will generate the full list of ways to minimally satisfy multiple requirements, given information on how the individual requirements are fulfilled. For example, let's say you can either have (1) or not have (0) four different foods: Apple, Banana, Carrot, Donut. Requirement 1 say...
class test{ public static void main(String args[]){ int n = 5; mystery(n); } public static void mystery(int n) { if(n == 0 || n==1) { return; } mystery(n-2); System.out.println(n); mystery(n-1); } } This a very simple void method code. I want to know what happen during the recursion and why ...
What type of problem would this question fall under, are there known algorithms/heuristics for it, what would be good resources to learn more about solving it? Given: a list of items each with a destination location: the number of items per destination is unbounded (and can be zero for some locations). All items are a...
In the presence of subtyping, a type checker can usually infer only some inequality constraints on the type rather than the exact type. Of course, internally it will store the full constraints. But what is the common practice in case it needs to display the inferred type to the programmer? I thought it might be reasona...
The problem is to find an algorithm that colors all the edges in any arbitrary tree T with a root r, let's say in blue and red, such that the number of blue edges is maximal and there isn't more than three blue edges in a row on any path starting at r. Update: I've tried a top-down solution, but I'm not able to figure ...
I want to organize a business lunch with two societies $E_1$ (mine) and $E_2$. Each society is made of four people from the Executive management and 6 of the Financial Management. I want to organize this lunch with two tables of ten people with the following constraints : At least one member of each four department ha...
I have a time series which represent the sine curve. Now I want a regressor to learn this curve, and being able to predict for future values. PS: Sine curve is only for testing purposes. What I want is to learn that function and its parameters as well which need not be sine.
I'm given a black box that on graph $G = (V,E)$ and integer $0< K<|V|$ outputs $1$ iff there is a simple path of length greater than $K$ in $G$. I want to find the actual edges of the longest path in $G$ using as few calls to my black box as possible. What I've come up with thus far is using the same method as when bi...
How to show that the language containing the words whose length is a power of $2$, $L=\{w\mid|w|=2^i\}$, isn't regular using the pumping lemma? The pumping lemma says that Let be M a regular language. Then it exists a number $p>0$ such that for each word $w\in L$, such that $|w|\ge p$, it exists $x,y,z$ such that : $...
I have a recurrence relation: $$T(n) = 3T(\frac{n}{4}) + n\lg n$$ and I want to prove that $T(n) = \Theta(f(n))$ using Master theorem. There's also an example in my textbook on this relation, they're choosing $\epsilon = 0.2$. For example: $$n^{\log_b a}=n^{\log_4 3} \Rightarrow n\lg n = \Omega(n^{0.79+\epsilon})$$ ...
Let's consider the following formula: $\square (\neg A \cup B)$. Does the following computation satisfy it? The numbers in brackets are number of state. (0) $\neg A, \neg B$ (1) $\neg A, B$ (2) $A, \neg B$ $\square$ means that for every state in computation the formula $\neg A \cup B$ is satisfied, so: In $0$ state it ...
Look at this solution: Is the lower bound $m\log n$ because we are only looking at the lower bound for union by rank only? If we make $n$ MAKE-SET operations, then there would be $\log n$ UNION operations, and then $m - 2n + 1$ FIND-SET operations. The lower bound seems larger to me but what am I missing?
it's my first answer here. I do have an algorithm to calculate the factorial of a given number $n$ recursively, but without using any multiplication like the usual one, only sums are available. I've ended up with an algorithm with a complexity function $T(n) = 1 + nT(n - 1)$. Opening the recurrence relation ends up i...
I wonder whether the following language is regular: $$ L = \{ \ w \in \{a, b, c\}^* \ | \ w = uv \ \ and \ \ \#_a(u) + \#_b(u) = \#_b(v) + \#_c(v) \ \} $$ where $\ \#_x(w) $ is the number of occurrences of$\ x $ in$\ w $.
I read that tiling problems can be modeled as satisfiability problems (2-SAT?), but the author did not explain how. Is this true? What would be an example? By a "tiling problem" I mean you have a matrix and have to fill it up according to some constraint. For example, you might have to fill the matrix with a particular...
The following undirected version of Bounded Diameter Spanning Tree problem is solvable in Polynomial Time. Undirected Version: Given an undirected Graph $G = (V, E)$ with each edge weight either 1 or 2; 2 positive integers $B$, and $D<=3$. Problem Statement: Is there a spanning tree $T$ of $G$ such that the sum of ...
$L=\{\langle M \rangle \mid \text{There are infinitely many words accepted by M in less than 10 moves}\}$ I am having hard time understanding this language and I have several questions: How is it possible to derive infinite amount of words in finite moves? How can we determine if a word is or isn't in the language at...
In textbook by Vazirani's textbook, chapter 9 about Bin Packing. He give the following lemma. Lemma 9.4 Let $\epsilon >1$ be fixed, and let K be a fixed nonnegative integer. Consider the restriction of the bin packing problem to instances in which each item is of size at least $\epsilon$ and the number of distinct ite...
I have an optimization problem and I'm looking to find an algorithm whitch best fits this. The problem is the following: There are several points of interest (POI), each has a value (for the user), the distance to each other POI is also known. Now I want to generate the best tour (ordered list of POIs) with the most va...
I have a binary $m \times n$ matrix of rank $m$ (hence $m < n$). I need to count how many subsets of its columns form matrices with a full column rank, i.e. columns in the subset are linearly independent. Straightforward approach would be to iterate over all subsets of columns of size up to $m$ (because column rank can...
Interpretation: Consider the comic strip below, where a person tries to prevent a robot from dismembering them by asking the robot to compute $\pi$ - the robot quickly produces an algorithm to calculate all of the digits of $\pi$ and begins dismembering the person. This is possible because $\pi$ is a computable number....
In this question : Does $NP^{NP}=NP$? , it says that one of the reason is that we don't know how to detect 'no' answers from the oracle. Why is that true though? There is an NTM for any language L in NP, that runs in polynomial time. IIRC we can simulate the NTM with a deterministic TM M that runs in exponential time, ...
I already saw similar question Counting elements that are greater than the median of medians but I couldn't find my answer in there. CLRS (3rd ed.) give an algorithm for $O(n)$ worst case arbitrary order statistic of $n$ distinct numbers. This is the algorithm: Divide the $n$ elements of the input array into $\lfloo...