instruction stringlengths 35 29.1k |
|---|
I have the following alphabet $\Sigma = \{0,\dots,9\}$ and the following language over $\Sigma \cup \{\#\}$:
$$L=\{\#w \ |\ w \in\Sigma^*,\sum_{i\geq1}w_i\ \text{is prime}\}\\\\$$
This language represents all numbers wich have a prime as digit sum. I now want to show that this language is not context free. I want to s... |
Can't understand how to apply pumping lemma to see if a language is context-free or not.
I tried to verify the context-free's pumping lemma, and the language seems to be not context-free but I can't understand if I'm correct. I tried writing all factorizations, but I don't know when I have to stop or if there's a way t... |
We know according to the pumping lemma if a language is regular, then a string already exists and it can be separated into 3 parts ( called decompositions ), 1 string can have multiple decompositions.
If we were to cross check this property with, basically prove for regular langauges, then we would need to prove it for... |
(Initially this question was on cstheory, but I was told cs would be a better fit, so posting it here.)
All other things being equal, which of the following languages would be more challenging to design a compiler and/or interpreter for? (If the answer would vary depending on whether one is designing a compiler or inte... |
Show that the following language or problem is not recursive:
$$
L=\{\langle M,w\rangle\mid \text{computation of TM } M \text{ on input } w \text{ uses all states of } M\}
$$
I was trying to prove it using reduction, but I cannot seem to find a language to reduce it to. I also tried it for the complement of L:
$$
\over... |
Seth Lloyd claims in this video that free will stems from our impossibility of determining how a system capable of self-reference will behave in the future (e.g. whether a human being will have chosen to drink tea or coffee in 5 minutes). He relates this to Gödel's incompleteness theorem in a way that seems completely ... |
Please note I don't use any of the "verifier" notation, I only concern definitions made with DTM and NTM .
Now there are two definitions of decidability:
1. A set (predicate) is decidable (solvable) iff exist a machine (DTM/NTM) M(x) that accepts iff x∈A, and rejects iff x∉A. i.e. if it halts correctly against all inpu... |
Can you please explain to me why the following is true?
Ιf 3SAT reduces to its complement then NP=coNP.
Thoughts:
3SAT is NP-complete so for every X in NP
$X \leq 3SAT$
$\overline {3SAT} $ is NP-complete so for every Y in coNP
$Y \leq \overline {3SAT} $
So,
$X \leq 3SAT \leq \overline {3SAT}$
But don't we have to also ... |
Consider $N$ points that are located on a 2D plane where the $i$-th point’s location is denoted as $(x_i, y_i)$.
Is there any efficient algorithm that can compute $d_i$ that is defined as the number of points with $x<x_i$ and $y<y_i$ for all $i$? In other words, we would like to count the number of points on the lower ... |
I am wondering if my solution is correct or I am on the right track. I have searched online and found a paper about Java type system being unsound but that doesn't really answer the progress and preservation issue.
Question:
Give a non-obvious problem in the language definition that would prevent “progress”
from being ... |
If we have a regular expression $R$, will $R$ describe only regular language $L$, but that language $L$ can have multiple different regular expressions such as $Q,W,A,S,D \ etc..$ describing it
Also, $R$ can be equivalent, in terms of describing $L$, to infinite regular expressions including $ Q,W,A,S,D \ etec..$
Is my... |
Let's say that we have a DFA, where the initial state was also the accept state. Meaning the DFA accepts the "empty string". Now, let's say that we convert the DFA to regular expression $R$, using Arden's Method ( my prefered method )
Now, the resultant expression looks something like $(R)^*$, which is obviously capabl... |
I have a sequence of integer tuples $t_1, t_2,..., t_N$ of different sizes in lexicographic order, e.g.:
$(1, 1), (1, 2), (1, 3, 5), (1, 3, 6), (1, 5), (3), (3, 2, 3), (3, 7), (3, 8, 1), ...$
sequence length is $N \le 10^9 \space (2^{30})$,
a tuple size bounded by $S, |t| \le S \le 32$,
$i$-th element of a tuple is bo... |
It's an exercise question from chapter 0 of Michael Sipser's book Introduction to the Theory of Computation.
e. The set containing the empty string
f. The set containing nothing at all
I guess the empty string is still something, which is not nothing. Would this be the difference?
|
I am doing an exercise related to maximizing Independent Set, I have $G = (V = \{v_1, . . . , v_n\}, E)$ as an undirected graph. This graph as $n!$ possible orderings for the vertices $V$.
If we pick any such orderings uniformly at random i.e. let $\sigma = (\sigma_1, . . . , \sigma_n)$ be such random ordering then con... |
Intuitively speaking, it would seem like the graph isomorphism problem (which might be $NP$-intermediate) should be $P$-hard. But maybe it's not? Or maybe it's an open question?
If it is indeed $P$-hard, how can that be shown/argued?
Doing some searching, I found the following statement in the Wikipedia article on the... |
I was wondering, in terms of complexity and "precision", what are the differences, if any, netween the computation of
$$2R \sin(\alpha)\cos(\alpha) \qquad \qquad \text{and} \qquad \qquad R\sin(2\alpha)$$
It's the same thing, for it is a goniometric identity. So are there differences in terms of order of complexity, com... |
I am a researcher starting to work on the field of parsing and recognition of languages.
As part of my background research, I am reading up on CYK. I understand that it requires the grammar to be in CNF. This however, is restrictive, as it forces the grammar to be restructured to remove $\epsilon$ rules from arbitrary ... |
I have N nodes, a node might have an undirected edge to other nodes, resulting in K connected components (K<=N, K unknown).
I can test if a given pair is connected. In each step in time, I can run N/2 such tests in parallel (a given node can be tested once per step). Each connected component is a cluster graph (it has... |
Why sometimes we would want to convert generic trees or forests into a binary tree? And what's the main principle behind this convertion?
|
Say you have a directed graph consisting of n nodes and containing edge weights. A starting node is also given. You want to begin your route at that node and visit each other node in the graph exactly once before returning to the starting node. Your goal is to take the route that has the smallest sum of edge weights po... |
I am having some difficulties understanding how the remove() operation works step by step with the splay tree. My tree looks like so:
2
/ \
1 13
/
10
/
9
/
5
now I want to remove(10) and get the following tree (9 is the previous item from in-order traversal, s... |
I heard in my lecture that there are non regular languages which meet the requirements for the pumping lemma for regular languages but I never actually saw one. Does anybody have an example?
|
Consider the geometric set cover problem https://en.wikipedia.org/wiki/Geometric_set_cover_problem.
The Wiki article says there is a simple greedy algorithm for the one-dimension case, what is the analysis of that?
Is there a constant approximation factor possible for the one-dimensional case if each of the sets in the... |
I see why ordinary Horn clauses (of the type Prolog might accept) are first order eg something like (with all variables universally quantified)
$$
P(x) \leftarrow Q_1(x),Q_2(x,y).\\
P(x) \leftarrow Q_2(x,y),P(y).\\
$$
(I'm using the conventional notation of upper case for constants and lower case for variables, rather ... |
Pierce's Types and Programming Languages has the following definition of terms:
$$S_0=\emptyset$$
$$S_{i+1} = \{true,false,0\} \cup \{succ(t), pred(t),iszero(t)|t \in S_i\} \cup\{if(t_1)then (t_2)else(t_3) |t_1,t_2,t_3\in S_i\}$$
So then that means this language has terms like $succ(false)$ and $if(succ(0))then(true)... |
Consider the geometric set cover problem https://en.wikipedia.org/wiki/Geometric_set_cover_problem.
The Wiki article says there is a simple greedy algorithm for the one-dimension case, what is the analysis of that?
I have already asked this question before: Geometric Set Cover in one dimension which was answered. I ask... |
This is a follow-up question to my previous question
I have been reading this post and it comes up with the following example showing how Java type system is unsound:
interface IFoo<T> {
Number foo(T t);
}
class Foo<T extends Number> implements IFoo<T> {
public Number foo(T t) { return t; }
}
Number bar(IFoo<St... |
Prove the $NP$-hardness of $CONNECTEDNESS$ - the problem of counting over an oriented graph $G$ and two vertices
$s$ and $t$ the number of subgraphs of $G$ in which from $s$ to $t$ can be traversed by an oriented path. Does the corresponding problem of recognition in $P$? If necessary, one can use the $NP$-hardness of ... |
Given any singly linked-list L storing n real keys, that is, each key in L belongs to
R, design an algorithm (either in words or in pseudocode) that computes the sum of the negative keys in L. What is
the running time of your algorithm, in the worst-case, using O notation?
|
About a Universal Computer, this wiki says:
A universal computer in a cellular automaton is a system that can compute anything that a Turing machine can compute (another term for this is Turing-complete). A cellular automaton in which such a system exists is called universal. A universal computer may be either infinit... |
My book(digital design and computer architecture ARM edition) explains loads and stores like this:
To perform a load or store, the processor must first translate the
virtual adress to a physical adress and then access the data at that
physical adress. The processor extracts the virtual page number from
the virtual adr... |
A naïve solution would be to first sort all sets, taking time $O(N n \log n)$. Then, for every possible pair of sets, check if one is a subset of the other, and if applicable remove the subset. This checking and removing can all be done in time $O(N^2 n)$. The total time complexity would thus be $O(N n \log n + N^2 n)$... |
As part of a hobby project I stubmled into the following question which has me stumped:
Given an undirected graph $G = (V, E)$ and an integer $k$, what is that smallest number of edges that need to be added to $E$ such that the new graph $G' = (V, E')$ has a complete induced subgraph of size $k$, and what vertices woul... |
What is the proof that STCON
(returns 1 if there is a path in the directed graph $G = (V,E)$ from $ s \in V$ to $t \in V$ and else, 0.
is indeed in NL? (Non-deterministic turing machines with logarithmic memory)
|
I have the following problem to solve:
Given a non-empty array A consisting of N integers, the task is to find the first unique number in the array. A unique number is defined as a number that occurs exactly once in the array. The desired output is the unique number with the lowest position in the array.
For example, c... |
Let $\varphi = \bigwedge C_k$, in which $C_k$ is a clause in X3SAT (exactly-one 3SAT or one-in-three 3SAT). That is, $C_k = (l_i \odot l_j \odot l_u)$ such that $l_i \in \{x_i, \overline{x}_i\}$ for any $i$. Then, $C_k$ is true iff exactly one of $\{l_i, l_j, l_u\}$ is true. Hence, if $C_k$ is true, then $[l_i \Rightar... |
General description
I have an optimization problem in which I need to schedule events and each of the events needs to be scheduled exactly once. The "cost" of scheduling one event depends on all of the events that have been scheduled before. So given a list of events $[e_1, e_2, ... e_n]$, the goal is to find an optima... |
I feel that choice should work great for proving non - regularity of the mentioned language.
If $L=\{ww|w \in \{0,1\}^*\}$ and we choose $s=0^p0^p$, meaning s is atleast as long as 'p'. Then we can decompose s as follows $x=empty \ string,\ y = 0^p, \ z = 0^p$
Then we can pump 'y' according to the rules of pumping lem... |
I want to be an OS developer. I can say I am a bit comfortable after i read few tutorial on x86 assembly.
But I see a lot detailed in intel manual, does an OS developer really need to study whole manual for its architecture.
Is there any alternative ?
Will I miss something important if only reading short tutorial rat... |
Suppose I have the following CFG that I would like to bring to CNF
S -> TA | bA | Ab | b
A -> Aa|a
T -> Ab
Then I have two options to get rid of the nonsolitary terminal a in Aa
1 - Make a new nonterminal K and introduce the rule
The grammar in this case becomes
K->a
S -> TA | bA | Ab | b
A -> AK|a
T -> Ab
2 - O... |
I'm trying to figure out a more efficient solution to the following problem.
Dataset: A set of arrays of key-value pairs (K, V). The arrays have varying lengths, and the keys are non-zero 16-bit unsigned integers.
Examples:
[(3, 100)]
[(1, 200), (1, 100), (2, 300)]
[(2, 200), (2, 300)]
Input: A fixed-length array of ke... |
I have the following regex that I'm trying to convert to a CFG: e|a(,a)* (e representing the empty state). Basically I want to match a comma-separated list (without a leading or trailing comma) or nothing at all. Here are some of my attempts:
S = A
A = e | a | a , A
This doesn't work, it matches ,a (leading comma).
S ... |
I have the following hash table with hashcodes being quadratic numbers.
Why do 0, 16, and 64 have different number of collisions when they map to the same number (line %16). Also how is it possible for 64 to have 6 collisions?
|
I am trying to address the following claim- "running prim algorithm on a disconnected undirected graph returns minimum spanning forest".
I thing that the claim may be false (i.e there might be an example of a disconnected undirected graph so that the prim algorithm doesn't return MSF) but I cannot think of such example... |
Given an undirected graph $G=(V,E)$, and vertex $v\in V$ and a number $k\in \mathbb{N}$, find an algorithm to find whether there exists a spanning tree of $G$ in which $v$ satisfies $d(v)=k$
I've narrowed the solution to 3 situations, in $G$: $d(v)<k , \\d(v)=k\\d(v)>k$
When $d(v)<k$, it is clear that there cannot exis... |
I need to prove that
$coNP \neq NTIME(n^2)$ using time hierarchy theorem.
as we know $DTIME(n^4)\subseteq P\subseteq coNP$
from time hierarchy theorem we can derive that $DTIME(n^4) \not \subseteq DTIME(n^2)$
therefore $DTIME(n^2) \neq coNP$
Also
as we know $NTIME(n^4)\subseteq NP$
from time hierarchy theorem we ca... |
Prove $PSPACE$-completeness of the language $READALLEXACT$ = $\{$$(M, x, 1^ s , t)$ | $A$ deterministic Turing machine $M$ on input $x$ reads all bits of the input in exactly $t$ steps and using no more than $s$ memory cells (consider that a bit is read if the machine head has ever been over it; after reading the inpu... |
I'm currently stuck showing $NP$-hardness of a problem of mine.
An instance of my problem (I call it (simple) pairwise $2$-Partitioning) is given by the following:
Given a set of tupels $B=\{(b_1,1),\ldots,(b_n,1)\}$, with $b_i\in\mathbb{N}_{>0}$.
Goal: A partition of $B$ into two subsets $S_1, S_2$ such that each ele... |
Is there a 2SAT instance of variables $(a,b,c,d,e,f,g)$ that has exactly the solution set $S=\{ (1,0,0,0,0,0,0),(0,1,0,0,0,0,0),(0,0,1,0,0,0,0),(1,1,0,1,0,0,0),(1,0,1,0,1,0,0),(0,1,1,0,0,1,0),(1,1,1,1,1,1,1) \}$? It sounds plausible, but other than enumeration, I can't seem to find a way to prove/disprove that it exist... |
Federal Information Processing Standard 186-4 appendix C.4 gives (without reference) an algorithm intended to test if a positive integer $C$ (which can be thousands bits) is a square:
Set $n$, such that $2^n>C\ge2^{(n-1)}$.
$m=\lceil n/2\rceil$.
$i=0$.
Select $X_0$, such that $2^m>X_0\ge2^{(m-1)}$.
Repeat
5.1 $i=i... |
I need to describe (even in words) an algorithm that gets a connected, undirected, weighted graph so that the weight of each edge is either 1,2 or 3; and returns MST of that graph is time complexity O(|V|+|E|).
I thought to take kruskal algorithm and change the sorting algorithm to be counting sort (O(|E|) instead of c... |
According to the theorem, if $L \in NP$, then $L$ can be determined by a deterministic Turing machine in exponential time.
So, are all languages determined in exponential time NP languages?
|
When i iterate $v$ and $x$ factorizations to see if a word is still in a language $L$, do i have to assume that $|v| = |x|$ always or could happen theirs lengths are different?.
I'm asking because i found a grammar for this language:
$L$ = { $a^nb^m, |n-m|$ is even } , so it should be context-free.
But if i try to app... |
Suppose that you had two trees.
Our goal is to convert the two trees into two integers such that two trees are the same if and only if the two integers are the same.
Suppose that we have a function named leaf_hash() which converts the leaves of the trees into integers such that for any two leaves x1 and x2, we have x1 ... |
Consider the notion of optimal implementation as follows. Suppose we have some algorithm $A$ whose execution for some problem of size $N$ requires $T(N)$ operations (e.g. arithmetic operations). A library optimally implements this algorithm when it executes a routine for implementing the algorithm for a problem of size... |
My algorithm takes a Java program as an input, modifies it to eliminate static attributes, and returns a new modified Java program without such attributes. What would be the soundness and completeness of this algorithm? Let's assume, the input program has $S$ static attributes and $N$ non-static ones. Let's also assume... |
Use the five-stage pipeline with forwarding unit.
add $t1, $t2, $t3
sw $t1, 0($t4)
In the above code, is the data hazard of t1 fixed by forwarding the correct t1 value from MEM stage to EXE stage?
Also, are there totally four forwarding paths, which are MEMtoEXE, WBtoEXE, MEMtoID, WBtoMEM, in pipeline?
It would be gra... |
In Strassen's algorithm, we calculate the time complexity based on n being the number of rows of the square matrix. Why don't we take n to be the total number of entries in the matrices (so if we were multiplying two 2x2 matrices, we would have n = 8 for the four entries in each matrix)?
Then, using the naïve method of... |
In the substitution method, if we find that, for instance, T(n) < dnlg(n) but only for some d that depends on n, then can we say that T(n) = o(nlg(n)) (little-oh) in some cases? For example, in this case: we may find that the condition T(n) <= dnlg(n) is only satisfied if d <= n or, conversely, n>=d. That would mean th... |
Is there a hashing function $f$ that for each input $x$ if $f(x) = y$, then $f(x \, || \, y) = y$? In other words, if we concatenate its output with the input, the result will not change.
Furthermore, is there a simple construction for such functions?
Example
Let $x =$ "hello" and $f(x) =$ "123". Then $f($"hello123"$) ... |
Is there a well-known algorithm for modular multiplication of floating-point numbers?
I would like to multiply some large angle in single precision (6-7 significant digits) and wrap it back to 360 degrees, without losing too many significant digits.
float r = fmodf(a * b, 360);
My current approach is to split the numb... |
Given a bipartite simple graph $G=(V,E)$, where $V=A\cup B$ and $A\cap B=\emptyset$, any edge in $E$ connects two vertices in $A$ and $B$, respectively. The maximum bipartite matching problem is to find the largest subset $E'\subseteq E$ such that no two edges in $E'$ share common vertices. We know that this can be add... |
On the internet, I am unable to find concrete definitions of these three types of file-systems. Can someone clearly explain the difference between these?
|
I have sequence of integers $a_1, a_2, .., a_n$,
let $S_a = \sum_{i=1}^{N}{a_i}$,
for any $k \in (0; 1)$ I need an algorthim to that maps every $a_i$ into another integer $b_i$ with 2 requirements:
$S_b = \sum_{i=1}^{N}{b_i}$ is as close as possible to $k \cdot S_a$, ideally $S_b = Round(k \cdot S_a)$
$b_i$ is as clos... |
$P$ is the set of all words of even length on {0,1}.
Hi, i tried using pumping lemma to see why $L$ isn't a context-free language, but there's a decomposition where none of all three properties is violated ($|v|$ and $|x|$ iterating factors on $c^n$.).
I know this doesn't mean it's context-free, but to be sure it is no... |
I was reading about the longest path problem and it is NP Complete.
What about the problem where we need to find a path of some exact length $K$. All edges are directed. We are also allowed to repeat edges and vertices and all weights are positive.
The reason is where ever I look they in the definition emphasize:
Simp... |
any reference on what kind of problem it is and what algorithm can solve this in $n^2\log n$?
for 5 as d, the numbers 4 and 3 and 0 would work. so i think there should be zero in the array.
maybe use naive approach($O(n^4)$) and memoize the raising to power 2 and adding up the results to decrease the running time?
|
Question Background
A finite-state machine can be defined as a 5-tuple as follows (Sipser, pg. 35):
The image below (taken from the Wikipedia article on combinational logic) seems to suggest that combinational logics can be used to define formal grammars that describe formal languages just the same as regular expressi... |
I came across this question when studying for an exam:
given a min-heap that has no prime numbers in it, is there an algorithm that can get and delete the minimum of that heap in O(log* n) ?
The answer simply said no because in this case we can sort an array in o(n log n) which we’ve learned isn’t possible without addi... |
I am a research scholar, and I currently work in parameterized algorithms. My current work involves proving that a problem is FPT for the parameter distance to clique. Although it is known that computing a distance to clique of size $k$ can be done in FPT time using a simple branching algorithm, I couldn't figure out h... |
I'm reading Nielsen and Chuang. On page 142 the integer factoring decision problem is introduced: The integer factorization problem can be reduced to a decision problem:
Given a composite integer m and l < m, does m have a non-trivial
factor less than l?
For a given witness x < l this problem can be checked in polynomi... |
We have a weighted and undirected graph.
I want to find the shortest path between two vertices with Dijkstra algorithm.
But in the path, the weight of the edges should be increased and decreased one by one.
For example, in the below graph, the answer is the third path:
My idea: Remove the paths that do not meet the co... |
I'm trying to solve this time complexity: $T(n) = 2T(n-2) + n$, but having some challenges addressing the $(-2)$ component. Any insights on this complexity?
Ended up with a section $[2^2\cdot1 + 2^3\cdot2 + 2^4\cdot3 + \ldots + 2^{k+1}\cdot k$. Does it follow any existing number series?
|
so this is the question , I have to minimize this DFA
this is How I did it
but when I checked for answers , this is what it was,
can someone please explain to me what mistake I made? I have been wondering about this for past 2 days
|
As the title states, we are given a bipartite undirected graph $G=(X\cup Y,E)$ such that every vertex $v\in V$ satisfies $d(v)=k$ for a constant $k$.
The general goal of the proof is to show that under these terms, the graph has a perfect matching (a subset of edges where all edges are disjoint in vertices, and the edg... |
Consider the Kadane's algorithm for finding maximum subarray within an array:
def max_subarray(numbers):
"""Find the largest sum of any contiguous subarray."""
best_sum = 0
current_sum = 0
for x in numbers:
current_sum = max(0, current_sum + x)
best_sum = max(best_sum, current_sum)
... |
I am a research scholar currently working in parameterized algorithms. I am studying the complexity of a problem (say $P$) for $\Delta_{10}$ graphs and was able to provide a reduction from a known NP-complete problem. Hence, i have that $P$ is NP-complete on $\Delta_{10}$ graphs. It is obvious that there is no FPT (fix... |
Suppose I would like to generate n clauses, in 3-CNF form, that would give a unique solution for m variables (m<n).
Example: for m=6, I've got {a,b,c,d,e,f} = 111010
How to generate these n 3-CNF clauses while minimizing this number of clauses (to avoid redundancies)?
What would be the minimum number of clauses to gene... |
I can’t understand How can dfa have more than one sink state? Isn’t it the same state? Maybe there is some examples
|
I have an array (of hundreds of numbers) and I need to sort them. In this case, I used Bubble Sort because of the better time complexity compared to other algorithms, $\Theta(n^2)$.
procedure bubbleSort(arr)
for i=0 to n-i-1
for j=0 to n-i-2
if arr[j] > arr[j+1]
S... |
My book(link) says that if the computer tries to access a virtual memory page that is on the hard-disc it loads that page into physical memory. But how does the computer keep track of which physical memory it should use? Does it look through the page table to find free physical memory?
|
I'm learning about (complexity-theoretic) pseudorandom number generators, and I have a pretty basic question about them that I couldn't find an answer to.
Let's say we have a PRG for $P$ that can fool any algorithm running over $n$ bits in time $poly(n)$ with seed length $O(\log^{10}(n))$. This would already be a break... |
Given a set S of numbers, min and max. Find all sebsets of numbers from S with a subset sum larger or equal to min and smaller or equal to max.
The following article says that there's an algorithm called ESS that solves this but I haven't been able to find the algorithm anywhere:
"Cached Iterative Weakening for Optimal... |
Given n points on the plane, it is a standard interview problem to find the line with the maximum points, which can be done in O(n^2) with pivoting + hashmaps or other method.
Question: Are there more efficient algorithms that runs in o(n^2) e.g. O(nlogn), solving:
(1) Find the line containing maximum number of points,... |
The upper bound of $n!$ is $O(n^n)$. But I am not getting a way to compute the lower bound of n!.
We can write $n! = n\times(n-1)\times(n-2)\times\dots\times 1$. I can easily put all the terms as 1. The lower bound will be $\Omega(1)$. But I am not convinced with this answer.
|
I need to divide numbers represented as digits in byte arrays with non standard amount of bytes. It maybe 5 bytes or 1 GB or more. Division should be done with numbers represented as byte arrays, without any conversions to numbers.
|
I am trying to understand "On the complexity of general context-free language parsing and recognition" by Walter L. Ruzzo. One of the results from the paper is about generating a parse tree when only a (blackbox) recognizer is given. Unfortunately, I am stuck at the sentence "Given recognizers for these languages, we c... |
Let's say we have the following context free grammar:
$S \rightarrow a \\ S \rightarrow SS$
And we do the following two "derivations" for the same string:
aaa: $S \rightarrow SS \rightarrow SSS \rightarrow aaa$
aaa: $S \rightarrow SS \rightarrow SSS \rightarrow aSS \rightarrow aaS \rightarrow aaa$
The difference betwe... |
I am trying to learn how to prove the runtime of a recurrence relation, particularly through induction. I was looking at this lecture PDF, and on the first page, the author writes this:
Recurrence: $T(1)=1$ and $T(n)=2 T(\lfloor n / 2\rfloor)+n$ for $n>1$. We guess that the solution is $T(n)=O(n \log n)$. So we must
p... |
There is a well-known Curry-Howard-Lambek correspondence between certain type systems, proof calculi and categories.
Some variants of Barendregt's pure type systems have the property of strong normalization, i.e. any term can be reduced to a normal form after a finite number of reduction steps, the other of them don't ... |
I am reading "Introduction to the Theory of Computation" 3rd edition ~ by Michael Sipser, page 113-114 - topic: "Context free languages, push down automata"
He states that the transition from one state to another would look as follows: "$a,b\rightarrow c$". But the way he states the usage confuses me
We write "$a,b \r... |
I saw a post on Reddit (https://www.reddit.com/r/math/comments/ci50d3/visualizing_mathematical_subjects/) that utilizes label propagation, Fruchterman-Reingold algorithm, and edge betweenness clustering to classify mathematical subjects based on papers in 2018 on arxiv.org.
In a math book, definitions and theorems are ... |
In the simply typed lambda calculus we have type algebra - types can be added, multiplied and exponentiated, where addition corresponds to the sum type, multiplication to the product type, and functions to the exponential type (where A -> B corresponds to B^A). Due to the commutativity and associativity of the sum type... |
Let's say, I have a set of cats $C = \{ a, b, c, ... \}$. Each cat has a tail. I can say, that the lengths of the tails of cats are denoted as $t_a$, $t_b$, etc. Otherwise, I can say that they are denoted as $t(a)$, $t(b)$, etc. Which option is preferable and when?
|
Is it so that for each virtual adress there exists an adress in the hard disk? But the hard disk can be larger than the virtual memory?
EDIT: Or can some virtual adresses always map to physical, and some map to hard drive which then is loaded to physical adresses?
|
Consider a truncated hexagonal grid, with some hexagons lit up, such as the one shown below:
Here the red hexagons are lit up while the dark gray hexagons are not lit up. The grid has buttons (small black circles) that flip the color of adjacent hexagons. There is a button at every node where three hexagons meet, and ... |
I am currently in the process of trying to understand the original proof of NP-completeness of SAT given in the seminal paper by Cook [COOK71] and have struggled with a few of the details of the proof of Theorem 1 presented in the paper. Specifically, Cook writes:
If a set S of strings is accepted by some nondetermini... |
Problem : Consider a random vector $v$ which is uniformly distributed over the sample space $S = \{v \in \mathbb{Z}^{n} : 1^Tv = a , v \ge 0\}$ . How to efficiently generate such random vector ?
note : I'm actually interested in $n=6,a=30$ .
Attempt : The size of the sample space [1] is the coefficient $c$ of $x^a$ in ... |
We define the set S as $\{(s_1, f_1), (s_2, f_2), ..., (s_i, f_i)\}$, where each $f_i$ is the frequency that $s_i$ is repeated in the multiset T. How many ways can we partition the multiset T into different partitions, where each partition includes distinct part/segments? A distinct part/segment includes distinct $s_i$... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.