instruction stringlengths 35 29.1k |
|---|
I already know that SAT and 3-SAT are NP-complete.
If in 3-SAT the Boolean expression should be divided to clauses,such that every clause contains at most (in the original problem it says exactly) three literals would it still be NP-complete?
I think the answer is yes but I'm not sure of my solution. I think the reduct... |
Baker, Gill, and Solovay has shown in their famous paper, that there are oracles $A$ and $B$ with $P^A = NP^A$ and $P^B \not= NP^B$. So, one can't solve the $P$ vs. $NP$ Problem
with methods like diagonalization alone.
To find the oracle $A$ is easy. But the construction of oracle $B$ is very
complicated in the paper. ... |
Is 4DM NP-complete?
An instance of 4DM consists of four disjoint sets X, Y, W and Z of size k, and a set Q of quadruples $Q = \{ (x, y, w, z) \mid x ∈ X, y ∈ Y, w ∈ W, z ∈ Z \}$
Question: Is there a subset $M ⊆ Q$ such that each of the elements of X, Y, W and Z is in exactly one quadruple in M?
The answer I found onlin... |
The following exercise is taken from Theoretical Computer Science by Atiba.
Use Rice's theorem to demonstrate that every decidable language is Turing reducible to some language that is already guaranteed to be decidable (for example, the language of strings that represent the primes).
My reasoning is the following. A... |
I'm interested in testing some Traveling Salesperson (TSP) greedy approximation algorithms for finding the shortest Hamiltonian path for very large graphs. Assume I can construct whatever graph I choose; how could I build a graph with a known shortest Hamiltonian path in polynomial time with edge distances that satisf... |
In the context of $P$ vs $NP$, I was taught the following during my CS education:
$P$ is the set of problems that can be solved in polynomial time
$NP$ is the set of problems for which solutions can be verified in polynomial time
Until $P$ vs $NP$ is solved, we only know that $P \subseteq NP$
However, I can also imag... |
When an operand encodes an address, and that address changes the "memory address register" and the word in memory being addressed, it seems like timing issues could be a problem. Examples, LDA instruction (load address from memory, load word from that address. )
Illustrated in timing diagram below.
How is this usually... |
I am searching for datasets to evaluate an algorithm designed for tasks such as node-classification (edge-prediction, etc.) on weighted and potentially directed graphs.
The Stanford Network Analysis Project (SNAP) repository only contains datasets containing temporal weighted graphs.
Are there standard datasets for suc... |
The stabbing number of a triangulated simple polygon P is the maximum number of diagonals intersected by any line segment interior to P. Give an algorithm that computes a convex polygon triangulation with stabbing number O(log n).
A convex polygon with n vertex is given, assuming n is even for simplicity. I've already ... |
Let's say that I have an NP-complete problem such as the Clique Problem. Let's also assume that I have a finte set of graphs. What is the complexity of counting Yes/No instances?
More specifically let's define a new decision problem that returns Yes on a finite set of graphs if the number of Yes instances is $\geq$ a c... |
I am trying to find an encoding function e:{0,1}^20→{0,1}^10 and a decoding function d:{0,1}^10→{0,1}^20. Goal is to find d and e so that maxBdH(d(e(B)),B) is as small as possible. Here, dH denotes the Hamming distance, and the maximum is taken over all possible bit arrays of length 20.
Haven't been able to find a suit... |
Let's say I have some problem $A \in \mathcal{NP}$, and the problem of certifying a solution of $A$ is a $\mathcal{P}$-complete problem (I'm considering $\leq_{logspace}$ reductions). Does this imply that $A$ is $\mathcal{NP}$-complete?
Example / Motivation: $\text{Circuit-SAT} \in \mathcal{NP}$, and certifying a solut... |
Why is it important to know if a program terminates or not? In particular, what are some consequences of a non-terminating program?
|
A boolean expression is valid if it is true for every valuation. The problem
$\text{BOOL-VAL}$ asks whether a given boolean expression is valid. As the question suggests I need to show that $\text{BOOL-VAL}$ is decidable in linear time. I have no idea how to go about proving this.
Is $\text{BOOL-VAL}$ the complement of... |
Given a definite program, how can I obtain its Herbrand base?
For instance, given the program $P$ below, what is its Herbrand base $B_P$?
$p(f(x)) \leftarrow p(x)$
$q(a) \leftarrow p(x)$
I know the definition of Herbrand base for a first-order language $L$, which relies on the concept of a Herbrand universe for $L$ (... |
I hope this question is not out of place here, but I am currently attempting to implement the problem(a reduction algorithm) stated in the Title. I included the steps I am following as of now and an existing attempt at implementation. Are there better/simpler ways to go about this?
Logic:
Create a non-deterministic Tur... |
"DeepMind has predicted the structure of almost every protein so far catalogued by science, cracking one of the grand challenges of biology in just 18 months thanks to an artificial intelligence called AlphaFold", reads newscientist.com.
If protein folding is supposedly an NP-complete problem, does DeepMind deserve a m... |
I am currently studying Computer Network, and I have some problems when encountered CSMA/CD, I can understand how it works, but I am struggling in understanding this graph, anyone can give me some help?
|
So I've been really confused about the act of flipping a kernel in image processing. Is there any intuitive way to think about it or does it only help computing efficiently and maintain the mathematical symmetry?
Do we necessarily flip a kernel in image processing? (say the kernel is not symmetrical). Do we only flip ... |
From the definition I know that regular grammar should be Left/Right Linear (ie it should have variable on Left/Right side of each production rules)
But, my question is why it is mandatory?
Can't we have "Grammar which has DFA(Determistic Finite Automata) or NFA be called Regular Grammar"?
S --> SaS | e (e is epsilon/n... |
My supposition is that this is was more or less an automatic designation based on the fact that Rule 110 requires an infinite "background tiling" of the 14-bit sequence 00010011011111, and since by convention a proper Turing-complete system is supposed to begin with a blank tape or its equivalent, this doesn't count.
I... |
If there is an algorithm with time complexity $O(n^{n/log(n)})$, is that already exponential time or still subexponential time?
It shouldn't be considered quasi-polynomial since the exponent is also depending on $n$, right?
|
I have the following predicate: $empty(r)\Leftrightarrow L(r)=\emptyset.$ Now I am given the following regular expressions where $e, f$ are any regular expression:
$r=\emptyset$
$r=\varepsilon$
$r=a:\forall\in\Sigma$
$r=e+f$
$r=ef$
$r=e^*$
Now I have to write a recursive definition for $empty(r)$. And this is the thi... |
I recognize that it has overwhelming consensus at this point, but from what I understand, it's still technically considered "probably true" instead of "definitely true".
If we go by their original definition, then it amounts to dealing with things that can be accomplished by "effective methods", meaning finite sets of ... |
I'm attempting to solve this problem:
Given an undirected connected graph $G=(V,E)$ with $\mathrm{weight}(e)>0$ for all $e \in E$, and a subset $S \subseteq V$, we define that a sub-graph $H=(V',E')$ of $G$ spans $S$ if $S \subseteq V'$ and $H$ is connected.
We define $H$ to be minimal spanning if the sum of all weight... |
What is the asymptotic complexity of doing a convolution of an unbounded Gaussian on an NxN input matrix $M$?
The naive approach is $O(n^4)$ ($R_{ij} = \sum_{k=1}^{n}\sum_{l=1}^{n}M_{kl}*g(\sqrt{(k-i)^2 + (l-j)^2})$; $O(n^2)$ work on each of $O(n^2)$ elements); there is a fairly trivial lower bound of $O(n^2)$ (at leas... |
Suppose we are given $m$ points on $\mathbb{R}^2$. Consider $n=1, 2, 3, \dotsc$; we want to cover the $m$ points with $n$ triangles (of any shape) while minimizing the total area of the $n$ triangles.
I first consider the case when $n=1$. We create a convex hull (a polygon) that contains all $m $ points. And by using l... |
Is there a reasonably accurate method of computing an FFT of logarithmically-represented input data (with a sign bit, that is $±2^{\text{double-precision value}}$)?
The naive method (convert to linear representation, do an ordinary FFT, and convert back to logarithmic representation) very quickly runs into overflow/und... |
I recently had this question answered on stack exchange:
if X is in NP but Y is not in NP then can X be reduced to Y?
The answer proposed a counter example using an element of complexity theory I had not given much thought to, specifically it was the problem
$A = \emptyset$
that is, $A$ is the empty problem (or contr... |
In the following let $\Sigma=\{0, 1\}$. I'll prove that every language over $\Sigma$ is recognizable.
Let $L\subseteq\Sigma^*$. Let $w_1,w_2,\ldots$ be the list of words in $L$. For every $i=1,2,\ldots$, let $M_i$ be the Turing machine that decides the language $\{w_i\}$, which trivially exists. Consider a Turing machi... |
I am currently working my way through Language Models are Few-Shot Learners
, the initial 75-page paper about GPT-3, the language learning model spawning off into ChatGTP.
In it, they mention several times that they are using 175 billion parameters, orders of magnitudes more than previous experiments by others. They sh... |
The language is: L1 = {w | n0(w) or n1(w) is prime}
n0 means number of 0s and n1 means number of 1s I can show a^n (n is prime) is not context-free. But I can't find any solution for this one.
|
Introduction
I have simple polylines as sequences of points. I need a triangulation with a configurable width. The goal is to get a 2D 'band' from the input polyline without self-intersections.
Description:
Input is a 2D point sequence {P1, ..., Pn} (Polyline) and a target width of the triangulated band. Output is the ... |
I am trying to create a circuit based on this truth table below:
can you describe how to make the circuit using only logic gates
In_1 In_2 In_3 Out
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
This is what I hav... |
I have a binary search tree of size $N$.
The tree is height balanced: difference of heights of a node's subtrees is no more than 1 (true for RB or AVL trees).
$K$ is the number of nodes that have a non-empty right subtree.
If the tree is intentionally created to minimize $K$, then what is $\min(K)$?
|
I have found two ways of applying dynamic programming to the coin change problem of finding the minimum number of coins from a given set of denominations to make a given sum. I wanted to know if one is better than the other:
def money_dyn1(m, coins):
a = [[float("+inf") for j in range(m + 1)] for i in range(len(coi... |
How can a 4-bit two's complement operation be implemented using boolean NOR gate?
I search lots of 4-bit two's complement videos and articals, but most of them are using XOR gate.
|
How can a 7 segment decoder operation be implemented using boolean NOR gate ONLY?
Question:
Here's my truth table and k-map:
Normal circuit diagram:
|
Let $M$ be a $m\times n$, in which rows and columns of $M$ are sorted in increasing.
Problem.
Find $k^{th}$ smallest number in $O(m\log(mn))$.
My attempts.
I merge all rows in a single sorted array in time $O(mn\log(mn))$ but this idea isn't efficient and I think there is a solution with running time $O(m\log(mn))$. Af... |
I came up with a thought experiment on the limits of artificial intelligence that I was hoping to get advice on how to solve as well as any recommendations for further reading that explain relevant concepts for solving/dissolving the thought experiment.
Suppose some superpowerful artificial intelligence A1 attempts to ... |
While working on a job distribution problem, I ended up hitting a graph problem that I can't seem to get a foothold on.
Consider a not-necessarily connected graph, like one shown below. Each step, we can delete up to N vertices from the graph, but can't delete two nodes if they are connected, only one or neither of the... |
How to solve this recurrence relation:
T(n) = R(n-1) + n log n
R(n) = T(n-1) + n^2
|
FOO = {M | The length of language that M accepts is less than infinity}
M: a turing machine
M such that |L(M)| is less than inifinity: a turing machine such that the length of the language that the machine accepts, is less than infinity.
For example, We have |M1| <3, it means this TM only accepts less than three wor... |
Suppose i have 3 coins: A, B, C. Each one of them have different value: a, b, c. And if want to exchange coins A for coins B, i need to be able to give exactly a units of currency A and get exactly b units of currency B in return.
The problem is to find how many different triples of coins i can have?
For example, if i ... |
By pumping lemma, we choose the word $w=a^{p^2}$ that the decomposing is $[a^sa^ta^{p-s-t}]^p$
such that $u=a^s,v^i=a^t,x=a^{p-s-t}$
$[a^sa^{it}a^{p-s-t}]^p=[a^{p+it-t}]^p$
We choose i=p+1,we get $ [a^{(1+t)p}]^p $ $=a^{(1+t)p^{2}}$
we see that the power $(1+t)p^{2}$ has 4 dividers thus doesn't belong to the Language L... |
I'm Nestor Mermoz Thea. I have two definition over the Directed strong pseudoforest and Directed weak pseudoforest that I don't really well understand.
Directed weak pseudoforest: A directed weak pseudoforest is a digraph, in which every weakly connected component contains at most one directed cycle.
The class of all d... |
I know the Independent set problem is NP-complete. But could there be a more efficient way to count the exact number of different independent sets in an arbitrary, given graph?
|
I was trying to figure out how I can perform multiplication of 2 big integers using FFT and convolutions, I ran into the following article:
http://numbers.computation.free.fr/Constants/Algorithms/fft.html
I understand the main points behind the algorithm but I can't understand this part:
2.3 More on the complexity of... |
I've been thinking about this for a day now,can someone help me ?
what language does S->aaSbb|SS|epslion make?
|
The Valeriepieris Circle is a circle within which it is supposed that the majority of the World's population lives. I'm interested in general-case and average-case algorithms for finding such a circle.
I'm aware that this can be done in $O(nm)$ and perhaps $O(n + m)$ where $n
$ is the number of pixels and
$m$ is the nu... |
I am studying theoretical computer science using the book "Foundations of Logic Programming" by J. W. Loyd. I am in the part about declarative semantics of definite programs.
In the book, if $P$ is a definite program, we denote by $B_P$ the Herbrand base of $P$ and we define $T_P$ as:
Definition. Let $P$ be a definite... |
Hey guys,
Got a tricky question here.
I need to determine if this TM will ever halt on a empty word "".
Seems like it will halt but I can't proof it.
Can anyone help?
|
Given $m$ sorted arrays $A_1,A_2,\dots,A_m$, also $\mid A_i\mid=n$ for each $i=1,2,\dots,m$. How we can compute $k^{th}$ smallest number in union of $A_i$s (i.e. $\cup_{i=1}^nA_i$) in at most $O(m\log mn)$?
$I.$ If I use Minheap to find $k^{th}$ element, th running time will be $O(m+k\log mn)$, so that $k$ can be $O(nm... |
What would be an example of an algorithm that's in O(f(n)), but not in Θ(f(n))?
The only thing I could think of, is an algorithm that behaves differently for different problem sizes, such as an algorithm that performs n operations for even problem sizes and n^2 operations for odd problem sizes. Such algorithms are rare... |
I have the following problem. Imagine a fully connected undirected graph, and I wish to calculate the optimal route for a traveller across that graph. Each vertice can only be visited once or not at all. Each vertex visited gives a positive payoff. However, each edge has a negative cost associated with its distance. Th... |
So I've been trying to understand endianess for the past couple of days but I'm not sure if I'm overthinking this or not and I don't have anyone I can ask to confirm things.
Here is how I look at things.. Say you have a defined value which represents the amount of pebbles there are in my city.
Decimal: 1193046
Hex: 0... |
I have a set of sets, for example
{
{1, 2, 3},
{1, 2},
{2},
{2, 4}
}
I want to find all sets which are not subsets of another set. For example, {2} and {1, 2} are both subsets of {1, 2, 3}, so my answer would just be {1, 2, 3} and {2, 4}. Let's call these "max sets".
There is a clear brute-force solution to this, ... |
Echo state networks are theoretically equivalent to DFAs/NFAs, but how would you use an ESN to parse a regular language? Would you just feed many different input strings, some from the language and some not, and then train it to output one or zero to indicate whether the string belongs to the language?
|
I need to write recursive function in pseudocode for n-th number term of $a_n=n!+2^n$. Whole code should be contained in one function with $n$ as function argument.
|
I am having troubles in understanding why this proof is done like that.
Why do we need to make a reduction to Ld which isn't even in RE to disprove Lu being rec?
And why does the book (Automata Theory, Languages and computation by Hopcroft, Motwani, ullman) constructs a machine for Ld to get a contradiction?
This is th... |
Let's say we have a NFA such as follows:
We know it's equivalent DFA is follows, after minimization:
We know that when converting from NFA to DFA, the resultant DFA would have around 2^( number of states in NFA ). This is where I get a bit confused: Should we consider the "dead state" of NFA when converting to DFA. B... |
I am reading Michael Sipser's "Theory of Computation" 2nd edition, chapter 1 , Topic "Non determinism" ( Section 1.2 )
Let's use this E-NFA as an example
My question is, do we transition along "epsilon transition" before reading any input or after reading any input?
assume input is "a"
Case 1: Before reading any input... |
Possibly related to this. Let $T$ be the text and $n$ be the length of the pattern. I understand that if substrings of $T$ are interpreted as base-$d$ numbers where $d$ is the alphabet's size, then for all suitable $k$:
$$T[k+1\text{..}k+n] = (T[k\text{..}k+n−1] − T[k]\cdot d^{n-1})\cdot d + T[k+n]$$
What I don't under... |
I don't think it's a CFL, but I'm having a hard time using the pumping lemma to prove this. Is there any way I can use homomorphism? Maybe h(a)= a, h(b) = lambda...
If the pumping lemma is more appropriate then maybe...
let m = constant of pumping lemma for some string w = a^nb^k
let w =xyz such that |xy|<=m and |y|>=1... |
For a project I'm working on, I need to generate some data to test the Gzip compressor, and I wrote my own implementation of Markov chain for it, and it's a 2-level nested one.
But when I generate data using my script and feed it to Gzip, it always - without exception - expands the data, as if there's no redundancy in ... |
I have no idea how to approach this question... How would I go about proving or disproving this? any explanation is appreciated.
|
If we think of the algorithmic problem of doing a convolution of two arrays, it turns out that converting them to the frequency domain first and then doing an element-wise product is equivalent. And this leads to an efficient algorithm where we invoke the FFT to go to the frequency domain efficiently (in $O(n \log(n))$... |
To my knowledge, in block-structured programming languages, there are 2, maybe 3 main ways of delimiting a block.
Using start and end tokens, this can be brackets or reserved words etc
Using indentation, like python, which uses the offside rule to delimit blocks
Using prefix notation for control structures, like lisp/... |
I'm working on the implementation of a cantor set on a 2-dimensional plane. It looks like this. Honestly, There is the obvious algorithm for the cantor set, but it includes a recursive method call. Unfortunately, My environment(Houdini vex) does not support recursive function calls, so I have to design the algorithm wi... |
I have the following problem:
Given a context-free grammar $\mathcal{G}$ and a finite state automaton $\mathcal{A}$, where both are over the alphabet $\Sigma=\{0, 1\}$. Is it decidable whether $L(\mathcal{G})=L(\mathcal{A})$?
I assume this is undecidable, since I already know the following fact:
It is undecidable wh... |
Problem
A time based followship is defined as a person changing to a new job, and there is an existing employee there in the new company whom he used to work together. In this case, the old guy gets 1 follow.
Challenge
I wrote some simulation code, but the complexity is quadratic and already taking a few minutes for 10... |
I have 2 arrays, A and B, which each contain the same N elements, but in a different order. (A different permutation)
There are also no duplicates in A and B.
I'm trying to devise an algorithm which generates a series of moves, which changes A into B.
A move means to move one element in an array to another position (no... |
I am studying theoretical computer science using Ayala's book "Fundamentos da Programação Lógica e Funcional" (the book is written in Portuguese), but the part I am studying right now is based on Lloyd's book "Foundations of Logic Programming".
I am currently in the part about definite programs, trying to solve the fol... |
This question deals with how to find the maximum matching in a tree. I understood the answers, but for one part.
Choose a root arbitrarily. For each subtree, calculate the maximum matching within the subtree, as well the maximum matching within the subtree that doesn't touch the root of the subtree. You can think of i... |
I apologize in advance for asking this, since I'm sure this site is flooded by amateurs like me asking about P and NP. If there's a better platform to ask this on, please let me know, but this question has always bothered me.
Suppose you have a perfect binary tree of depth $d$. Each node contains a boolean. Of the $2^{... |
I have had a somewhat hard time trying to understand how ChatGPT can "solve" some tasks that cannot be entirely cast as language-model-based rephrasing of textual subsets of the internet directed by a textual query.
For example, ChatGPT seems to be able to do calculations, even if not always appropriately used, execute... |
In a directed graph $G=(V,E)$ we denote a vertex $s\in V$ to be a 'source' if there exists in $G$ a path from $s$ to all other vertices $u \in V$.
The problem asks for an efficient algorithm to return the 'source', in case there isnt any, return false.
I've been able to come up with a naive approach to his problem:
$\f... |
Can someone help with an example of a function such that $f(m ,n)$:
$f(m ,n)$ takes 2 parameters $(m, n); \ m, n \in \mathbb{Z^+}$
The optimal running time to compute is $C(|m|^{|n|})$ in the worst case, where $|n|$ and $|m|$ is the size (number of bits) of $n$ and $m$ respectively.
The value of $f(m, n)$ is dependent... |
(Diestel, Graph Theory) Corollary 1.5.2: Every tree has an enumeration of the vertices $\{v_1, v_2\ldots v_n\}$ such that each vertex $v_i$, with $i\geq 2$, has a unique neighbour in $\{v_1, v_2\ldots v_{i-1}\}$.
I am wondering if there is an efficient algorithm that could produce such an enumeration in $O(n)$.
|
This was one of my exam questions and the answer is apparently no.
Can someone explain why because I don't understand.
|
I have a number of agents and tasks. In my case, the agents and the tasks have time constraints: so agent1 loves doing task1, but task1 must be done at 10am or 11am, and agent1 is only available after 1130am, also, task1 and task2 can happen at the same time, but the cost increases if so.
Is there a way to introduce d... |
I want to compare two trees:
I will consider the trees equal if they are:
Isomeric-i.e have the same structure.
Nodes in both trees have the same values but the order of the children nodes are not necessarily the same.
A picture is worth a thousand words:
eg:
A) B) C) D)
... |
I have a graph of vertices and connected edges as shown in the image below.
I have a function that iterates from every single vertex and finds closed loops in order to find all polygons in the graph.
Here is an example of my graph which has found all the polygons in the graph:
Now if i add a new segment (seen in red)
... |
I am trying to learn about approximation algorithms. In some research papers, it is mentioned about the absolute approximation ratio. what does the absolute approximation ratio mean? is it different from the asymptotic approximation ratio?
if there is any resource that might help to understand more about this, please l... |
I am trying to understand the difference b/w functional and decisional problems. The core as I understand is this:
Functional Problems: Given an input $x$ we calculate some function $f(x)=y$ over it.
Decisional Problems: Given inputs we output YES or NO depending on some logic or algorithm.
As far as I have read a func... |
I have an algorithm that recursively connects together pairs of nodes into new nodes. It looks like the Huffman code algorithm, except that a node can be re-used after it has been part of a merge. The result is a graph where each node has two parents, but can have any amount of children.
Is there a term for such a grap... |
This is a paragraph from the book CLRS:
What we need is known as an optimal binary search tree. Formally, we are
given a sequence $K = (k_1, k_2, ..., k_n)$ of $n$ distinct keys in sorted order (so that
$k_1 < k_2 < ... < k_n$), and we wish to build a binary search tree from these keys.
For each key $k_i$, we have a p... |
As a side-project, I had the idea to write some kind of an algorithm that would evaluate all participations in our weekly Pub quiz, to then calculate the average strength of the participants.
This is the information that I have available:
The final score of the group
All members of the group for a particular week
As ... |
Lets take an example of the range of N=32 bits
2^32 = 4294967296
00000000000000000000000000000000
00000000000000000000000000000001
00000000000000000000000000000010
00000000000000000000000000000011
...
11111111111111111111111111111100
11111111111111111111111111111101
11111111111111111111111111111110
1111111111111111111... |
How can I update values in Binary Search Tree without affecting its properties (all the nodes in the left subtree have values that are less than the value of the root node and all the nodes of the right subtree have values that are greater than the value of the root node).
I tried deleting and inserting the new Value, ... |
I want to prove this language $L=\{a^nb^{n^2+n}:n\in\Bbb N\}$ to be nonregular by the pumping lemma. This is my attempt, is this a correct way of doing it?
Let's suppose $L$ is regular. Let $s = a^kb^{k^2+k}$ such that $k \geq 0$ as a pumping length. So we have $s \in L$ and $|s| \geq k$.
Then, by the pumping lemma, ... |
I have an optimization problem and I am wondering if there is a better way to solve it than using a naïve brute force method. I have a number of tasks T that must be completed, and a number of agents A to do work in parallel to one another. For this, T > A.
What I would like to do is write a program to figure out the o... |
I want to prove (or disprove) the following conjecture:
Let $\Sigma$ be a finite alphabet, and let $L \subseteq \Sigma^*$
satisfy that there are no $v, w \in L$ such that $v$ is a proper
substring of $w$. Then $L$ is finite.
I have the intuition that this is true, haven't been able to find a counter example, but am u... |
I need a data structure/algorithm to efficiently retrieve borders and update changes.
There may be many (unconnected) regions of the same color. The shape of regions changes frequently over time and pixels may be randomly inserted - although most changes happen along the borders.
In this case, a pixel borders another i... |
I proved this language $L = a^nb^nc^m; n,m \geq 0$ is not regular the following way:
Let $L \cap a^*b^* = a^nb^n$
We know that $a^nb^n$ is not regular, and $a^*b^*$ is regular. Thus, if $L$ is regular, then $a^nb^n$ is too, but since the latter is not, $L$ is not. Is that safe to have as a proof?
|
Consider the language definition:
$L = \{<M>| M$ is a DFA and $M$ accepts some string of the form $ww^{r}$ for some $w\in \Sigma^{*}\}$
The language $L$ is :
A) Regular
B) Context-free but not regular
C) Recursive but not context-free
D) Recursive enumerable but not recursive
Solution provided:
Is to create a product m... |
Let's assume that $L_1 = a^nb^{2n}$ and $L_2 = a^na^{2n}$, knowing that $L_1$ is not regular, and $L_2$ is. We also know that regular languages are closed under intersection and union, and complement. What can we say about $L_3 = L_1^\complement$ and $L_4 = L_2^ \complement$?
It seems correct to say $L_4$ is regular, b... |
I want to prove this language $a^nb^m; 0 \leq n< 3m+2$ to be not regular by the pumping lemma. This is my attempt, is this a correct way of doing it?
Let's suppose $L$ is regular. Let $s = a^{3k+1}b^{k}$ such that $k \geq 0$ as a pumping length. So we have $s \in L$ and $|s| \geq k$.
Then, by the pumping lemma, $\exis... |
The question of the relationship between Kolmogorov complexity and data compression is rather difficult.
However, at the heuristic level, the complexity of an object and the rate of its compression by known algorithms are related.
I used the built-in function Compress[] of Mathematica to estimate the compression ratio ... |
GAP is a computer algebra system (CAS) that Wikipedia tells me is written in C, a procedural programming language. Does this mean we can say GAP's language is procedural? Or is this characterization a misunderstanding of what a CAS is, and what programming paradigms are?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.