instruction stringlengths 35 29.1k |
|---|
Say we want to factor a large number.
Factoring it is in NP.
Verifying it is definitely in P.
However, how do we know that there is no other factors besides the one we found?
So it seems that verifying it isn't in NP either.
Now I am getting confused with NP definition here. I know that NP includes all P.
But then the... |
I have data like this.
[0 1 0 1 0]
[0 1 0 1 0 1 1]
[0 1 0 1 ]
[0 1 0 1 0 1 1 1 1 0]
...
I want to classify with Neural Network but my data different size . I can not delete or add more arbitaly data. It may make the result not correct. So, How to classification data different size ?
|
I am looking for some clues as to the type of algorithm/data structure or general field of CS to look into...
I have a collection of items that I would like to have a human subjectively compare such that I can derive some consistent dataset that can be queried for k nearest neighbours for a given item that is present i... |
I was asked in one of my homework tasks this next question and I'm not quite sure how to handle it:
Sort(w) is an operation which takes a string (w) from a given language and sorts the characters in an ascending order. Sort(L) is the outcome language of the operation Sort(w) on each and every string (w) in the language... |
Is it true that if SAT is in coNP then its also coNP-complete (because it is NP-complete)?
|
It is known that union of two context-free languages is also context-free.
But how about union of context-free and non-context-free languages?
|
I'm trying to understand the Cook-Levin theorem proof, as it attempts to create a polynomial-time reduction from any NP problem to SAT (as presented in the book by Michael Sipser).
Most requirements are absolutely clear, but I don't understand why the $\phi_{cell}$ formula is required.
Of course, a tableau with improp... |
Im studying a book called "Engineering a compiler" by Linda Torczon and Margaret Cooper. In the second chapter which discusses lexical analysis they mention three aproaches to writing a lexical analyser: 1. Table-driven, 2. Direct coded and 3. Hand coded.
My question is: how do hand coded lexers generally work ? Are th... |
Let define formula $\Phi%$ given in CNF and it's complement $\overline \Phi$.
$\Phi$ is satisfiable iff $\overline \Phi$ is not tautology and vice versa.
$\Phi$ can be converted to $\overline \Phi$ in polynomial time using following method:
Change all literals with non-literals and vice versa: $\forall i:x_i \Rightarr... |
I am working on an optimization problem.
Let's say we have a grid of bins where solid metal cubes could be placed. We have a number of colored metal cubes to be arranged in the bins.
Each of these cubes weighs 1kg. But the weight could change slightly over time due to natural phenomena like rusting and becomes 1kg + de... |
I am in need of an algorithm for a part of a game (a mod) I am making. I have abstracted the problem:
Given a 2D space with $N$ random points $p_1...p_n$, calculate the nearest neighbor of each of the points, where the distance is at most $C$.
Note that our list of points is unsorted, and that each point is an actual o... |
Why some books state that Primes is a NP problem if, as a decidibility problem, it can be solved in polynomial time?
A simple example:
A number can has its primality tested by dividing it by all numbers from 2 to \sqrt(n). It then takes at most \sqrt(n) operations to find if its prime.
After talking to colleagues, some... |
Lets consider the following language : $L = \{1w |w \in \Sigma^*\}$ (Alphabet is 0 and 1).
I know this language is regular, I just have to prove it now, the Problem here is the number of equivalence classes, I thought it would be:
$[1] = \{x|x $ starts with 1$\}$ and $[\epsilon] = \{x| x$ doesn't start 1$\}$.
But now... |
I am using N-Grams to predict future character input. For n+1, it performs really well.
I've been looking, but I have not been able to find any information on what the feasible maximum distance into the future N-Grams are capable of.
One way I could do this is to predict the next character (n+1) and then use that resul... |
How can I negate the following sentence:
For all words x from L with |x|>= n , exists decomposition x = uvw with |uv| <= n and |v| >= 1, so for all i >= 0 , is valid that u(v)^iw in L is.
|
Let's say I have an algorithm something like as follows:
1 eliminate stuff from a list called reactions
2 for each element in reactions:
3 if one thing is computable:
4 compute it
5 else:
6 eliminate element from reactions, GOTO 1
Can I change it too
1 eliminate stuff from a list called reactions
... |
Given $L_1$ and $L_2$ over some alphabet:
$L_1@L_2 = \{uv \mid u \in L_1 \land v \in L_2 \land |u|=|v|\}$
The question is: if $L_1$ is regular and $L_2$ is context-free, is $L_1@L_2$ context free?
I've been trying to disprove this but to no avail. So I've been thinking to prove this by buiding a PDA but I can't seem to... |
I was asked the next question in my homework assignment:
I just want to make sure that I fully understand what it is that's required of me.
Am I asked to find an algorithm which decides if the language that's accepted by the PDA is finite? And if not, then what is it? Any initial intuition?
**I don't need help with ans... |
I am reading an article related to streaming algorithms named "Turnstile streaming algorithms might as well be linear sketched" by Yi Li, Huy Nguyen and David Woodruff,
At some point they have a random algorithm (uses a tape of random bits) that solved a problem over $\mathbb Z_{|m|}^{n} = \{-m,..,m\}^n$ that succeeds ... |
Can you suggest me a good book with illustrative examples and problems with solutions for finite languages and automata theory?
I tried Hopcroft's but it has mostly theory and not many problems with solutions.
Thanks! :)
|
A partial function is one, that that is only defined on a part of its domain.
Haskell gives examples: https://wiki.haskell.org/Partial_functions
My end goal is to express types
$$
\prod_{D:\mathcal{U}} D
\qquad\qquad\qquad\qquad
\prod_{\mathcal{A}:\mathfrak{A}} \mathcal{L}(\mathcal{A})
$$
The first type should simply ... |
The lecture note by Jeff Erickson discusses "Evasive Graph Properties":
We call a graph property evasive if we have to look at all $\binom{n}{2}$ entries in the adjacent matrix to decide whether an (undirected) graph has that property.
As an example, it shows that connectivity is evasive.
I want to know: Is acyclici... |
Given functions $f, p, c$, a matrix $X$, and vectors $C,D,E$.
I want to maximize the multivariable function $f(X)$, where $X$ is a $p \times q$ binary matrix ($X_{ij}$ is 0 or 1). So, $p\cdot q$ variables. The function $f(X)$ is given by
$$ f(X) = \sum_j \sum_i C_{ij} X_{ij} - \sum_j p(X,j), $$
where $C$ is a matrix of... |
Given 2 polygons in a plane:
$A : ( (xa_1,ya_1), (xa_2,ya_2), ... (xa_n,ya_n) )$
$B : ( (xb_1,yb_1), (xb_2,yb_2), ... (xb_m,yb_m) )$
Is there a polynomial algorithm to compute a matching $M$ between the points in A and B, such that:
If $(xa_i,ya_i)$ is matched to $(xb_p,yb_p)$ and $(xa_k,ya_k)$ is matched to $(xb_r,yb... |
How much memory do we need to train a multilayer perceptron?
I've started to figure this out myself, but I'm stuck.
I have one-layer MLP. Each training example is a vector of 100 real numbers in float32. There are 1000 training examples. The hidden layer is 50 units. The output layer is 10 units.
Karpathy's excellent ... |
I'm trying to create a genetic algorithm to train neural networks (because I'm to bad at back-propagation), and it works well until generation 18, where the loss stops to decrease and gets constant. The loss gets from 112 to about 90 in 18 generations and almost doesn't change:
Here is the genetic algorithm (I think t... |
Consider a context-free grammar where all rules produce at most one non-terminal (i.e., there is at most one non-terminal on the right-hand side of a rule). What is the class of languages which are accepted by such a grammar?
If you like, we may assume that all rules are one of the following forms, where $V, V'$ denote... |
In Skip Lists: A Probabilistic Alternative to Balanced Trees by Pugh he suggests different strategies for choosing the level of an inserted node. One such strategy, called fix the dice, limits the level to our previous highest level plus one if a higher level was randomly chosen.
What are the practical implications of ... |
I have recently come to realize that a number of problems I had a few years ago trying to implement various mathematical theories in Java came down to the fact that the typing system in Java is not sufficiently strong to model all of Martin-Löf dependent type theory.
Prior to Java 5 and generics, the only type theory... |
Say I have a number 45
What are the factors of 45?
1, 3, 5, 9, 15, 45
Is there any other factors?
I know that if I want to find some non trivial factor of some number, say 45, I know it's in NP.
I can non deterministically choose some 2 numbers and verify that those 2 numbers are factors of my large number. Verifying i... |
I am solving a problem of planning a meal, where I need to fulfill requests such as "create a two-dish meal that MUST have at most 2g of fat, the first dish MUST have 400kcal and SHOULD have at least 10g of protein, and the second dish MUST have 100kcal" by returning a list of dishes from a predefined list. In other wo... |
I'm given $n$ numbers (let's say of some 100 bits or so). Is there a way to find a non-empty subset xor of these $n$ numbers which has the least Hamming weight (no. of set bits) in better than $O(2^n)$ complexity? I was thinking of some trie based implementation but don't think that will work at all. Would a dynamic pr... |
I'm wondering if there are any parallel algorithms whose runtime is not linearly dependent on processor count. (Assuming the problem-size remains constant for different processor counts)
For example, suppose p processors has a O(n^2) runtime and p+1 is O(n^1.5). To me, it seems if that were the case, you would just use... |
Given a sequence of numbers $l_1, \ldots, l_k$, I want to find for each $i$ the nearest numbers to the left and right of $l_i$ (if any) that are strictly smaller than $l_i$. Is it possible to do this in linear time?
|
A problem X is NP-hard if every problem in NP can be reduced to X. But every problem in NP has a polynomial time verification algorithm, so then does that not mean that I can also verify X in polynomial time because every NP problem is reducible to X? Can someone please explain or give an example.
|
Is there a finite state transducer which has a set of Unique Input/Output sequences such that, when the UIO sequences are concatenated together, the resulting string is shorter than its shortest preset distinguishing sequence, supposing that the finite state transducer has a preset distinguishing sequence?
|
I have a simple context free grammar $(\{A\}, \{(,)\}, R, A)$, which consists of this one production rule:
$A \rightarrow AA\, \vert\, (A)\, \vert\, \epsilon$
I believe this is ambiguous! For example, I can represent "()" like this:
I'm sure there are an infinite number of these. I've attempted to make the grammar un... |
This is task from the German IT contest ("Bundeswettbewerb Informatik"), but since the deadline is past, asking this question is no cheating.
Given a vertex-weighted, directed graph $G=(V, E)$ and values $c_v$, find a subset of nodes $V_{res}\subseteq V$ that maximizes $$\sum_{v \in V_{res}} c_v$$ subject to $$\forall ... |
It seems to me that the algorithm is over complicated.
It makes use of tables, buckets, and sorting, which all seem unnecessary.
I don't understand why I can't just fill between pairs of scan line intersections, ignoring vertices and edges with gradient 0.
My lecturer didn't provide the best notes on this algorithm, an... |
I want to prove the non deterministic space hierarchy theorem.
Let $f(n),g(n)\geq\log n$ be space constructible functions such that $f(n)=o(g(n))$, Prove:
$$NSPACE(f(n))\subsetneq NSPACE(g(n))$$
I feel that the standard way of constructing a TM that takes as an input a TM and simulates the machine on itself, then flip... |
I need help understanding why the two statements I have underlined with red are correct. I am confused as to how we can get $n + 1$.
And how $i \le n$ is true when it says $i < n$ in the while.
|
is it possible to rewrite the following sql statement
$\pi_{R.a,S.d} (\sigma_{R.b = "d" \land S.d \geq 100 \lor T.d \geq 200}((R\times S)\times T))$
?
My problem is, i dont know if it is possible to split $\sigma_{R.b = "d" \land S.d \geq 100 \lor T.d \geq 200}$ to $\sigma_{R.b = "d"} \land \sigma_{S.d \geq 100 \lor T.... |
I'm trying to come up with an argument of why shell sort should be used over insertion sort for an array of 10 elements. And I'm wondering if there is one at all. I know that insertion sort is more efficient for the mostly sorted array, but in all other cases the shell sort should be faster. Or there will no significan... |
apply1 : (a -> b) -> Foo a -> b
apply2 : (a -> b -> c) -> Bar a b -> c
apply3 : (a -> b -> c -> d) -> Baz a b c -> d
As you see there is a repeating pattern, we obtain a function and a data structure, then we apply that function and return its result...
Is it possible to abstract over this pattern... |
I want to approximate a Gaussian function as shown below
$$
e^{\frac{-\|x-c\|^2}{2\sigma^2}} \approx \sum_{i=1}^{N}\alpha(c,c_i)e^{\frac{-\|x-c_i\|^2}{2\sigma^2}} \forall x
$$
Here c, $\sigma$ and $c_i$ are known. Are there functions $\alpha(c,c_i)$ which gives a good approximation? The limitation I am facing is that I... |
Let's say $\sum_{n \ge 1} a_{n}x^n$ is generating function for regular language $L$. $a_{n}$ is number of words with length $n$.
Find an example of generating function which isn't correspond for any regular language.
My attempt : I use the fact for any regular language there is exists $n_{0}$ $\lambda_{i}$ and $p_{i}$... |
I have been asked to find a grammar that will generate the language $a^{n(n+1)/2}$, where $n\ge1$ as an exercise. Any idea on how to set up such grammar? Any help would be appreciated.
|
I'm simulating a procedure that assigns tasks to servers and want to estimate the average waiting time until a task is served (finds a free server).
This procedure runs periodically, thus every task that is rejected in a run can try in the next runs until it finds a free server.
The inter-arrival times of tasks follow ... |
Cryptographic security is usually proven against P/Poly adversaries as this encapsulates the possibility for someone to do heavy precomputation to be used later, eg. rainbow tables.
However actually finding this advice string is assumed very impractical for large instances, rendering the process generally infeasible.
S... |
I'm trying to prove that the language $L=\{a^nb^mc^k | k ≥ max (m,n) \}$ is not CF. I consider the word $\alpha = a^pb^pc^p = uvxyz$ and i break the proof to the following cases :
1) if $vxy = a^l, b^l$ or $a^kb^l$ for some $k,l \le p$ i pump the word up, so
$a^l+s, b^l+s, s > 0 : l+s<p => \alpha \notin L$
2) if $vxy$... |
I need to write a regular expression for all words over $\{a,b,c\}$ not containing $aaa$, $bbb$ or $ccc$. Will appreciate any help. Note: this is not homework.
|
In common ANN, nodes are based on a activation function, like a sigmoid or tanh or ReLU. Updates of synaptic weight are based on the derivative of this function.
When node are represented with spiking neurons, what does activation function become ? how updates of synaptic weight are done ?
|
From Wolfram:
A polynomial time algorithm is however known for planar graphs (Hopcroft and Tarjan 1973, Hopcroft and Wong 1974) and when the maximum vertex degree is bounded by a constant (Luks 1982; Skiena 1990, p. 181).
What are the running times of such algorithms, in terms of size of the graphs? What algorithms ... |
A boolean-valued monotonic function is defined in the set of positive integers, $\mathcal Z$.
$$f(n) = \begin{cases} 0, &n_{min}\le n < n\ast\\1, &n\ast\le n\le n_{max} \end{cases} ; n \in \mathcal Z $$
The goal is to search for $n\ast$. The bounds $n_{min}$ and $n_{max}$ are known apriori.
A salient property of $n\ast... |
I need to swap two integers using only integer addition and multiplication gates.
I can't subtract them. I'm dealing with a sorting network, so I need to compare and swap. The compare and swap operation swaps only if the integers being compared are in wrong order. I've to implement this operation using just integer add... |
$T(n) = 1+ \sum_{j=0}^{n-1} T(j)$
I've proved $2^n$ be the solution of this equation using induction. But is there any other way to find the solution? I just proved not solved.
|
How do we prove the correctness of this pseudo code by induction?
fastfib(integer n)
if n < 0 return 0;
else if n = 0 return 0;
else if n = 1 return 1;
else a ← 1; b ← 0;
for i from 2 to n do
t ← a; a ← a + b; b ← t;
return a;
end
|
I am trying to find the following:$$ \text{For a given TM M with initial empty tape is it possible to decide whether there} $$
$$\text{exists a constant K such that the head of M remains within the first K slots?} $$
I thought this was possible if you know $K$, since you could add the current configuration to a separa... |
I have a treap like the first image and I want to reach the second image to restore min heap order property. I can't understand which kinds of rotations have been done.
Image 1
Image 2
|
Input: Given sets $S_i \subseteq \{1,2,3,4,\cdots,n\}$ for $1 \leq i \leq n$.
Output: sets intersection with restriction (pick first set $S_1$. If $a \in S_1$ such that $a$ is the least element then do $S_1\cap S_a$. Next go to least element (say $b$) in $S_1\cap S_a$ and do $S_1\cap S_a \cap S_b$)
Finally I want to fi... |
Suppose we have a 2-layer neural network completely connected with $d^{(0)}$ input units, $d^{(1)}$ hidden units and $d^{(2)}$ output units. We consider the error function given by $J(w) = \frac{1}{2}\sum_{k=1}^{d^{(2)}}(t_k-c_k)^2$, where the vector $t = (t_1,\dots,t_{d^{(2)}})$ represents the labels and $z = (z_1,\do... |
Referring to Tim Roughgarden's Lecture Note - 2 (page 11) on CS261 at Stanford following statement and the para seem quite confusing.
Claim: d(f) never decreases during the execution of the Edmonds-Karp algorithm.
https://www.youtube.com/watch?v=uM06jHdIC70
Can anybody shed some lights on it?
Suppose the Edmonds-Karp... |
I understand that we can approximate solutions to Integer Quadratic Programming optimization problems containing just a positive semi definite matrix, as outlined here (i.e. the Q matrix):
https://learning-modules.mit.edu/service/materials/groups/116310/files/c33fb8f4-417a-46b2-9772-7c44b8912290/link?errorRedirect=/mat... |
Design a data structure for holding numbers in two sets:
Init - initiate the DS with two empty sets. O(1)
Insert(a,S) - insert number a to set S (S could be X or Y). O(log(n)). (n is the total number of numbers in the DS)
Find - find a number a in the DS such that the number of numbers in X that are smaller than a equa... |
I want to prove that no PSPACE-complete problem is in NL using the space hierarchy theorem. What I want to say is this :
From the time hierarchy theorem I know that for every $t(n)$ there exists a language that is decidable in $O(t(n))$ space but not in $o(t(n))$ space. Then I want to assume that there exists $A \in PS... |
I have several questions that do no make sense for me.
First Question:
A stack can be implemented with an array A[0..N-1] and a variable pos. The push and pop operations are defined by the following code.
push (x)
A[pos] <- x
pos <- pos – 1
end push
pop ( )
pos <- pos + 1
return A[pos]
end pop
Which of the... |
You are given functions $f$ and $g$ such that $f(n)=O(g(n))$. Show that $f(n)\log_2(f(n)^c)=O(g(n)\log_2(g(n)))$. (Here $c$ is some positive constant.) You should assume that $f$ and $g$ are nondecreasing and always bigger than 1.
My solution: There exists $c_1$ such that $f \leq c_1 g$. Note that all $\log$ function... |
I am dealing with a standard MIPS architecture. If I have a branch instruction, for instance, beq, I know the results of the comparison in execute. However, the branching logic is actually in memory stage. Hence, doesn't that mean that I am technically losing 3 cycles(if the branch is taken) since the correct instructi... |
I know that bit-wise operations are so fast on modern processors, because they can operate on 32 or 64 bits on parallel, so bit-wise operations take only one clock cycle. However addition is a complex operation that consists of at least one and possibly up to a dozen bit-wise operations, so I naturally thought it will ... |
Let's say I have a function that consists solely of floating-point operations where the last operation rounds the computed value to a predefined number of digits. And I feed this function with a range of floats.
How do I conclude - just by looking at the decimals of the operand(s), and the structure of the code / seque... |
What does the following symbols or expression mean?
|
The standard algorithm to generate hashes of files which are downloaded is MD5. For example, when ISO files of Linux distributions are offered most of the time they also give the MD5 sum so that you can check if an error happened while downloading the file.
I'm aware of the fact that MD5 should not be used for password... |
I'm reading several papers about different broadcast algorithms. Most of them are designed for crash stop model but they also consider contamination scenarios.
For example for a Causal Atomic Broadcast when a faulty process
fails to delivers messages in order and then starts broadcasting other
messages based on i... |
I know that there is an inherent limit to how much you can compress data using lossless compression.
Basically, the only thing lossless compression can do is reduce dependencies between symbols, remove repetitions, and so on, so that the result looks more like completely random data rather than what we usually see.
Fr... |
I'm creating a semantic analyzer with type inference. For the basics I've got a type variable and a type construct with name and a list of types.
I want to support overloading and I know that Haskell uses something called type-classes. So if I understand correctly, when I call an overloaded function 'foo', I give multi... |
Given a undirected graph $G=(V,E)$,find a shortest circuit(it ends at the same point it starts) which through every edges at least once.As we all know,we can easily solve it with Edmond's algorithm which has a complexity of $O(|V|^3)$
If we assume that the weight of each edge is 1,and $|V|=O(|E|)$,is there a fast way t... |
I'm trying to understand the definition of program analysis on Wikipedia:
Program analysis is the process of automatically analyzing the behavior of computer programs regarding a property such as correctness, robustness, safety and liveness.
What is the meaning of "automatic" here?
Are parsers static analysis tools, ... |
I have come across algorithms that can create a BST if any two of the 3 traversals are given (there would be three different algorithms for the 3 combinations)
This is an example
I was wondering, is it guaranteed that a tree generated would be unique? Or rather, can multiple trees be generated satisfying the two traver... |
I'm having some issues constructing a transition diagram of a deterministic Turing machine for $L = \{0^i1^j2^j3^k \ | \ i = j + k\}$
The point where I get stuck is how I should make sure that $i = j + k$
My thoughts:
My thought was to initially do something similar to do something including an addition turing machine... |
Say beauty pageants are judged based on 3 criteria: 1) Appearance 2) Personality 3) Talent. A contestant $C$ will beat another contestant $C'$ if she gets higher scores in ALL THREE of the criteria.
There are $n$ girls competing. Contestant $C_i$ is "Model Material" if $C_i$ is not beat by any other contestant $C_j$. ... |
I need to write a sorting algorithm which will sort an array $A[1..n]$, $1 \le i \le n$ such that $A[i] \in \{1,2,..,n^5 \}$, all numbers are positive integers in $\Theta (n)$ time.
The solution must use some combination of radix/counting/bucket sort and possibly select algorithm, it can't use any advanced concepts o... |
I think I understand pumping lemma for regular and context free languages, but there is this one, which I have no idea if it is regular or context free or not context free.
$L = \{vwwx : v,w,x \in \{0,1\}^* \wedge w\neq \epsilon\}$ - I think it may be regular, because I think that this is language, which accepts set of... |
First, some context: I'm reading this blog post by Andrej Bauer.
So, I stumbled in these terms: "observational equivalence" and "contextual equivalence".
I know almost nothing about operational semantics ... I know it gives meaning for terms by it's reduction to normal form, if I'm not wrong.
Extensional equality says ... |
I have recently been involved in a discussion with someone who doesn't accept that lossless compression is possible, even in principle. This person considers himself to be technically literate, and an expert in his field of audio engineering.
I and several others have patiently tried to explain how lossless compression... |
I got riddled by the following problem: Wikipedia states (without citation)
Cryptography, for example, relies on certain problems being difficult. A constructive and efficient solution[Note 1] to an NP-complete problem such as 3-SAT would break most existing cryptosystems including:
[...]
Exactly how efficient a solu... |
Consider the following optimization problem:
Given $n\leq 10^3$ vectors $v_i\in\mathbb{R}^2$, all of which are small, i.e., $\|v_i\| \leq 1$, find a subset $S$ of them that minimizes
$ \| w + \sum_{i\in S} v_i \|^2$, where $w$ is a fixed known vector.
I know that this can be reduced to an unconstrained 0-1 quadrat... |
I am debugging an FFT. My FFT uses complex numbers in polar form, $(r,\theta)$.
I am trying to establish that it works, with a unit test. My real values are all correct, after a polynomial multiplication...
However, I pad out my polynomials to a power of two with complex zeros, and when the multiplication is compl... |
I'm not sure if cs.stackexchange.com is correct place to ask this question but it looks like most relevant.
On the job interview I was asked a question: lets say we have a very large file, containing a lot of lines with strings. And lets say that one line is a "document". We are building service which takes some string... |
I'm learning about the Savitch's theorem, and while the construction proof is straightforward, I still don't understand one part about it.
The proof I'm talking about is the same as is currently on Wikipedia. It starts by describing a function - let's call it CAN_YIELD(start, end, limit) for now.
It is then said that ... |
Consider a three word machine instruction
ADD A[R0], @B
The first operand (destination) “A[R0]” uses indexed addressing mode with R0 as the index register. The second operand (source) “@B” uses indirect addressing mode. A and B are memory addresses residing at the second and third words, respectively. The first word of... |
It is pretty hard for me to understand, how binary representation of number may be context free. This language $L=\{bin(n)bin(n+1)^R : n \geq 0\}$ is context free.
Here, at 1.b, is a PDA which describes this language, so it is context free. I've tried to construct a context free grammar for this one, but I have no idea... |
An article called The Derivative of a Regular Type is its Type of One-Hole Contexts shows that the "zipper" of a type—its one hole contexts—follow the differentiation rules in type algebra.
We have:
\begin{align}
\partial_x x &\mapsto 1 \\
\partial_x 0 &\mapsto 0 \\
\partial_x 1 &\mapsto 0 \\
\partial_x (S + T) &\mapst... |
I’m trying to figure out if what I’m doing would classify as Information Retrieval. According to this Thread:
Information retrieval is based on a query - you specify what information you need and it is returned in human understandable form.
I’ve a script that reads unstructured text (titles of books) and extracts nam... |
This is a follow-up question to the Why shuffling by picking random position in all array instead of a part is not correct. I understand if I pick random numbers from all the range for 4 numbers every time the distribution won't be uniform. That's why improved Fisher–Yates shuffle algorithm picks numbers from the small... |
I was recently given an assignment at university asking me to discuss the universal computational capability of Conway's Game of Life.
I'm not required to actually build up a Universal Turing machine in Life, but rather I'm supposed to provide a step-by-step explanation of universality of GoL (as well as the meaning of... |
I was revising Computer Science and I got these two doubts to which I've found contradictory answers on Google:
In a serial communication which bit is sent first?
When using a parity bit with ASCII is it set on the LSB or MSB?
Logically thinking I thought the answers should be 1- MSB first and 2 - set on LSB. Am I ri... |
Given:
graph with colored edges;
list of $\alpha$ colors;
list of $\epsilon$ colors;
clique size $k$.
Problem:
Do all edges colored in one of $\alpha$ colors are members of cliques with size $k$?
Isn't there an edge of some of $\epsilon$ color that is not contained in clique of size $k$?
Example:
Given some graph t... |
Here is the problem. We have N jars. Each jar can have any number of beans. These beans have to be distributed among C children. The resulting distribution should serve two goals Now
the number of beans that each child gets must be the same (+/- 1 when total number of beans is not a multiple of C)
each child to get a... |
In the scope of my scheduling research, the question has been raised on whether distance-preserving permutations can be constructed easily.
Suppose that our domain is the set of natural numbers up until $n$, that is: $D=\{1,2,...,n\}$ where $n\geq 1$.
A permutation $\pi$ is a distance-preserving permutation in my conte... |
The subset query problem is defined as:
Given a list D of size N where the entries are subsets of a universe with m elements, create a datastructure that detects for every query-set Q if there exists a set P in D so that Qis a subset of P
I was wondering what are the best known algorithms to solve this problem. I could... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.