instruction stringlengths 35 29.1k |
|---|
Given two strings how can you check if they are a permutation of each other using O(1) space? Modifying the strings is not allowed in any way.
Note: O(1) space in relation to both the string length AND the size of the alphabet.
|
if H is Pac learnable according to
Definition 3.1 (PAC Learnability) A hypothesis class H is PAC learnable
if there exist a function $m_H\colon(0,1)^2 \mapsto N$ and a learning algorithm with the
following property: For every $\varepsilon, \delta \in (0,1)$, for every distribution $D$ over $X$, and
for every lab... |
I am searching for 2 examples.
At the bottom I give definitions I am using.
An example for H that is PAC learnable (according to 3.1) but not Agnostic PAC learnable (according to 3.3). We learned that such should exist. I saw in another post a comment that 3.1 and 3.3 are equivalent but i can't comment there (permissi... |
In order to determine how much value employees provide to a company, I want to build a system that goes beyond basic math in terms of sorting said employees. I'm working with values like current salary, number of people working under them, and a value from 1-3 of how indispensable they are to the company. What method... |
Are there any closure properties which I can use to come up with a contradiction?
|
There is this case of concatenation that says (from wikipedia):
The initial state of N(s) is the initial state of the whole NFA. The final state of N(s) becomes the initial state of N(t). The final state of N(t) is the final state of the whole NFA.
My question is, does this mean that the final state of N(s) is linke... |
Suppose $X$ is a set of integers. I am interested in the algorithm which computes the number of ways to represent an integer $W$ as a sum of exactly $k$ elements from $X$. Is it possible to modify the standard knapsack algorithm so that it does the job? Thank you for your suggestions!
|
I have implemented Vitter algorithm thanks to the Wikipedia article. However I don't really understand how some parts of the algorithm make the algorithm more efficient:
IF (new p is sibling to NYT) THEN
leaf_to_increment = p
p = parent of p
Here I don't understand why is the condition neces... |
I have a graph as given below:
Let us assume one node as transmitter and another as receiver.
We need to transfer particles in every time slot constrained by maximum particles N and minimum 0. The combination of which particle in which time slot makes a code. I mean if 2 1 0 0 is a code that means that 2 particles i... |
Assuming that someone will find poly-time algorithm that statistically is wrong on ~1% of total (already runned) instances (which are very different), will it be a proof for $\mathsf{BPP = NP}$?
|
Let's say you are given a set with $V$ vectors and you are given a simple Euclidean distance metric $d(a,b)$ for $a, b \in V$. Then what would be the most efficient algorithm to build a subset $S$ of a desired size $k$ such that the sum of the distances between the elements of the subset is maximized?
In other words, h... |
I've been banging my head against the wall for the past two days and can't seem to come up with anything useful. The problem that needs to be solved is the following: I get an array of integers and I must return an array containing the elements that would give the maximum sum with the following condition: If I select a... |
I have a vector $v \in \mathbb{N}^k$ and a set of vectors $R \subset \mathbb{N}^k$, with $k \ll \left\vert R \right\vert $.
I would like to find a way to obtain all the possible bases of $\mathbb{N}^k$ taking $k$ elements from $R$.
The ultimate goal is to find a decomposition of $v$ over a subset $S = \left\{ r_1, r_2,... |
I'm looking for an algorithm for meshing parametric manifolds in a given range. To be specific, in n-dimensional space, the manifolds are given as $$x=e^{At}x_0$$ where $x_0$ are the solutions of a linear equation $$Fx=g$$
$x_0$ is an (n-2)-dimensional linear set. For example, in 4-dimenional space, $x_0$ is a 2d plane... |
This is my first question here and I hope you can help mt clarifying a doubt.
Basically, I'm studying shortest path algorithms, for instance Dijkstra, Bellman-Ford-Moore, and I came up with a doubt.
From what I understood, given a node of a graph, these algorithms calculate all the shortest paths to the other nodes. So... |
Supposing we had a quantum computer with a sufficient number of qubits, could we use it to do linear algebra faster than we could with a classical computer? What sort of speedup could we expect? Has anyone created a quantum algorithm for linear algebra, and what is it's running time? In theory, an operation such as mat... |
Given $N$ points in 2D plane, and each point has some value. Have to answer $Q$ queries of the form:
Given $x_1, x_2, y_1, y_2$, find sum of values of all points $(x,y)$ such that $x_1 \le x \le x_2$ and $y_1 \le y \le y_2$. $N$ and $Q$ are $\le 10^6$. Also it will be helpful if someone can provide implementation.
|
Given a Weighted Partial Max SAT problem (WPM-SAT) - are there generally used algorithms or techniques to generate 'approximate' solutions, which are
not necessarily optimal, but found faster than solving directly? The approximate solutions must satisfy the hard clauses.
Context
I have a series of very large (millions ... |
I have done code for the algorithm to obtain the Optimal Basis but as I calculate the optimal solution $Xb=B^{-1}b$, I only get the correct value for some of the variables. For some variables, $Xb_i$ is not equal to the $X_i$, where $X_i$ is the result of some LP solver, used in Megiddo's algorithm.
What can be the pos... |
What I want to achieve is to build a neural network with Keras which will have to stabilize
a quadcopter I've built. The network would have three inputs: pitch, roll, yaw, acceleration x, accel y and accel z and four outputs: pwm length for motor 1, 2, 3 and 4. The problem is that the length of the pwm wave needs to f... |
f[1](2, 3, 20) : 10011010
f[2](4, 20, 21) : 10101001
f[3](4, 20, 22) : 10010110
f[4](2, 4, 23) : 10011010
f[5](5, 23, 24) : 10101001
f[6](5, 21, 23) : 01101001
f[7](2, 5, 26) : 10011010
f[8](2, 3, 33) : 10101001
f[9](3, 22, 33) : 10000110
f[10](3, 21, 40) : 10100110
f[11](3, 21, 41) : 01101001
f[12](21, 41, 42) : 10101... |
Problem Statement
Let, $G(V,E)$ be a graph with a weight function $w(v)$ defined for all vertices. We need to find a tree $T(V',E')$ such that the resulting tree have maximum sum of weights of vertices, where $V' \in V$ and $E' \in E$. In short, we need to remove some vertices(along with all their edges) from $G(V,E)$ ... |
I have an if-then-else condition with three binary variables $A$, $B$ and $C$:
if A = 1
then B = 1
else
B = C
How do I express this as an integer linear program with equality constraints?
|
The algorithm to partition a polygon into y-monotone pieces is as follows:
Input. A simple polygon P stored in a doubly-connected edge list D
Output. A partitioning of P into monotone subpolygons, stored in D
Process:
1. Construct a priority queue Q on the vertices of P ,use y-
coordinates to deter... |
$\mathsf{XP}$ is the class of problems with input length $n$ and parameter $k$ than can be solved in $O(n^{f(k)})$ time, where $f$ is a computable function. It's described on the complexity zoo page as "Fixed-parameter Tractable for Each Parameter", but I fail to see how adding "for each parameter" to the description c... |
I'm trying to figure out a good way of encoding object segmentation data into a single RGBA image. I'd like to not only distinguish between classes, but also individuals within classes, and be able to have multiple classes and objects per pixel.
For example, I could have a pixel represent both "road sign" and "speed si... |
Given function rand7 returns random integer in interval [0, 6]. Your task is to implement function rand5 which should return random integer in interval [0, 4] using function rand7.
This is a question from my book. So, this is how I solved it (the algorithm is written in C):
int rand5(void){
return (int)(rand7() * 4... |
I'm studying the chapter "Division by Digit Recurrence" in "Digital Arithmetic" of Ercegovac. I like this book is overall well written. Although sometimes I struggle understanding some aspect like the one I'm about to expose.
First of all let me give some introduction to the method, almost everything is taken from the ... |
Given P=!NP
Is there a polynomial time TM such that for an input of formula and a satisfying assignment will yield a different satisfying assignmentif such exist?
|
I would like to have a compact conceptual explanation that allows me to gain some feeling with the concepts. The following list uses $x_i, y_i$ as events of experiments $X, Y$.
Self-information, denoted as $I(x_i)$
Mutual information, denoted as $I(x_i; y_i)$
Uncertainty (which is closely related to self-information ... |
Design a minimum state deterministic finite automata for accepting those strings over the alphabet $\{a, b\}$ whose last but one symbol is $b$.
|
I have a certain kind of graphs. They are DAGs similar to dependency graphs but strictly hierarchical, that is, each node belong to a certain level in the hierarchy and cannot be moved up or down when the graph is laid out onto a plane. The nodes can be arbitrarily exchanged with others in the same level.
Here's an exa... |
How to encode a sequence of n non-decreasing integer of [0, ..., m] fulfilling the following conditions:
no or minimal redundancy
only use 1 integer variable or k independent integer variables with a range of [0, ..., j(k)], It means there exist an inverse function f-1(x) to map the encoded sequence, an integer x of t... |
I guess I lack at understanding basic things at algorithm calculations, while learning for an exam.
at the result, does one write like O(ld n) or just log instead of ld ?
regarding the following calculation (not from me) at the yellow mark - why is it Theta(n) ? why not O(n) ? I dont get it..
big thanks in advance !... |
I was hoping someone could help me with this question, since I'm having trouble determining what approach to take.
Let $L \subseteq \{0,1\}^*$ be a regular language. Show the language $\{w \in \{0,1\}^* | 1w \in L\}$ is also regular.
My idea is that whenever we're at the start state to compensate for the lack of the 1... |
The book "Algorithms" by Robert Sedgewick and Kevin Wayne hinted that (see the quote below) there are efficient algorithms for finding shortest paths in undirected graphs with possibly negative edge weights (not by treating an undirected edge as two directed one which means that a single negative edge implies a negativ... |
I need to prove that TAUT is coNP-complete. I showed that $\text{TAUT} \in \text{coNP}$ by reducing $\text{SAT}$ to $\overline{\text{TAUT}}$. However, I cannot figure out how to prove that every problem in coNP can be reduced to $\text{TAUT}$ in polynomial time. To do that, I would need one of two things:
A known coNP... |
According to https://www.heroescounters.com/teampicker a Hero has a synergy value with another hero, Heroes of the Storm have 60+ heroes each one with a synergy value for example:
HeroID Synergy.With.HeroID Synergy.Points
1 2 97
1 3 95
1 ... |
I am trying to understand closure properties between different language classes. For example, if L1 is regular and L2 is recognisable, then is L1 intersection L2 decidable? My answer is that L1 is also recognisable and therefore L1 intersection L2 is recognisable. However, this cannot guarantee that it is decidable. Is... |
We defined the class $\text{DP}$ like this:
$$\text{DP} := \{ A \setminus B : A, B \in \text{NP} \}$$
We say a problem $P$ is $\text{DP}$ complete iff $P \in \text{DP}$ and $X \leq P \forall X \in \text{DP}$, meaning that every language $X \in \text{DP}$ can be reduced to $P$ in polynomial time.
For a particular proble... |
Could we design a Turing machine that output every bit of $\pi$ one after another correctly?
I think we have computer programs that calculate the value of $\pi$ day after day, and thus it's viable.
Could we do that if the Turing machine has a limited tape length?
|
I have seen the term "approximation oracle" in computer science papers, sometimes parameterized with the letters $\alpha$ and $\beta$. What is an approximation oracle? How are such oracles used? I am somewhat familiar with the idea of an "oracle machine" in complexity theory.
|
In my understanding all SQL injections need to add another operation to the one intended by the programmer.
For example, a badly written query:
query="Select * from Table where name="+name;
User inputs name as: foo; Delete from Table; and this would be an SQL Injection.
But if the programmer would be able to limit the... |
I was reading JeffE's (Prof. Jeffrey Erickson) notes on solving recurrences, and he used Merge[A[1,...n], m] where A is an array(I think) and m is an integer. What does this mean? I thought Merge sort took two arrays as input. He includes psuedo code, but I can't decipher what is means. What is it doing?
Thank you for ... |
Given $G=(V,E)$, undirected graph, a group of vertices $S$ is called almost clique if by adding a single edge, $S$ becomes a clique.
Consider the language:
$L=\{\langle G,t\rangle \mid \text{the graph \(G\) contains a \(t\)-sized almost-clique}\}$.
Prove that $L$ is NP-complete.
Obviously, it is solved by polynomial re... |
My loop is pretty simple. The function takes in two parameters, a and b; both are integers where a<=b. The function will then create a list of numbers from a to b.
This is what I created:
def cat(a,b):
j = []
for i in range (a,b):
j.append(a+1)
a +=1
I honestly cannot figure out how to turn ... |
I am interested in the alpha equivalence relation in languages with variable bindings, such as:
t := x:y 'x belong to y'
| bot 'False'
| t -> t 'implication'
| Ax.t 'forall x, t'
Or the pure lambda calculus:
t := x 'variable'
| (t t) 'application '
| Lx.t 'abstraction: \x -> t'
I am ... |
As in the title, I am trying to find the largest (aka least upper bound) of a (very large) set of integers. Importantly, I do not have direct access to the full list of integers, but I do have a function $f(n)$ which returns true/false if $n$ is in the set. The function $f(n)$ is expensive and I would like to minimiz... |
I'm trying to create a mcts ai for connect 5 algorithm. However, I'm confused on designing the tree. Here is a quick description of the algorithm:
The initial state, S0 is the board state where the AI places the stone, or in other words, the AI's turn. Is it correct that each node should be the AI's turn, not the human... |
I have to solve a system of up to 10000 equations with 10000 unknowns as fast as possible (preferably within a few seconds). I know that Gaussian elimination is too slow for that, so what algorithm is suitable for this task?
All coefficients and constants are non-negative integers modulo p (where p is a prime). There i... |
Sometime you want to model some data from the real world using a graph, but such that edges don't just connect to a vertex; rather, they connect to some aspect of that vertex - some connection if you will.
For example, a node in a family tree would be a person, and they have a mother and father (never mind about adopt... |
We're given the algorithm which uses stack in order to store data (stack is implemented via an array). When the stack is full the algorithm does the following:
Creates a new array double the size of the original one.
Copies all elements of the old array to the new array, preserving the order.
Adjust the algorithm so... |
For a nondirection graph $G=(V,E)$, I need to write an algorithm that finds connections that can be removed without destroying the graph (ex: a connection from a child of a child back to the root of the graph). I have created an algorithm with a runtime of $O(|V|+|E|)$ (utilizing BFS):
smallerGraph(G,s):
for al... |
I have a question regarding multilevel page tables. As far as I know, in most 64 bit systems only 48 bits are used in page tables which would allow for 256TB of virtual memory to be addressed.
For personal computers, I don't understand how they would ever be able to support that amount of memory being virtualized. If t... |
I am new to machine learning. I have read several papers where they have employed deep learning for various applications and have used the term "prior" in most of the model design cases, say prior in human body pose estimation. Can someone explain what does it actually means. I could only find the mathematical formulat... |
Given is graph with networks and bridges/switches. We know, the root
Bridge is the bridge with the minimal Bridge-ID. The connections between every bridge and network is 1.
In the lecture slides they calculated the "best"(shortest) path from one network to the root bridge. I assume they used BFS, because it would be th... |
I am studying generalized Büchi automata and I don't really understand when a state is considered to appear infinitely often. The definition I have is:
A state $s$ appears infinitely often if there exists an infinite set of points $i \in N$ such that the $i$th state of the execution is $s$.
But there's also an example ... |
I'm studying data structure. When I read the chapter of heap, something really confused me. DecreaseKey's time complexity of the binary heap is O(lgn). However, I found somewhere on internet claimed that Leftist Heap doesn't support DecreaseKey operation. But I wonder why? Can't we simply treat leftist heap as binary h... |
This question might be too broad, but I really need help with this. I am required to choose a standard or notation to model an integration between two business processes, one of which is external.
The question is - are there any standards/notations than can compete with UML Activity Diagram or BPMN. If there are, which... |
I am going through the book on lambda calculus by Hindley and Seldin .
They introduce the syntactic equivalence of expressions and proving them by a technique named "induction" , which has not been directly defined in the book .
(a) $[N/x]x \equiv N$
(b) $[N/x]a \equiv a$ for all atoms $a \not \equiv x$
(c) $[N/x](PQ)... |
In one of my courses, Big-O notation was used for defining what a sparse matrix is, under the context of qualifying for suitability for a particular set of linear algebra algorithms. I looked around on the net, and only found more such uses that I have an issue with.
To say a matrix is sparse if it has O(n) non-zero el... |
I was reading Jeff E's lecture notes on Algorithms when I came upon the following question:
Describe and analyze an efficient algorithm that determines, given a legal arrangement of
standard pieces on a standard chess board, which player will win at chess from the given
starting position if both players play perfectly.... |
I was thinking about how effective it would be to calculate the number of CPU instructions a section of code would have and then trying to estimate the energy cost for a program.
But I was curious if there were more elegant ways of going about this?
|
As part of my research, I have recently written an algorithm for mining medical data. We are looking to potentially publish some of the data we collected however I would like to describe the algorithm I used in detail.
I was really curious about the algorithm so I recently programmed a dummy data generator and tested t... |
Given a Directed Tripartite graph with 3 Groups of vertices {A, B, C} such that:
Edges from A are directed in B.
Edges from B are directed in C.
Objective: Minimize the number of vertices in B (by keeping few and deleting the rest) such that every vertex in C is reachable from every vertex in A.
I think this can be c... |
Given a directed Graph and two vertices $S$ and $D$ (source and destination) such that each of its edges has a weight of the form:
$A_i+B_ix_i = V$
where $A_0$ is a non negative integer, $B_0$ is a positive integer, $x_i$ a variable that can take non negative integer values (each variable used only once in the graph).
... |
Let's consider the following situation.
We have a finitie alphabet $A$. Let $A = \{a_1, .., a_k\}$ We consider words over $A$ of length exactly $n$.
I am trying to solve some problem and I am going to:
Generate every word using non-deterministic Turing Machine. And, for every generated word make a computation $C$. that... |
Following up on this post denoting $(x \leftrightarrow y)$ the permutation of $x$ and $y$ and $P[x \leftrightarrow y]$ the term obtained from the term $P$ by permuting $x$ and $y$ (so for example if $P = \lambda x. \lambda y. x y$ then we have $P[x \leftrightarrow y] = \lambda y. \lambda x. y x$) (note that such trans... |
I am trying to find a general solution for the given A,B,C in dynamic arrays. Those veriables presents factors in the following operations :
given :
c_i the size of the array after operation O_i (c_0 := 0)
s_i is the number of elements after operation O_i (s_0 := 0)
c_i ≥ s_i
after pushBack: if s_i−1 = c_i , then ... |
Why are we interested in negative edge weight cycles when finding out SSSP. In a path, we are not allowed to traverse a node more than once.
|
Can someone help me to construct a deterministic PDA for the following language:
$L = \{0^n1^m | n \geq m$ and $m,n \geq 0 \}$
Here is my suggestion :
the states are z0,z1,z2 , z0 is final state , for the empty string , z1 should also be finate state :
|
This problem probably falls under some category of algorithms but I don't know which.
A given restaurant has $b_1..b_n$ branches around the world. A food critic has to travel all of the branches.
When the critic finishes visit to the branch $1 \le j\le n$ he gets paid $m_j$ money by his employer for the job.
For bra... |
Regarding CPU cache, if the CPU does not find the data it needs in the cache, I understand it then looks for it in the main memory (RAM). (Let's assume we have only one level of cache in order to keep this question as simple as possible.)
My question is this: if the data is found in main memory, what happens? Does the ... |
The problem is this: Let us have an int array of length n. Find an algorithm to determine if the array represents a min-d-heap.
My solution: We start from the first index in the array, and compare its value to the value of its children (all the nodes at locations $i*d+k$ where $k \in \{1,2,...d\}$, assuming we start th... |
Let's say that when initializing a pet class, I wanted to exclude or disallow dogs or cats as species. What would be the proper way to throw an invalid_argument exception?
using std::string;
#include <stdexcept>
using std:: invalid_argument;
struct Pet {
const string name;
long age = 0;
const string species;
Pe... |
So I have a pic which I think illustrates my confusion:
the read surrounds what I wonder is the head? Does head refer to a node with both a data and next, or only a node with next? In other words, which marked box does it refer to in my pic?
|
2-SAT is unsatisfiable iff it contains unsatisfiable XOR-2-SAT.
So, first, we just need to combine every clause that contains share same variables (both of them). Then, all of those which remain uncombined are "uninteresting" (don't affect satisfiability).
Example:
$\Phi = (x \lor y) \land (\overline x \lor \overline ... |
I think I'm pretty confused about what's called a calculus and what's called a programming language.
I tend to think, and might have been told, that a calculus is a formal system for reasoning about the equivalence of programs. Programs have an operational semantics specified by a machine, that should (I think?) be det... |
I dont think this is true, take the language with a single element L = {0}, then the complement L' would have infinitely many strings (everything that isn't 0). So if it were true that A is mapping reducible to its complement, everything in L' can be obtained via a computable function from some element in L, i.e 010 i... |
Is $L = \{\langle A\rangle\mid A\text{ is a DFA and }L(A) = \Sigma^*\}$ decidable?
I know that $L'=\{\langle A,w\rangle \mid A\text{ is a DFA and }w\in L(A)\}$ is decidable, but I'm not sure if this is related.
|
I have been told (generic explanation) that 3SAT could be converted to unary 2DFA with endmarkers (assuming each variable of 3SAT as a prime number and then for each clause creating a cycle in unary 2DFA).
Can someone please provide an example of the above with explanation of the process (a small example, say 3-4 claus... |
I have three different algorithms for achieving a target. Algorithm 1 takes $O(Mn)$ - $M$ is constsnt and n is variable,Algorithm 2 takes $O(min(p^3,n^3))$ - both $p$ and $n$ is variable and Algorithm 3 takes $O(nk+nd)$ - $k$ constant, $n$ and $d$ is variable. Is it possible to compare these algorithms? Which algorithm... |
I am quoting a paragraph in Operating System Concepts by Silberschatz, in paging chapter,
In addition, the operating system must be aware that user processes operate
in user space, and all logical addresses must be mapped to produce physical
addresses. If a user makes a system call (to do I/O, for example) and pro... |
This are two sections from a task I got.
The Young tableau is defined as a matrix of m rows on n columns so that
the bars in each row are sorted in ascending order Left to right and
the elements in each column are sorted in ascending order from top to
bottom. Some of the elements in the Young tableau may be $\in... |
Given two representations of the same abstract data type, any optimal program that incorporates one representation has a corresponding optimal program that incorporates the other.
What is the field of computer science that studies program transformation between two such optimal programs?
If necessary, posit the practic... |
I wonder what is $K(x|K(x))$, $K$ denoting (Kolmogorov-Chaitin) prefix complexity. Naively, it looks like it should just be $K(x)+O(1)$. Is that right? The same question for plain Kolmogorov complexity is interesting as well.
|
I have two sets of vectors $(\mathbf{l}_i)_{1\le i \le n}$ and $(\mathbf{r}_i)_{1 \le i \le n}$. Each vector $\mathbf{l}_i$ is in $[0,1]^4$, same for $\mathbf{r}_j$. I'd like to maximize the dot product $\mathbf{l}_i \cdot \mathbf{r}_j$, i.e. find tuples $(i,j)$ s.t. $\mathbf{l}_i \cdot \mathbf{r}_j$ is as big as possi... |
I'm approaching some continuous optimization problems by considering discrete approximations of them at different resolutions. Those discrete approximations can be solved with linear programming solvers, like GLPK.
After having solved a discrete approximation at resolution $h_0$, I can produce a reasonably good feasibl... |
I'm looking for resources on (partial) type inference for dependent types.
For example there could be a type inference scheme that fails if the term doesn't have a principal type, or a scheme that makes some choices and infers non-principal types.
I'm also not sure how to integrate type inference into constraint-based ... |
Using a bipartite graph to represent hypergraphs as described by Wikipedia :
A hypergraph $H$ may be represented by a bipartite graph $BG$ as follows:
the sets $X$ and $E$ are the partitions of $BG$, and ($x_1$, $e_1$) are
connected with an edge if and only if vertex $x_1$ is contained in edge $e_1$
in H.
Conv... |
Valiant's theory of PAC learning looks at the tradeoff between expected error and algorithm runtime in different classes of learning problems. In particular, a lot of his analysis focuses on which classes of disjunctive normal form (DNF) formulae are learnable in polynomial time while minimizing expected error (PAC le... |
$L_1 = \{ a^i b^j c^m \mid m ≥ min(i,j) \}$
$L_2 = \{ a^i b^j c^m \mid m ≥ max(i,j) \}$
Which language is CFL ?
ANS : $L_1$ is CFL but $L_2$ is NOT.
My understanding :
For Language $L_1$ :
( Here I am also interested in checking whether the language is DCFL or not. )
Checking DCFL or not :
By looking at language $... |
We already know that $H:=\{\langle M,w\rangle | M$ halts on $w\}$ is undecidable, then how can there possibly be a machine that decides any infinite subset of $H$?
|
I want to prove that the hardness of the Steiner tree problem lies in determining the optimal subset of Steiner vertices that need to be included in the tree and I need to show this by proving that if this set is provided, then the optimal Steiner tree can be computed in polynomial time.
It is clear that we can find an... |
Having string $S$ of length $n$, finding the count of distinct substrings can be done in linear time using LCP array. Instead of asking for unique substrings count in whole string $S$, query $q$ containing indexing $(i,j)$ where $0 \le i \le j < n$ is asking for count of distinct substring inside given query range for... |
I am currently reading the book "An Introduction to Functional Programming through Lambda Calculus" (the 2011 edition) and am a bit puzzled by the definitions of free and bound variables with regards to function application.
The book states, in section 2.10, that a variable is bound in an expression if
the expression ... |
Could someone please explain me, what is a fix point?
I caught the minimum explanation about fix point from the website:
After infinitely many iterations we should get to a fix point where
further iterations make no difference. It means that applying one more
ExprF would't change anything -- a fix point doesn't... |
Determine whether the following language is decidable, recognizable but not decidable, co-recognizable but not decidable or neither recognizable nor co-recognizable. Prove your answer.
$$L=\left\{ \left\langle M\right\rangle |M\text{ is a TM and }A_{TM}\leq\mathcal{L}\left(M\right)\right\} $$
[Where $\mathcal{L}(M)... |
Is the following language decidable? $$L = \{A : \text{A is a DFA and } |L(A)| \ge 2\}$$
|
I want to show that it satisfies Rice's theorem:
(i) $L$ is non-trivial, since $\langle M\rangle \notin L$ where $L(M)=\emptyset$, as $M$ halts/rejects any input string in the first step.
(ii) if $L(M_1)=L(M_2)$ where $M_1$ and $M_2$ are turing machines, then $M_1$ makes more than 10 steps on some input iff $M_2$ makes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.