instruction stringlengths 35 29.1k |
|---|
I cannot understand how to prove if a certain property of a Turing Machine M is decidable or not.
For example, if a have this:
(1.1) "M always halts within 100 steps"
or this
(1.2) "M recognizes all words with an ‘a’ in them"
what do I do to prove if it's decidable or not? I know I should use reduction or diagonalizati... |
I can not find the appropriate variable to change the second part $n^2\mathrm{log}^2n$.
|
I am creating some charts for elevation v distance data.
The original source of the data is GPX files and from them I have extracted...
The total route distance (km) and each point along the route as [lat, long, elevation, distFromStart]
The chart plots distanceFromStart (X-axis) v elevation (Y-axis).
The routes can be... |
My question is similar to this one. I was wondering if a PDA exists, that accepts any words containing a's, b's and c's in a random order, where the total amount of a's is higher than the amount of the b's and higher than the amount of c's, so for example the word "abcacba" would be accepted.
|
In a few different places ( http://www.ams.org/journals/mcom/2004-73-246/S0025-5718-03-01539-4/S0025-5718-03-01539-4.pdf and https://books.google.com/books?id=qYYKBwAAQBAJ&pg=PA21&lpg=PA21&dq=np-hard+completing+hadamard+matrix&source=bl&ots=8sKv9bAtc8&sig=ITZSmtD2p2xr6Q4RDqhbQQk0NDI&hl=en&sa=X&ved=2ahUKEwiotuLdvfzdAhWB... |
How to find the depth of a concurrency bug
The below program runs on two separate threads and shares the variable x. Variables t1 and t2 are local to their threads. The program has a concurrency bug in it.
Bug: Any time both threads perform a read before they write we loose an update to x.
Thread 1
1. t1=x
2. t1=t1+... |
We have followed the official code of the Graph trend filtering (GTF) https://arxiv.org/abs/1410.7690, and modified the code with Ford Fulkerson Algorithm (FFA) instead of parametric maxflow. The parametric maxflow and the FFA have the same residual capacities.
We also implemented the push-relabel algorithm, but the r... |
Consider a function $f(n)$ whose definition requires one to compute $f(1),f(2),..f(n-1)$ in order to evaluate $f(n)$. Suppose that some algorithm to compute $f(n)$ has time complexity that is given by the recurrence: $T(n) = n + T(1) + T(2) +...+ T(n-1)$. This is $O(2^{n})$.
One can use dynamic programming to store t... |
I have done absolutely everything that i could to try to understand this algorithm. I did NOT want to go on without understanding it completely even though I know it might only be a single problem in the midterm and I think I might have already burned myself out anyways. I even performed the algorithm by hand, which di... |
I've an issue stated as follows:
We have 10000 jobs to do, each with some length $l_i$ and weight
(importance) $w_i$. Our goal is to arrange the schedule of doing these
jobs (in other words, the order of doing jobs) in such way that
minimizes the weighted sum of completion times
For this, I'm using the ratio gr... |
Is there any known $NP$-complete problem which hardness proof is non-constructive.
A constructive $NP$-completeness proof is a proof that $L_1\leq_p L_2$ by a reduction $r$ and from the argument therein, one can extract two polynomial-time algorithms $f$ and $g$ such that:
For every instance $x\in L_1$, given a certif... |
By "subsets of $PSPACE$" I am referring to classes like $SPACE(n^k)$ for some constant $k$ (e.g. $k = 42$).
Under the union, intersection, and concatenation operations, such subset is apparently closed.
For the Kleene star and polynomial-time reduction, I am not so sure. Here's what I have tried:
To show that $PSPACE$... |
I am relatively new to computer science. There,s been something that i have been thinking now that i am studying how to make actual compilers. We are past the days of programming with binary and assembly language( granted its still around and in use. correct me if i am wrong ). We are told that high level languages mad... |
Wikipedia says:
a radix tree is a data structure that represents a space-optimized trie (prefix tree) in which each node that is the only child is merged with its parent.
Now they are situations where the parent of the child represent a valid key in the data set like this example:
from this answer. Obviously you c... |
This code depends on agda-stdlib:
{-# OPTIONS --without-K #-}
open import Data.Nat
open import Data.Bool
open import Relation.Binary.PropositionalEquality
-- this code doesn't check, cannot match e with refl
why : (e : Bool ≡ Bool) -> ℕ
why refl = zero
but-why : (e : 1 ≡ 1) -> ℕ
but-why refl = zero
I know K-rule me... |
I was going through the following slides and I wanted to show the following:
$$ \lambda x. x \equiv_{\alpha} \lambda y . y$$
formally. They define a an $\alpha$-conversion on page 15 as follows:
$$ \lambda x . E = \lambda z.(E[x \leftarrow z])$$
however, I wasn't sure how to formally show the statement I am trying to s... |
I have a question about the details of microprogramming and hard wiring in CPU architecture.
in hardwiring, we write a code the compiler translates it to the ISA. then ISA is run in the hardware.
in microprogramming, we write a code the compiler translates it to the ISA(which is much more complicated than the ISA in ha... |
I would like to know if my understanding of this is correct:
The question asks to show that the Big-Oh of the following function is $O(n\log(n))$
$$
\log(n^n + n)
$$
I think the first step is to play with the expression so:
$$
\log(n^n + n) = \log(n(n^{n-1}+1)) = \log(n) + \log(n^{n-1}+1)
$$
However, I don't know what ... |
I am trying to find all the combination of options trades that make the highest profit. Each trade has a maximum profit and maximum loss. I have a list of maximum losses e.g. [5298, 1100, 500]. Each number corresponds to a trade. The combination of maximum losses must be under the money I have in my account, for exampl... |
Suppose we have a simple undirected graph $G(V,E)$, where $V$ and $E$ are the set of vertices and edges respectively. we denote $d(v)$ as the degree of a vertex $v \in V$. I am interested to find closed form or a tight bound of the following quantity
$$
D = \sum_{e=\{u,v\} \in E} \frac{1}{d(u)+d(v)}
$$
For example, s... |
Say I have a dynamic array of the proper length $n$. A sort pivot is given.
I run the sort algorithm, wait, and get $j$ unbalanced pivots. Is the time complexity $O(n\log n)$ or has it destabilized to quadratic in the best case? I believe that it will be useful to use recurrences to model each scenario, but not sure ho... |
I'm coding something... weird, and I'm running into some constraint satisfaction and graph theory problems, which are fields I'm not too experienced in. Here's the problem:
I start out with this directed acyclic graph:
The values describe the range that the edge lengths are allowed to be. So the edge B->E can't be s... |
I am having a hard time understanding the quick sort partition operation.
I understand what partition is supposed to do, I just don't understand how partition does it. Specifically, I don't understand how the two subarrays (q-1, q+1) are constructed.
I have looked at various other SE articles, such as:
How does Hoare... |
For $k \in \mathbb N$, we define $Q(k)$ as follows:
$Q(k): $ let $x, y \in \mathbb N$ and $x$ is a multiple of $3$ and $k = x + y$, then $FUN(x, y)$ terminates and returns $x + y$
I will prove $Q(k)$ using induction
Base Case: let $k = 0 \to iff (x = 0, y = 0)$
By line 1, 2, 5, $FUN(x, y)$ terminates and returns $0 + ... |
Let $P(a,L)$ remove every $a$ in $L$, for example
$$ P(a,\{ab,aab,aaab,bba\}) = \{b,bb\}. $$
How to show that if $L$ is a regular language then $P(a, L)$ is also a regular language?
My attempt:
If $L$ is regular then $P(a, L)$ is regular. Namely, let $D = (Q,Σ,δ,q_0,F)$ be a DFA for $L$.
Assume every state in $L$ is ... |
If we want to write to write a C code, to check if halting problem halts on a given input, how it will be ? I tried this code as shown below but stuck
int main(int argc, char * argv[])
{
if(argc < 2){ printf("Please input an executable and its input enclosed in double quotes\n"); exit(0);}
//and here argv[1] has the ... |
I am a bit confused on how to reduce a problem. I'll give an example:
Let's say there is a problem called HALTEMPTY and we know it is undecidable.
$HALTEMPTY_{TM} = \{\langle M\rangle \mid M \text{ is a Turing Machine that halts on input } \varepsilon\}$
The problem we are reducing to is
$HALT_{TM} = \{\langle M,w\... |
A diameter-decreasing planted clique in an undirected graph $G(V,E)$ is a set of vertices $\mathcal{C}\subseteq V$ such that if we add all the missing edges between any pair of vertices in $\mathcal{C}$ to turn it into a clique, then the diameter of the obtained graph $G'$ is at most $2$.
Diameter-decreasing Planted Cl... |
I am a master computer science student, and I am interested in both geometry and complexity theory.
So I would like to know what is the relations between discrete geometry, computer graphics, and complexity theory ?
I know the answer partially but I would like to have a clear answer since I do like to work on these fi... |
Hopcroft says it is a finite nonempty set of symbols.
$\varepsilon$ (empty string) is not an ordinary symbol.
$\mathbb{N}$ is not finite.
So, no to both?
On the other hand, I do not see why $\{\varepsilon\}$ cannot be an alphabet. Its Kleene closure is $\{\varepsilon\}$, so a language over this alphabet can be either $... |
Consider algorithms to find shortest paths in a graph. The grassfire algorithm has a complexity of O(|V|) where V is the number of nodes or vertices. The Dijkstra's algorithm has a complexity of O((|V| + |E|) * log(|V|)) where E is the number of edges. Compared to A star, the Dijkstra's does not rely on properties of a... |
In type theory, some inductively defined data types allow you to prove absurdity. For example
type Bad a = MkBad (Bad a -> a)
extract : Bad a -> a
extract val@(MkBad f) = f val
absurd : a
absurd = extract (MkBad extract)
Now, when you church encode this datatype it leads to
badChurch : Bad a -> (forall X. ((X -> a) ->... |
I'm working on an algorithm that takes an array of $N$ values and it will iterate through each of the values and in each of them iterate through the rest of the array to the right. So the first value will check $N-1$ positions, the next one will check $N-2$, etc
I'm a bit confused about the time complexity of my algori... |
I'm evaluating two different algorithms to choose one for my implementation, they just do calculations on top of arrays, get some input of $n$ elements, and produce some output of $m$ elements, and I'm looking for an opinion about which one will scale better.
The output they provide given the input is exactly the same ... |
I have a recurrence relation:
$$f(a,b) = \begin{cases}
1 & (a,b) = (0, 0)\\
1 & (a,b) = (a, 0)\\
0 & (a,b) = (0, b)\\
2a & (a,b) = (a,1)\\
f(a-1,b) + f(a-2, b-1) + f(a-1,b-1) & \mathrm{otherwise}
\end{cases}$$
Where the constraints: $1 \leq a \leq 10^9$ and $1 \leq b \leq 1000$. I tried using recursion to fin... |
I know they have different scoping:
data a (n : Set) : Set where
introA : a n
data b : Set -> Set where
introB : {n : Set} -> b n
That's not what I'm caring about. Are they different semantically?
|
I did lot of research on internet but couldn't get my answer. I want to know what is the difference between the word size and CPU architecture?
For eg.- I read that CPU of 32-bit architecture can address 2^32 memory locations. Now if we consider that one address points to a single byte, then it means we can have memory... |
I finally started working on my Master's thesis, and have a problem with literature sources.
My thesis is about distributed system built on top of custom library implementing actor model. But I can't find any good literature that goes deep into this side of distributed software. I've found quite a lot of literature tha... |
Consider function wa'' (need natural number definition, either in stdlib or Agda.Builtin.Nat):
postulate comm : ∀ m n -> m + n ≡ n + m
wa'' : ∀ m n -> wa (m + n) ≡ wa (n + m)
wa'' m n with comm n m
... | refl = { }0
The pattern matching on comm n m with refl fails. But if I add one more match:
wa'' : ∀ m n -> ... |
I need to find the fastest route passing in all vertices
Each vertex is a class.
I can choose the number of classes for semester.
Some classes have prerequisites (A and B need to be done one semester before C), so I can't do A, B and C at the same time.
Some classes (C in this case) have only in the second semester o... |
The kernel is $K(x,z) = \sum_{i=1}^D (x_i+z_i)$
My approach was trying to express $K = \phi(x)^T\phi(z) = (x_1 x_2 ... x_D \quad 1 1 ...1)(1 1 ...1\quad z_1 z_2 ... z_D )^T$ where $\phi$ is 2Dx1 and thus a Kernel.
The solution says:
K is not a kernel. Consider $x_1 = [1 \quad 0]^T \quad x_2 = [0 \quad 2]^T$. Their k... |
$NP\cap coNP$ is low for itself: $NP^{NP\cap coNP}\cap coNP^{NP\cap coNP}=NP\cap coNP$.
Going up to exponential realm, we are considering similarities of $NP\cap coNP$ to its exponential version $NEXP\cap coNEXP$.
By padding, we already have $$NEXP^{NP\cap coNP}\cap coNEXP^{NP\cap coNP}=NEXP\cap coNEXP$$
Two questions:... |
Consider the following C code:
for(int i=0; i<100000; i++) {
if (operation == 0) {
a[i] *= 2;
} else {
a[i] += 1;
}
}
Would a real compiler (GCC) be able to do this optimization? If so, what is it called/how is it found?
if (operation == 0) {
for(int i=0; i<100000; i++) {
... |
In CLRS 3rd edition P. No 86, the relation
$T(2^{n}) = 2T(2^{n/2}) + n$
is changed to
$S(n) = 2S(n/2) + n$
My first question is, why we can change any recurrence relation like this? And, how will the following relation
$T(2^{n}) = T(2^{n-1}) + 1$
be changed? Which change is correct?
$S(n) = S(n/2) + 1$
or... |
It's not completely incredible that electrons are accessible information storage units. So let's say there is a breakthrough and we suddenly have read/write access to every electron on the planet. They may each have a few GB of storage, and the "metadata" that keeps their integrity is negligible in size (and immutable,... |
How do I change the design to accept the given language, because I think my DFA can accept $001$ as well. Is that correct?
|
I got a question regarding the decidability of equivalence of two context free grammars:
Construct a Turing machine that decides whether $L(G) = L(H)$, where $G$ and $H$ are two context free grammars.
This question is taken from Sipser's book on theory of computation.
My current idea is given that $G$ and $H$ are CF... |
I have a following problem:
Given a set $S$ consisting $N$ triangles (possibly overlapping). Answer queries (online) of the form: given a point $P$ is there a triangle $T$ in $S$, such that $P$ lies inside $T$?
I am interested in solution (data structure) which:
$*$ Answer query faster than $O(N)$ (worst case)
$*$ Prep... |
In my searching, I've seen that if Church numerals are encoded in a dependently typed Lambda calculus, that we can't derive induction or that $0 \neq 1$.
I know that LF and the dependently typed Lambda calculus (from the Lambda cube) are often used to model logic, but any actual systems I've seen based on this augment... |
I came across this paper and attempting to go through the implementation of randomized selection algorithm on page 8.
Step 1 of the algorithm suggest to compute $s = PrefixSum(n_i, p)$. Where $p$ is the number of processes and $n_i$ starts simply as a number of elements in each process. Page 4 has a definition of paral... |
I've seen correctness proofs for other searching algorithms; however, for this particular algorithm: search in a row-wise and column wise sorted matrix, I'm not able to generate a proper proof.
The algorithm is
Let x = element we're trying to search for in the matrix,
e = current element we're processing in the... |
Admissions:
Yes, this is a homework assignment.
No, this is not me trying to outsource my homework to the internet.
I am honestly fazed by my teacher's explanation of the "basic operation", and the internet is not helpful either. I get lists that say what a basic operation can be (e.g. assignment, multiplication, com... |
Is it allowed to transit between two states $q$, $q'$ by more than one condition? Thank you in advance.
e.g. coming from state $q$, the conditions $(0,0,L)$ and $(1,0,L)$ would lead to the same state $q'$. Is this formally allowed?
|
As we know, the time complexity of $\gcd(x,y)$ is $O(\log \min(x,y))$ by using Euclidean algorithm. Now we fix a constant $n$ and consider the average time complexity of $\gcd(x,n)$.
Formally, let $f(x)$ be the number of divisions when calculating $\gcd(x,n)$. How to give a bound of $\frac 1 n \sum_{x=1}^n f(x)$?
I don... |
I wanted to ask if there is a way to use KMP (Knuth-Morris-Pratt) algorithm to find the longest palindromic prefix of a word.
I've seen this algorithm used for determining if a word is rotation of the other for example. We can concatenate first word with itself and look for a pattern which would be the second word (and... |
Let's say that an item is either a natural number or a list of items. Examples of items are:
1
[2]
[4, [3, 1], 3, 4]
A rule states that two items are equal. For example:
1 = 2
3 = [3, 1]
[4, 3] = [1, 5]
When using these example rules, we can transform [4, [3, 2]] into [4, [3, 1]] into [4, 3] into [1, 5] and we can ... |
Knuth's original attribute grammar paper (title: Semantics of Context-Free Languages) introduced three types of circularity. More specifically section "Testing for circularity" page 134-5 figures 3.1-3. I am wondering if it's possible someone would explain in simple terms the three types of circularities. I am very con... |
In Interactive Theorem Proving and Program Development the authors explain constraints on constructors of inductive types in Coq.
For inductive type $T$, a constructor must have the form $t_1 \rightarrow t_2 \rightarrow ... \rightarrow t_l \rightarrow T a_1 ... a_k$ where $k$ is the number of arguments of the inductive... |
The Problem:
I am currently analyzing a simple program that takes a file of length $n$, splits it into its individual words (seperated by white space) and adds those words to a set:
def file_word_set(name):
with open(name) as f:
res = set()
words = f.read().split()
res.update(words)
... |
$L = \{ w : w \in \{a, b\}^* \land |w|_a = |w|_b\}$ where $|w|_a$ means number of $a$ in string $w$.
I came up with this grammar:
$S \rightarrow aSb \ |\ bSa \ | \ \epsilon .$
Can someone please tell me what is wrong with it?
|
I am working on the following homework exercise:
Let $G = (V,E)$ be an undirected graph and $c: E \rightarrow \mathbb{R}$ it's cost function. Further let $T = (V,E')$ be a spanning tree in G.
I need to show the equivalence of the following statements:
$T$ is a MST.
For all $e = \{x,y\} \in E \setminus E'$ holds: No ed... |
So I know assembly is so big and it seems learning assembly is like learning high level programming, you don't need to learn them all, you can learn couple and this will be enough.
The thing is with high-level language it is easier to grasp and implement in your life. But I am having hard time with assembly, I learned ... |
When defining the query complexity of exact learning for a concept $c$ (considered as a function from $\{0,1\}^n \mapsto \{0,1\}$) in a concept class $\mathcal{C}$, we often come across the following definitions leading to query complexity theorems (see R.Servedio and S.Gortler, Equivalences and Separations between Qua... |
I am looking for the right transducer which allows to translate a sequence of literals into a sequence of same literals (or a subset of them) in arbitrary order.
For example: ABC => CAB, which, with simple production rules:
A->a, B->b, C->c, results into output: cab.
I am not sure if the pushdown automata is enough to... |
Do we know any function which has same quantum and classical time complexity (bounded error), or at least same upper bound? Of course, let's rule out trivial functions like the constant function, and may be assume the time complexity of the desired function be at least polynomial in input size.
|
$$L = \{w\mid w\text{ contains a substring of form }yy\text{, where }y\text{ is any non-empty string}\}.$$ Is this language regular? We do not know what $y$ looks like in advance. And why is this language regular or not regular?
|
In Chapter 3 of Mining of Massive Datasets, the basis of locality sensitive hashing is explained. They notably mention simhash for the cosine distance, where random hyperplanes are generated, and for each hyperplane, the projection of the vector to be hashed onto the hyperplane's normal is used for hashing the vector. ... |
Here is a GNFA I made from an NFA.
I'm unsure how to treat the node of b(a∪b)* (the first node after the start node and the one below it). Since it doesn't lead to any goal state, do I disregard it in when I generate the regular expression?
|
Consider a simple algorithm to find the maximum element of an array containing integers. We just loop through the array, storing the maximum found so far and updating it whenever an element larger than the existing maximum is encountered.
This algorithm is often considered to have $O(N)$ complexity. But doesn't accessi... |
This is a homework question, I don't want an actual answer, but rather guidance on how to obtain the correct answer. The question is as follows:
In class we saw universal hashing as the solution to processing N elements in the range {0,1,...u-1}, arriving
one at a time. Using universal hashing we can get O(1) processi... |
In the following image
The author refers to an overall running time linear to |E|. But the author then says this is at most O(n^2). This seems contradictory because O(n^2) is quadratic time. Did the author mean to write something else? Or am I misunderstanding something?
EDIT!: My question is: What does the author me... |
I am reading about Boolean Satisfiability Problem and Nondeterministic Algorithms, in the latter defination it says :
In computational complexity theory, nondeterministic algorithms are ones that, at every possible step, can allow for multiple continuations $...$ These algorithms do not arrive at a solution for every... |
I am trying to simplify the following equation and I am getting stuck on a line and I can't cut it down any further. I'm not sure if certain 'moves' are legal or not.
F(A,B,C,D) = A'B'C' +ACD + A’BCD + A’BC’ + ABC + AB’CD'
After regrouping I got:
A'(B'C' + BCD + BC') + A(CD + BC + B'CD')
I thought right after this you'... |
The question is the following:
Construct a CFG for $L_2 = \{w \in \{0, 1\}^* \mid w = w^R\text{ and the number of 1’s in $w$ is divisible by 3}\}$.
I can construct a CFG for $\{w \in \{0,1\}^* \mid w = w^R\}$ as follows
$$S → 1S1\mid 0S0\mid 0\mid 1\mid \epsilon$$
I don't understand how to make $w$ divisible by 3 in ... |
Claim: Let $G$ be a graph on $n$ nodes, where $n$ is an even number. If every node of $G$ has degree at least $n/2$, then $G$ is connected.
Decide whether the above claim is true or false, and give a proof of either the claim or a counter example.
I drew out a few examples and the claim seems to hold, and I cannot fi... |
This question is found at: https://www.geeksforgeeks.org/given-sorted-dictionary-find-precedence-characters/
Given a sorted dictionary (array of words) of an alien language, find order of characters in the language.
Examples:
Input: words[] = {"baa", "abcd", "abca", "cab", "cad"}
Output: Order of characters is 'b', 'd... |
Given the ambiguous CFG :
$ S \to 01S1\mid SS\mid\epsilon $
I came up with the following CFG which I think is unambiguous:
$S \to 01X \mid 011X$
$X \to 01X1 \mid \epsilon$
Is my CFG unambiguous and does it represent the same language?
|
By definition:
For a given function $g(n)$ we denote by $\Theta(g(n))$ the set functions
$\Theta(g(n))$ = $\{f(n):$ there exists positive constants $c_1, c_2$ and $n_0$ such that $0 \leq c_1g(n) \leq f(n) \leq c_2g(n)$ for all $n \geq n_0$ .$\}$
We say $6n^3 \neq \Theta(n^2)$ becuase if it was, then there would be:
\... |
So, I was learning Data Structures in Java on my own. And there was a "challenge question" in the book.
The question basically asked me to make a data structure that could store all the words in a novel, and then it would associate with the word, where it occurs (like line number and character count) and the frequency... |
What are the strengths and limitations of arrays? What considerations go into choosing an array over another data structure, or vice-versa?
|
Can we compute the edit distance between two strings of length $n$ in strongly sub-quadratic time, i.e., in time $O(n^{2−\epsilon})$ for some $\epsilon>0$?
|
My apologies if this question makes no sense. I am trying to find an algorithm that can solve a linear system of equations. Unlike most problems like this, this algorithm does not need to find a solution set that solves the entire set of equations. It only needs to solve the MOST number of these equations. For example,... |
Looking at the following tail recursive quicksort pseudocode
QuickSort(A[1, ..., n], lo, hi)
Input: An array A of n distinct integers, the lower index and the higher index
// For the first call lo = 1 and hi = n
Output: The array A in sorted order
If lo = hi return
// The array A is already sorted in... |
Suppose that I have a tree where each node is either of type A or type B.
Nodes of type A have outgoing edges only to nodes of type B and vice versa.
Is there a name/term for this kind of a tree?
A concrete example of such a tree would be the state tree of a 2 player game (like tic-tac-toe) which has alternating levels... |
Consider the following definitions
LIST:
$\overline{nil} \ \ \ \ \ \frac{l}{a \ l}$ $a \in A$
$A^* = \mu \widehat{LIST}, \ A^{\infty} = v \widehat{LIST}$
NAT:
$\overline{0} \ \ \ \ \ \frac{x}{s(x)}$
$ N = \mu \widehat{NAT}, \ N^{\infty} = v \widehat{NAT}$
Given those definitions I have to define a length function over... |
I am familiar with k-d trees being used to find nearest neighbors (NN) in 3-D euclidean space however in my particular case I am given a huge array of spherical coordinates. Due to accuracy complications as well as loss of information I cannot convert them to Cartesian coordinates. Then given these points in their sphe... |
I'm asked to find all equivalence classes of the language
$$L = \{0^n1^n: n \in \mathbb{N}_0 \}$$
where $\mathbb N_0$ is the set of natural numbers including $0$, i.e., $0, 1, 2, \cdots.$
We have the following definition:
$$(xR_Ly)\Leftrightarrow (\forall w\in \Sigma^* xw\in L \Leftrightarrow yw\in L)$$
As I understand... |
So I was going through the idea behind dynamic programming (memoization), and thought of this question.
Can a compiler convert any recursion into a table filling DP solution, of course given the hint(like some keyword or macro) from the programmer that the following recursive function can be solved with DP (so program... |
Our problem is:
Given a context-free grammar $G$ and a string $x$, decide whether $x\in L(G)$.
Is this language itself context-free?
|
The setting:
There's a cluster of $k$ computers (= nodes). For simplicity, assume their hardware is identical.
The network topology can be complicated, but let's simplify and assume it's a clique with fixed bandwidth B bits/time unit between each pair of nodes.
Each node has its own limited amount of memory, $M$.
The... |
Note: I have not studied theoretical computer science, so this may be a trivial question.
I am interested in the general question: what restrictions are put on a machine $m$ (boolean circuit, TM, ...), by the assumption that $m$ solves a certain problem or class of problems? The question I'm asking in this post is: Wha... |
When running a single-threaded application that is 'always busy', on a multi-core computer, modern operating systems will typically switch the process from one core to another from time to time. Even when the other cores are always idle.
Typically you can see 1 of 4 cores on a quad core processor at 100% load while the... |
I need to build a partial order tree of sets for analysis.
Where the order is defined as A <= B <=> for all x in A, y in B, x <= y.
I realized that if I pre-sort all the maximal and minimal elements of the sets, like this:
// A [1,3]
// B [2,4]
// C [3,5]
// D [6,7]
// E [8,9]
// F [10,11]
const input = [['A', 1], ['B'... |
I can compute this easily in the case that $xy < 2^{64}$. But I'm not sure how to do this if $xy \geq 2^{64}$.
I know that $\lfloor \frac{xy}{z} \rfloor = \frac{xy - (xy\ \text{mod} \ z)}{z}$, but I'm not sure where to go from there.
|
Suppose the set of linear inequalities $Ax\le b$, in which $A\in\mathbb{R}^{m\times n},x,b\in\mathbb{R}^n$ is given. Is it possible to determine in polynomial time with regard to $m$ and $n$ if there is a feasible solution that is $k$-sparse, i.e. there are only $k$-nonzero elements in $x$?
What about if we know an upp... |
I was trying to solve the recurrence relation in order to get a some big-O bound $$ B(n) = B(n-4) + \frac{1}{n} + \frac{5}{n^{2} + 6} + \frac{7n^{2}}{3n^{3} + 8}$$ by following the accepted answer here. I expanded which resulted in $$ B(n) = B(n-8) + \frac{1}{n-1} + \frac{5}{(n-1)^{2} + 6} + \frac{7(n-1)^{2}}{3(n-1)^{... |
A graph $G = (V,E)$ is called an almost tree if it is connected and has most $n + c$ edges where $n = |V|$ and $c$ is a small constant number. How would I go about designing an algorithm for a given almost tree graph $G$ with distinct edge weight costs that computes a minimum spanning tree of $G$ in time $O(n)$?
|
For which $c, d$ is $Gap2SAT[c, d]$ in $P$ (such that $0<c<d<1$)?
(I know if d=1 then for each c it will be in P, however with which c,d such that $0<c<d<1$ can I simply return YES?)
|
All the references about Pure Type Systems I know consider only systems that allow to recover natural deduction systems with additive rules. Is there any variant that allows it to recover natural deduction systems with multiplicative rules? Otherwise, is it just by tradition or by inclination that such a Pure Type Syst... |
I have the following two functions
$f(n) = n\sqrt n + n \log n$
$\log_{100} n$
And I need to classify them into the followings:
$O(n)$, and/or
$O(n^2)$, and/or
$O(n^3)$, and/or
$O(n^{1.5})$, and/or
$\omega(n)$, and/or
$o(n\log n)$ (small o)
$\theta(n^{1.5})$,
Regarding the $\theta(n^{1.5})$, I am grasping it's ide... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.