instruction
stringlengths
35
29.1k
I learned finding a solution of 2-sat problem algorithm below. The point are below (1) when constructing the implication graph (2) finding there is no occurrence of a variable x and its negation x' in any SCC in the graph. (3) then there is always the solution at this 2-SAT problem. it means that all false 2-SAT proble...
Given an input problem P, can you construct an algorithm A to compute whether or not P is decidable or undecidable? In other words, is the undecidabiliy of a problem undecidable? My initial guess is that yes, undecidability of a given problem is undecidable, because the above algorithm seems reducible to the Halting pr...
I came up with following subproblem while working on another problem. Can someone confirm if its a recognized problem. I have spent months but couldn't make any progress. Design a data structure that maintains a directed graph. A node with node_id=0 is created by default, having no edges. The data-structure supports f...
Doesn't the modification described in paragraph three potentially introduce non-determinism? For example, say neither a, b, x, nor y is the empty string (denoted e). If in the original machine P we have: f(q, e, x) != null f(q, a, y) != null f(q, b, y) != null wouldn't the modification give us: f(q, e, $) != null f(q...
I can't find how to prove the decibility with a reduction. EDIT: I've tried the reduction from the halting problem and the aceptance problem. Stopping for at least one entry has infinite inputs (you have to check all possible inputs) but the halting problem only has one input for the TM. I don't understand how can i f...
My question is about why does the result of Baker-Gill-Solovay not prove that $P \neq NP$. There have been several questions on this forum about this topic perhaps but I couldn't find my specific question amongst them. Context: This is what I had in mind when I first saw the Baker-Gill-Solovay result (there exists an o...
Please help prove the following statement: The indexed family of all unary partial computable functions that have total computable extension is computable. Definitions: Total function - a function which is defined for all inputs of the right type, that is, for all of a domain. A function $g$ is called an extension o...
I have following grammar it doesnt not have Epsilon-derivation problem I can only see left recursion: S -> a b S S -> S a b S -> c d S -> a d in production number 2 there is left recursion which I removed and I got: S -> a b S F S -> c d F S -> a d F F -> a b F | EPSILON But it is still ambigous?
We are given a tree with n vertices and some of the vertices act as a "hotspot". We have to answer multiple queries of type (a,b,c), which means we have to find the distance to the nearest hotspot from c such that we do not travel through the edge between nodes a and b. I have tried many data structures like using lowe...
In "Understanding Machine Learning, From Theory to Algorithms" by Shalev and Ben-David, on page 44 example 6.1, it is proved that the class of threshold functions are PAC learnable. on the other hand, The Fundamental Theory of Statistical Learning States that A-PAC learnable is equivalent to PAC learnable. So can we sa...
I'm working on my school homework,even though i found all three of these. It says use limit to compare. I confused , what should i do, i mean its obvious C A B
I'm trying to find a closed formula for the below recurrence relation: For the first one, $n$ is some power of 2 $$T(n) = \begin{cases} 4 & \text{if $n=1$} \\ 2T(\frac{n}{2}) +4 & \text{else} \end{cases}$$ $$T(n) = \begin{cases} 1 & \text{if $n=0$} \\ T(n-1) +3^n & \text{else} \end{cases}$$ I tried to use the substit...
In a palindrome of size N, the amount of candidates for the longest palindrome is N^2. Therefore, the information theoretic lower bound (IBT) should be lg(N^2), which is equivalent to a runtime complexity of lg(N). By IBT I mean that if we use a comparison based algorithm and you think about a decision tree to apply it...
Hey guys in a turing machine can a state go to itself by reading a letter. For example, q2 reading a 'c' to go to itself. Is that possible? Or does it need to read a tape alphabet, such as $ to read that c and then go back to q2?
Query: Given $m$ unique integers smaller than $2^n$, can we keep at most $k$ the same bits of each number to uniquely identify them? Is this problem NP-Hard? For example, given the $4$ unique numbers smaller than $2^3$ 011 100 101 110 ^^ The numbers are still unique if we remove the leftmost bit from each number. So ...
I often have to balance the computational requirement of each qualitatively different module of my algorithm. So, I'm using this heuristics for maximizing the performance for a given complexity, but I couldn't find this heuristics anywhere online. Could anyone give me some reference? Let $F(x):=\sum_{i=1}^N O(f_i(x))$...
I have two sequences, seq1 and seq2, each consisting of unique values. Values can appear in seq1 or seq2 which do not appear in the other, and these values can appear in any order. How do I identify which values have been moved in seq2, such that values appear earlier or later in seq2 relative to the values in seq1? To...
Here's the question: Compute the intersection of the following two languages: \begin{align} &L_1 = \{ a^{n+1} b^{2n} a^{n+1} \mid n \ge 0 \} \\ &L_2 = \{ w \in \{a,b\}^* \mid \#_a(w) + \#_b(w) \equiv 1 \pmod 2 \} \end{align} I'm pretty sure that $L_2$ is just "$|w|$ is odd", which would mean the intersection of the...
Given are tuples $(a_{11},\dots,a_{1k}), (a_{21},\dots,a_{2k}), \dots, (a_{n1},\dots,a_{nk})$. We want to know if there is a partition of the tuples into two parts, so that for every coordinate $i=1,\dots,k$, the sum of each part is equal to the sum of the other part. Has this problem been studied before? If $k=1$, it...
I have been going through a theory of Two-way finite automatons and I did not understand the given example when there were a DFA A = (Q, Σ, δ, q1, F). the 2-DFA B = (Q ∪ Q| ∪ Q|| ∪ {q0, qN, qF}, Σ ∪ {#}, δ|, q0, {qF}) and a following language L = { #u# | uu ∈ L(A)}. In following paragraph I will describe how would it...
Given $k$-sorted arrays in ascending order, is it possible to merge all $k$ arrays to a single sorted array in $O(n\log(k))$ time where $n$ denotes all the elements combined. The question is definitely aiming towards a Min-heap/AVL tree solution, which can in fact achieve $O(n\log(k))$ time complexity. However i'm wo...
A class of total functions is a PRC class if: The class includes all projection functions $p_i(x_1,\ldots,x_n) = x_i$ and the initial functions $n(x) = 0$ and $s(x) = x+1$. The class is closed under composition and primitive recursion. Prove that the class of all total functions is a PRC class. Is it true if I say ...
Suppose I have 3 sets of 2 elements: [A, B], [C, D], [E, F], and I wanted to generate all possible combinations of 1 element from each set, such that the result of the algorithm would be: [A, C, E], [A, C, F], [A, D, E], [A, D, F], [B, C, E], [B, C, F], [B, D, E], [B, D, F] What algorithm can I use to generate all com...
If $L1⊆L2$, and $L1\not∈RE$, is it possible that $L2∈RE$ ? Also I find it hard to find languages that are not in RE at all, I've heard about Arithmetical hierarchy but we didn't really learnt it in class so I guess the solution shouldn't necessarily be correlated to Arithmetical hierarchy. I know that the $A_{TM}=\{(〈M...
does L1 ≤ p L2 yield that coL1 ≤ p coL2 for the same reduction?
Is it possible to write a mathematical statement (like Goldbach's conjecture, for example) as a nontrivial 3-SAT formula that is satisfiable iff that statement is true? iff it is false? iff it is independent of the axioms of ZFC? So, for any statement, you would have (at most) 3 formulas, for which only one can be sati...
I've been studying this YouTube video on Powells method and it looks like when we have a single variable we start at the upper and lower bounds of the variable and then we keep dividing the search space until we find the minimum. So for a single variable it looks pretty easy. How do we do it for 2 variables? Does anyo...
How to prove that: $E_{TM} = \{\langle M\rangle\mid M \ is\ a\ TM\ and\ L(M)=\emptyset\}\notin R$ (is undecidable) using the language: $H_{halt}=\{(⟨M⟩,w):M\ halts\ on\ w\}$. I tried to prove by contradiction that assuming $E_{TM}\in R$ I have a Turing machine which decides $E_{TM}$ and to construct with it a turing ma...
How does an ip prefix 90.0.0.0/4 translate to 0101∗ in binary and 10.0.0.0/2 to this: 00* I'm trying to understand it since a while now but I am unable to derive the logic.
The question popped up in my head. The hash function used is Murmur3.
For: $$\sum^{n+m}_{i=n} \log(i)$$ I'm wondering what the big O notation is and how to prove it... I believe that we can also write this as $$\log(n) + \log(n+1) + \log(n + 2) + \ldots + \log(n+m)$$ also $$\log(n+m)!/\log(n-1)!$$ Thanks
I have a Rails application using Postgresql. Texts get added to the application (ranging in size -- as short as a few words, to as long as, say, 5,000 words?). The text gets parsed, both automatically and by hand, to associate each word/position in the text with specific information (part of speech, grammar tags, lemma...
Given this sorting algorithm: Sort(A, n): if (n == 1) return isSorted = true for i=1 to n-1 do: if (A[i] > A[i+1]): isSorted = false temp = A[i] A[i] = A[i+1] A[i+1] = temp end for if (isSorted) return else Sort(A, n-...
i am reviewing older exams from my computational theories lesson in university and i am struggling to figure this one out: Construct a regular expression for the following language: Strings of even length in alphabet {a,b,c} that contain exactly one a. Roughly translated from greek, hope it makes sense. Thanks
According to this post it is saying Two's complement is only for integers, but in Wolframalpha is is saying the Two's complement of 16.5 is 0010000.1, how?
I am asking this question here, because I am not allowed to comment on the thread that I am actually interested in, but maybe someone can still help me? I alredy found an anwser to the Problem above (in the post linked to this question), but I still don't understand, why I can't just use that one case $s = \alpha \beta...
what steps should I take to find out what is the context free grammar of $L(w) = \{a^i b^j c^k \mid k = |i-j| \}$
Working through some material on CPU architecture and am unsure on the following question: Suppose that an instruction encoding format has 4 bits for argument registers. How many registers is the architecture most likely to have? Why? What is the general principle is here - how the size of argument registers correspon...
I am looking for an algorithm to uniformly generate a descending array of N random numbers, such that the sum of the N numbers is 1, and all numbers lie within 0 and 1. For example, N=3, the random point (x, y, z) should satisfy: x + y + z = 1 0 <= x <= 1 0 <= y <= 1 0 <= z <= 1 x >= y >= z My guess is all i have to d...
I start off by apologizing for the fact that I don't really know how to use latex/markdown. My question, however, is directly from the Introduction To Algorithms book by Cormen et al. The topic discusses about the time analysis for disjoint set operations using forests with union-by-rank and path-compression heuristics...
We are given 2 algorithms A and B such that for each input size, algorithm A performs half the number of steps algorithm B performs on the same input size. We denote the worst time complexity of each one by $g_A(n),g_B(n)$ Also, we know there's a positive function $f(n)$ such that $g_A(n)\in\Omega(f(n))$ Is it possible...
Which of the following are proper network (not host) addresses? 192.168.23.0/24 193.205.16.132/26 172.16.4.0/20 10.57.13.64/28 How can I tell? What is a proper network address? Is a proper network address when the IP address is the same as the network address? For example in the first one that is the case.
I try to find a context free grammar for the language $L = \{u\#v \mid u,v \in \{a,b\}^* , \vert u \vert_a \neq \vert v \vert_a \text{ or } \vert u \vert_b \neq \vert v \vert_b\}$. There is a hint in the task that one should first construct the context free grammar for cases such as $L_1 = \{u\#v \mid u,v \in \{a,b\...
I want to implement my version of the Codeshare service. Now I'm thinking of an implementation where all users have access to one string that can change (if you already have a better option here - please write about it). What algorithms and data models are suitable to find the difference between two strings and to comp...
Is it possible to design a Turing Machine for the language defined as L = {0n1n | n >= 0} with only the symbols in the set of {blank, 0, 1}?
I've recently been made aware that there exist Monte-Carlo algorithm(s?) for determining whether a Hamiltonian path exists in a graph. I am struggling to figure out how it would work. What is the random element?
The problem of minimizing weighted flow-time (min-WPFT) is defined as follows: We are given a set $J$ of $n$ jobs, each job $j$ having a release time $r_j$, a processing time $p_j$, and a weight $w_j$. We want to find a preemptive scheduling of the jobs on a single machine. (Preemptive meaning we are allowed to halt a...
I have an array of $N$ weights $w_i$, say $w_i=\{4, 5, 12, 16, 3, 10, 1\}$, and I need to divide this array into $P$ partitions such that partitions are optimally balanced, i.e. that maximum sum of weights of any partition is as small as possible. Luckily the problem is constrained by the fact that the weights can't be...
Given a fair coin and a number $p\in(0,1)$. How do you design a game that finishes in a finite number of tosses with probability $1$, and further, with probability $p$ you win the game? I thought about random walks where head, you add 1, tail you subtract 1. And you want to get to $n$. But that gives an approximation t...
I'm trying to change below context free grammar such that it becomes unambiguous, but I don't know what steps I should take. Is there any specific way of doing that? Here is my CFG: \begin{align} &S \to SS \mid T \\ &T \to aTb \mid ab \end{align}
If A and B are regular language, what is a context free grammar of the following language? $$ A \circ B = \{ xy \mid x \in A \text{ and } y \in B \text{ and } |x|=|y| \} $$
I need to find an algorithm to find a sub-graph $G'=(V, E')$ of a directed unweighted graph $G = (V, E)$ where for all $(u, v)\in E$ there exists a path in $G'$ from $u$ to $v$ and the size of $E'$ is minimal. As an example, $(1, 2) (2, 3) (1, 3)$ reduces to $(1, 2) (2, 3)$. Additionally, $(1, 2) (2, 3) (1, 3) (3, 1)$ ...
I have an undirected graph where each vertex is given some items from a set of items. My goal is to find the lowest cost path from my source vertex to destination vertex while collecting all such items. The added constraint is that I may split my path once at a node once to collect items from some other path and reach...
I'm reading about CPU caches and I read that typically, cache line sizes start from 32 bytes. Since memory is slower than CPU caches therefore data is frequently loaded from the RAM into the cache and the size of the data loaded depends on the cache line size. Now I wanted to know what are the typical sizes of the dat...
I just got started with Python PCEP course material on netacad.com. I've come across the following exercises: 2 % -4 = -2 2 % 4 = 2 As I understand it, the modulo operator returns the remainder of a division. So 2 divided by (-4) gives (-0.5). How does Python3 calculate the remainder of that as 2? I know it's s...
I wonder how can I find out what is context-free grammar of the following language? $$ L_4 = \{w_1\#w_2 \mid w_1,w_2 \in \Sigma^*, w_1 \neq w_2^R \} $$
In his book "Theoretical Computer Science", Juraj Hromkovic informally defines the Kolmogorov complexity $K(x)$ of a word $x$ consisting of zeros and ones as the binary length of the shortest Pascal program that generates $x$. The Kolmogorov complexity $K(n)$ of a natural number $n$ is then defined as the Kolmogorov c...
I can't find out how to find a context free grammar for bellow language, is there any specific way to solve that? $L = \{w: n_c(w) \ne n_a(w) + n_b(w)\}$
I'm trying to familiarize myself with correctness proofs and need some help. In the proof for SimpleSelect (P.25), why do we assume both $A'[i] < A'[k]$ and $1 \leq i \leq k$? I'm not quite sure why we do this, as the text states that because "of what it means for an algorithm to meet its specification, any proof of co...
I'm a CS student and I'm trying to understand the searching algorithms used in AI. My problem is that I don't really understand how to treat a problem like a search problem. I don't know which would be the first steps for solving it and how shall I choose the right algorithm for that. For example, I have a problem like...
To be clear, I didn't hear of this in any particular venue, and so can't point you to one. Two variants that I can bring you: String spitting Given a string (sequence of elements), and a function that takes a substring and returns a score/penalty. Overall score is the product of scores of chosen split. Find the optim...
The recurrence form of bubble sort is $T(n)=T(n-1)+ n- 1$ How can I prove by induction that this is $\Omega(n^2)$? I'm stuck with $T(n+1) \geq cn^2 + n = n(cn+1)$
Here is the problem: We have an ordered To-Do list with n tasks. The duration of every task is given and tasks need to be completed in order. We need to distribute the tasks to m days. Individual tasks cannot be split between days. How can we minimize the variance of the total task duration of days?
I've given a task and wonder if there are any better solutions. Inputs of task are: Distance of district pairs Population of pairs Goal is: Find n districts at which its population and districts x miles range districts' population is max. Extra information: Unique district size is tens of hundreds. As an example...
im trying to check if this grammar is LL(1). S -> L = R L -> * L | id R -> L | R + R | num As you can see there is a Left recursion on R production. So i remove that and what i get is: S -> L = R L -> * L | id R -> L R' | num R' R' -> + R R' | ε Now the problem that i have is that First and Follow set of R' rule ...
Goldbach's Conjecture says every even integer $>$ $2$ can be expressed as the sum of two primes. Let's say $N$ is our input and its $10$. Which is an integer > 2 and is not odd. Algorithm 1.Create list of numbers from $1,to~N$ 2.Use prime-testing algorithm for creating a second list of prime numbers 3.Use my 2_sum solv...
In Weihrauch's Type-2 computability theory, a string function $f\colon\subseteq \Sigma^{\omega}\rightarrow \Sigma^{\omega}$ (the $\colon\subseteq$ indicates that $f$ may be a partial function) is computable iff there exists a Type-2 Turing machine that exactly realizes $f$, which implies that the Turing machine must fa...
Suppose there exists some NP-complete problem such that the number of inputs that gives 1 as an output is bounded by a polynomial; that is, if the problem is $f \colon \{0, 1 \}^* \to \{0, 1\}$, then, for every $n$, $|\{ x \in \{0, 1 \}^n : f(x) = 1\}| \leq p(n)$ for some polynomial $p$. Then, I want to show that the e...
Let's have expressions that are composed of elements of $\mathbb N$ and a limited set of binary operations {$+,\times,-,/$} and functions {$\exp, \ln$}. The expressions are always well-formed and form finite trees, with numbers as leaf nodes and operators as internal nodes, binary operations having two child sub-expres...
You are given two algorithms $A$ and $B$, with worst-case time complexity $f_A(n)$ and $f_B(n)$, respectively. Assume: (i) For each $n$ there exists an input $x$ of size $n$ such that the number of steps of algorithm $A$ on $x$ is half the number of steps of $B$ on $x$. (ii) $f_A(n) = \Omega(h(n))$ for some positive fu...
If sequence X has m symbols, then X has 2m possible subsequences. Where does the base (2) come from? The origin of this question is the following paragraph: We are given two ordered sequences of symbols, and we wish to find a longest common subsequence of $X$ and $Y$. A subsequence of $X$ is just $X$ with some (or pos...
I am trying to show that the best case time complexity of Quicksort is $\Omega(n \log n)$. The following recurrence describes the best-case time complexity of Quicksort: $$T(n) = \min_{0 \le q \le n-1} \left(T(q) + T(n-q-1) \right) + \Theta(n).$$ But I have difficulty in proving that $T(n) = \Omega(n \log n)$ using the...
Assume $n=2^k$, write an algorithm that can find $k$. **log function is not allowed. Is there an efficient way to find the power instead of multiplying by 2 until it equals $n$? What is the optimal efficiency?
I am supposed to minimize the following DFA automa, which contains dead state: But after the minimization of the automata, it stayed the same. Is it correct?
When one "downloads" a language (say, downloading the python file, or doing apt-get ruby or something), is it always the compiler/interpreter you are downloading? In other words, does a "language" ever exist outside of its syntax and behavioral descriptions? Perhaps standard libraries can be written in the language it...
In Types as Abstract Interpretation, Patrick Cousot sketched how different type systems could be constructed from the collecting semantics of a language. However, the notation of the paper is very old and I'm not able to reconstruct it. Does anybody see what would be an abstract interpretation corresponding to the sim...
I have a function $f(m, n)$ with time complexity $T(m, n)$ characterized by the recurrence relation $$\begin{align} T(m,\ n) &= 2T\bigl(\frac{m}{2}, \frac{n}{2}\bigr) + c_0 \log n + c_1.\\ T(m,\ 1) &= T\bigl(\frac{m}{2}, 1 \bigr) + c_1 \\ T(0,\ n) &= 1 \\ T(m,\ 0) &= 1 \end{align}$$ I can see that for fixed $m$, this i...
i'm studying for an exam i'll have soon and i don't understand how to draw a DFA for a regular expression, i asked my professor by mail but he doesn't asnwer... In the courses available on my college's website there is no step by step exemple Here is the expression i'm trying to convert b(a∗dc)∗ Thank you for the help ...
$L_1 = \{ \langle M, w\rangle : M \text{ is a TM that never moves its head past the input string } w \}$ $L_2 = \{ \langle M\rangle : M\text{ is a TM that never moves its head past any input string} \}$ Consider the two languages above. I want to know which ones are decidable. I know that $L_1$ is decidable, because...
I have a list of unordered line segments, some of whose endpoints lie on the same point. How do I connect these segments efficiently to form a minimal amount of paths? For example, if I have the following lines $(x_1, y_1, x_2, y_2)$: [[0, 0, 2, 2], [4, 0, 2, 1], [2, 2, 4, 0]] the algorithm should be able to join these...
Given a finite, partially ordered set with the following two properties: Every element in the set has one of two types: "A" or "B". The type does not define the total ordering of the set and is metadata. Every element in the set is a natural number and the poset can be ranked by the numbers themselves. This means that...
Good programming relies heavily on choosing an efficient algorithm for the task at hand and yet an average programmer hardly uses 50 pages worth of algorithms from the Cormen book in his/her career. Recently I started reading some CS books, long after completing my bachelors degree. One of the books is the Theory of Co...
Function Problem that finds the solution Given integer for $N$. Find $2$ integers distinct from $N$. (But, less than $N$) That have a product equal to $N$. This means we must exclude integers $1$ and $N$. An algorithm that is pseudo-polynomial N = 10 numbers = [] for a in range(2, N): numbers.append(a) for j...
So, this is kind of a long shot, but does anybody here familiar with cellular automata know what type this is? In the game, it starts as a flat pink/red and then becomes this over the course of a few seconds, and when like this it kinda just vibrates. I'm not sure what type or style of cellular automata this is though,...
I'm learning about NP Completeness, and I have come across the following problem The decision-version of the high-degree independent set (henceforth "HDIS") problem is stated as follows: Given a graph $G = (V, E)$ with $n$ vertices, does $G$ have an independent set of size $k$, consisting of vertices with degree at lea...
I have covered floating point (32 bit) conversion from float to decimal and decimal to float. I am happy with the theory and I have created a conversion tool in Excel VBA which works just fine following the IEEE754 , so I am happy with theory. Also happy with add, sub , mult , div of 32 bit floating point binary number...
MAX 2SAT is NP complete. Instead of satisfying the maximum number of clauses, I have a fully satisfiable 2SAT formula and I want to have the maximum number of positive literals in the assignment (such that all the clauses are satisfied, of course). What is the difficulty of this problem?
I am trying to plant a row in a garden. Certain plants are good for some plants and bad for others, and I am trying to find the best order of plants: most adjacent friends and no adjacent foes, as defined in this table(I have one of each): Num Vegetable Friends Foes 1 Watermelon 7,4,3 8,6 2 Tomat...
Sipser defines $TIME(t(n))$ as the set of all languages that are decidable by an $O(t(n))$ time TM and then $P = \bigcup_k TIME(n^k).$ However I see also many definitions like $$ P = \{ L \mid \text{There is a polynomial } p(n) \text{ and a TM which accepts each string } w\in L \text{ in max. } O(p(n)) \text{ steps.} \...
Is there any existing literature on applying the theory of Type-2 computability to the generation of random variates? By "random variate generator" I mean a computable function $f\colon\subseteq\{0,1\}^{\omega}\rightarrow D$ such that, if $p$ is a random draw from the standard (Cantor) measure on $\Sigma^{\omega}$, the...
The INDEPENDENT-SET problem is a well-known NP complete problem that takes in a graph $G$ and an integer $k$. It returns true if $G$ has an independent set of size $k$. An instance of the TFS (triangle-free-set) problem takes in a graph $G$ and an integer $k$ and it returns true iff $G$ has a subset of size $k$ whose i...
From Wikipedia: Each universal code, like each other self-delimiting (prefix) binary code, has its own "implied probability distribution" given by $ p(i) ={2}^{-\ell(i)} $ where $\ell(i)$ is the length of the $i$th codeword and $p(i)$ is the corresponding symbol's probability What is "implied probability"? Give...
This is possibly related to reflection and quoting but I don't want to assume anything beforehand. Here is my requirement. My typed lambda calculus (Curry style) is a simpler variant of Calculus of Constructions (CoC). Is it possible to write an analyzer (e.g., type checker) that inspects the runtime representation of ...
Is 3-SAT $\leq_{p}$ Primality? And/or is Primality $\leq_{p}$ 3-SAT? I think the answer is no and yes, respectively, but I'm not sure. Any help would be appreciated. Thank you.
My first thought is to make OPT(i, j), where i is n, and j is some condition on the column. But my experience with DP is from knapsack and weighted interval scheduling, but I'm unsure of how to approach this. Any ideas would be great.
I have been searching for a while now but couldn't find anything about this exact pair of functions with the little $\mathcal{o}$ notation. Given the functions $f(n) = 2^{n}$ and $g(n) = n!$ I am supposed to prove, or disprove, the following statement: $f(n) \in \mathcal{o}(g(n))$. I am fairly sure that it's true but n...
Suppose we have a universe of $u=|U|$ elements. We called a set of $H$ function $(U,m)$ order-preserving minimal perfect hash family (OPMPHF) if for every subset $M\subset U$ of size $m$ has at least one function $h\in H$ which is an over preserving minimal prefect hash. It is shown in [1,2] that for every $(U,m)...
In two separate projects, I have come across this problem and I still don't have a good solution for it, so I thought it was worth describing here. Consider the following problem: I have a set of strings that appear in a corpus with their counts. I would like to merge the counts into any substrings that also appear in ...
Per my understanding, the Rete algorithm and relational database engines essentially solve the same problem: answering to a certain query about a (large) set of relational facts. To me, the Rete algorithm is just more special-purpose along with a fancy caching procedure; I fail to see why it is superior to any of the e...
Can anyone give a model of the following LTL formula? $$ \Box\Diamond p \land \Box\Diamond q \land \lnot \Diamond (p \land q). $$ That is, we want each of $p$ and $q$ to hold infinitely often, but $p \land q$ should never hold.