instruction stringlengths 35 29.1k |
|---|
Given a positively weighted DAG (directed acyclic graph) $D = (V,E)$, can you create a new non-weighted DAG $D'$ by converting each edge with weight $w(e) = x$ into x non-weighted edges and vertices? I believe this would take $O(|E|+W)$ time where $|E|$ is the number of edges and $W$ is the total weight of all edges. M... |
There exist efficient data
structures for representing set
partitions. These data structures have good time complexities for operations
like Union and Find, but they are not particularly space-efficient.
What is a space-efficient way to represent a partition of a set?
Here is one possible starting point:
I know that th... |
Given is a planar graph $G=(V,E)$ and let $\mathcal{G}$ denote its embedding in the plane s.t. each edge has length $1$.
I have furthermore a set $C$ of points where each point $c \in C$ is contained in $\mathcal{G}$. Furthermore, it holds for any point $p$ in $\mathcal{G}$ that there exists a $c \in C$ with geodesi... |
For a regular language $L$, let $c_n(L)$ be the number of words in $L$ of length $n$. Using Jordan canonical form (applied to the unannotated transition matrix of some DFA for $L$), one can show that for large enough $n$,
$$ c_n(L) = \sum_{i=1}^k P_i(n) \lambda_i^n, $$
where $P_i$ are complex polynomials and $\lambda_i... |
I have difficulties in understanding the notion of density for distribution.
Notion of density for distribution. A distribution $H$ over $\{0,1\}^n$ has density $\sigma$ if for every $x \in \{0,1\}^{n}$, $Pr[H=x] \leq \frac{1}{2^n\sigma}$.
The following is my desperate tries to understand the notion.
if $H$ is uniform ... |
I encountered the following optimization problem. Let $ S = \lbrace 1, 2, \ldots, n \rbrace $ be a set of items. Each item $ i \in S $ has a non-negative benefit $ b_i \in \mathbb R^+ $, non-negative weight $ w_i \in \mathbb R^+ $ and a non-negative cost $ c_i \in R^+ $. The objective is to select $ A \subseteq S $ tha... |
I have a compiler optimization which should be quite common, but I can not find a name for it, nor a reference that describes it.
Given an integer x, not known at optimization time, a known constant c and the following program
x_1 = x * c
x_2 = x_1 / c
print(x_2)
It's pretty clear that the code can be optimized to
pr... |
In the answer to this question, I'm not understanding how the string is derived for a given $l$.
For example,
Case 1: $vx = a^i$ where $i > 0$. Choose $l = 2$ to get $a^{n+i} b^{n+1} c^{n+1} d^n \notin L$.
Why is $l = 2$ chosen and how is $a^{n+i}b^{n+1}c^{n+1}d^n$ derived from $l = 2$?
Also, how can $vx$ be chosen i... |
Given an undirected graph $G = (V,E)$, what is the clique number $\omega(G)$ given $|E|$, i.e., the size of the largest clique in a graph with $|E|$ edges.
I think this is doable after realizing that the number of edges in a clique is equal to the triangular number:
$$|E(K_k)| = \frac{1}{2}k(k-1).$$
I am looking for a ... |
I try to get the intuition behind the notion of strong one way function and weak one way function by reading the scribe One-Way Functions. Particularly, I am interested in examples and definitions of the weak and strong one way function. I known it's very broad notion, therefore I will be as specific as possible in my ... |
I get values $x_t$ in an online fashion and want to buy "good" ones, where "good" means that some measure $P(x_t) >T$. Consider the following simple algorithm.
T = 0.7
N = 100 // or any value N > B
B = 20 // or any value 1 < B < N
l = 0
for t from 1 to N:
input a new observation x_t
let P(x_t) the probability... |
How would you explain why the Fast Fourier Transform is faster than the Discrete Fourier Transform, if you had to give a presentation about it for the general (non-mathematical) public?
|
I am trying to understand FFT algorithm explained here
FFT(x) { n=length(x);
if (n==1) return x;
m = n/2;
X = (x_{2j})_{j=0}^{m-1};
Y = (x_{2j+1})_{j=0}^{m-1};
X = FFT(X);
Y = FFT(Y);
U = (X_{k mod m})_{k=0}^{n-1};
V = (g^{-k}Y_{k mod m})_{k=0}^{n-1};
return U+V;
}
The author says that the... |
I encountered the brainfuck programming language which I know is turing complete. However I then decided to create a high level language that gets compiled to brainfuck code.
There is only one data type in it (integer, since that's the only data type brainfuck supports). It supports functions and subroutines (to which ... |
One topic I've recently looked at is co-occurence networks formed from Twitter tweets. This is how I felt after looking at the tweets of random people:
This leads me to the question:
Question: Is it possible to discern the quality of web data from networks derived from it?
A hypothetical situation: Suppose we have ... |
Cormen talks briefly about the advantages of picking a random pivot in quicksort. However as pointed out here(4th to the last paragraph):
Using a random number generator to choose the positions is relatively
expensive
So how is picking a random pivot actually implemented in practice, and how random is it? It can'... |
I got stuck on this question while studying for final exam.
I thought about reducing L' to L to prove that L' is recognizable since L is recognizable. I am not 100% sure if that is correct.
|
I read a quotation attributed to Sheila Greibach that says that the intersection of two context free grammars is recursively enumerable.
I could not, however, find a citation for this quotation (and searching has failed to turn up a restatement of this result somewhere else).
Can anyone provide a proof or a citation to... |
Why isn't the set $\{ \langle i, j \rangle \mid W_i = \overline W_j\}$ a r.e. set?
Note: $W_x = L(M_x)$
|
In a directed graph, the indegree of a node is the number of incoming edges and
the outdegree is the number of outgoing edges. Show that the following problem
is NP-complete. Given an undirected graph G and a designated subset C of G’s
nodes, is it possible to convert G to a directed graph by assigning directions to ea... |
I'm looking for a good book that explains these subjects in a readable way.
Any suggestions ?
I currently pursuing my BSC in computer science, and I just failed to pass the course introduction to thr theory of computation and complexity.
I would like to have more reference and sources of knowledge so I can understand t... |
Meeting rooms on university campuses may or may not contain coffee machines. We would
like to ensure that every meeting room either has a coffee machine or is close enough to a
meeting room that does have a coffee machine. (For any two meeting rooms, the architect
has told us whether or not they are close enough... |
In the set cover problem we want to find in the $\mathbb{S} \subset 2^\mathbb{U}$ the subset $\{s_i\}_{1..k}$, such that $\cup s_i = \mathbb{U}$ for given $K$, where $k \le K$.
But how to reduce the set cover problem to the set covering decision problem (determining whether is there such cover or not)? The same with pr... |
Is the language $L = \{ a^ib^j \mid i\ \nmid\ j \ \} $ context free ?
If we fix $n \in N$ then we know that the language $L = \{ a^ib^j \mid \ \forall \ 1 \le k \le n \ , \ \ j\neq ki \} $ is context free (as it can be presented as a finite union of context free languages in a similar way to the example here: Is $L= \... |
Studying parallel algorithms for CLRS, old edition Chapter 30. Can some one explain with a simple example what is pointer jumping and how exactly it works ?
|
A set is sparse if it contains polynomially bounded number of strings of any given string length $n$ otherwise it is dense. All known NP-complete sets are dense. It was proven that P=NP if and only if there is a sparse NP-complete set (under Karp reduction).
I would like to find the density of uniquely satisfiable 3SAT... |
A few definitions..
$$
\begin{align*}
\mathrm{ALL}_{\mathrm{TM}} &= \Bigl\{\langle M \rangle \,\Big|\, \text{$M$ a Turing Machine over $\{0,1\}^{*}$},\;\; L(M) = \{0,1\}^{*} \Bigr\}
\\[2ex]
\overline{\mathrm{ALL}}_{\mathrm{TM}} &= \Bigl\{\langle M \rangle \,\Big|\, \text{$M$ a Turing Machine over $\{0,1\}^{*}$},\;\; ... |
Edit: My original question referred to nonconstructive and constructive definitions of function types. I changed the terminology in the question and the title to semantic and syntactic, which the answer indicates is the correct terminology for this distinction.
I can recall two ways of defining functions in set theory... |
What are the steps to perform bottom-up heap construction on a short sequence, like 1, 6, 7, 2, 4?
At this link there are instructions on how to do for a list of size 15, but I can't [necessarily] apply the same process to a list of 5 items (my trouble is that 5 is not enough to provide a complete tree).
|
The yin yang puzzle was written in Scheme. Since it uses call/cc, it is not possible to express it in a pure lambda expression, unless we do a CPS transform.
However, given the fact that $\lambda \mu$-calculus have the power to model call/cc, is it possible to write an equivalent $\lambda \mu$-expression? I am still le... |
Suppose we are given $n$ distinct integers $a_1, a_2, \dots, a_n$, such that $0 \le a_i \le kn$ for some constant $k \gt 0$, and for all $i$.
We are interested in finding the counts of all the possible pairwise sums $S_{ij} = a_i + a_j$. ($i = j$ is allowed).
One algorithm is to construct the polynomial $P(x) = \sum_{j... |
I wonder what's the time complexity of the following selection problem I found while thinking of a string-matching problem.
[Assuming operations on integers take $O(1)$ time]
We are Given $m$ sets, with $n$ integer numbers each. We want to select exactly one integer from each set, to make a set S, such that $~ l = \max... |
Parallel computing is not new but it is becoming common now a days. This is essentially driven by the need of the users (they need to process more data now) and also because of physical limitations on chip designing e.g power dissipation limits forcing to manufacturers to move to multicore CPUs.
My question is how is t... |
This problem is about finding a route on a square grid.
The starting point is $(1,1)$ and the target point $(n,m)$.
I can move each step from my current point $(x,y)$ either to $(x+y,y)$ or $(x,y+x)$.
Now I need to determine if there is a path from $(1,1)$ to $(n,m)$, and if so to return the shortest one.
Now I believe... |
First of all, let me preface by saying that this question is not completly new but the original question hasn't been answered. More important, this is only basic question on understanding the proof itself.
So after some search in the site I found the following question : Bellman-Ford algorthm and negative cycle proof.
... |
Consider such a rule in grammar for an LR-family parsing generator (e.g YACC, BISON, etc.):
Nonterminal : [ lookahead not in {Terminal1, ..., TerminalN} ] Rule ;
It's an ordinary rule, except that it has a restriction: a phrase produced with this rule cannot begin with Terminal1, ..., TerminalN. (Surely, this rule can ... |
Prove that if G is an undirected connected graph, then each of its edges is either in the depth-first search tree or is a back edge.
Now, from intuition and in class lectures by Steven Skiena, I know that the above holds true, since it dives all the way down, and then throw a rope back to a previous vertex. I also know... |
I have the following CFG,
$S \rightarrow CB$
$C \rightarrow aCa \text{ }|\text{ } bCb \text{ }|\text{ } \text{#}B$
$B \rightarrow AB \text{ }|\text{ } \varepsilon$
$A \rightarrow a\text{ }|\text{ }b$
This is the CFG for the following language:
$$L= \left\{w \text{#} x\mid w^R \text{ is a substring of }\ x \text{, where... |
Pebbling is a solitaire game played on an undirected graph $G$ , where
each vertex has zero or more pebbles. A single pebbling move consists
of removing two pebbles from a vertex $v$ and adding one pebble to an
arbitrary neighbor of $v$ . (Obviously, the vertex v must have at
least two pebbles before the move.... |
I am trying to solve a system of inequalities in the following form:
$\ x_i - x_j \leq w $
I know these inequalities can be solved using Bellman-Ford algorithm. But there is also another condition. I want to find the solution that maximizes $\ x_n - x_1$
As far as I know the default Bellman-Ford algorithm minimizes it.... |
I'm starting an undergraduate computer science course next fall, but I can't really understand λ-calculus in the context of functional programming. I may be misinterpreting this completely, but based on this definition from the Stanford Encyclopedia of Philosophy, it's just another notation for functions.
If it is just... |
Let's say I have a decision problem $P$ on graphs for which I know that it is NP-hard on graphs with maximum degree $d$. Does this then imply that it is NP-hard on $d$-regular graphs? Although it might seem obviously true, maybe it is inherent in the reduction to show that $P$ is hard, that some vertices have degree l... |
There are two quicksort partition methods mentioned in Cormen:
(the argument A is the array, and [p, r] is the range, inclusive, to perform the partition on. The returned value is the index to the pivot after the partition.)
Hoare-Partition(A, p, r)
x = A[p]
i = p - 1
j = r + 1
while true
repeat
j = j - 1
... |
Sometimes the terms 'Fourier domain', 'complex frequency domain', 'Frequency domain' and 's domain' are used interchangeably. Take these answers here for example.
Can you really use them interchangeably all the time, without being technically wrong? So, could you describe what would be wrong if I would replace 's domai... |
In some books and on the internet I occasionally find "pure binary" and "binary" on its own, is there a difference between these two terms? If so, can someone describe briefly what they are?
|
We are given a graph G, integer b < |E|, and subset F in E. The problem is to detect whether there is a cycle in the graph with length at most b and includes each edge in F. Prove that this is NP Complete.
I'm thinking of reducing from Hamiltonian Path, but still can't think of the appropriate transformation function.... |
This is NOT HW, this is from Skienas book, and I just couldn't solve it at all.
Please give me a hand here, in understanding and solving it, thanks.
Let G = (V, E) be a binary tree. The distance between two vertices in G is the length of the path connecting these two vertices, and the diameter of G is the maximal dista... |
Ok, I have done a lot of research on Quantum computers. I understand that they are possibly the future of computers and may be commonplace in approximately 30-50 years time.
I know that a Binary is either 0 or 1, but a Qubit can be 0 or 1. But what I don't understand is how it can be anything other then 0 or 1. Surely ... |
As I understand, the assignment problem is in P as the Hungarian algorithm can solve it in polynomial time - O(n3). I also understand that the assignment problem is an integer linear programming problem, but the Wikipedia page states that this is NP-Hard. To me, this implies the assignment problem is in NP-Hard.
But su... |
I am attempting to prove the following problem is undecidable. Given a Turing machine $M$ and input $x$, does $M$ visit infinitely many tape cells on input $x$?
I am considering a reduction from the halting problem. Is this the right approach?
|
I've been trying for a while now to find a solution for the problem in the title: determining if a number is perfect using a Turing Machine. I only had one class on the TM and while I did "get" how it works, this particular algorithm is being really hard for me to develop.
The algorithm I'm trying to implement on the T... |
Basically, I am looking for a (well-defined) term for some "borderline" vertexes interconnecting other vertices in and outside of a given connected component.
More specifically, given directed graph $G = (V_G, E_G)$ and (strongly) connected component $C = (V_C, E_C)$, how do people refer to such vertices $x$, where,
$... |
I have been reading some notes on Category Theory. One question that is posed is to verify the definition of $\operatorname{List}$ is a functor...
$\operatorname{List}(g \circ f) = (\operatorname{List} g) \circ (\operatorname{List} f)$
I can see this makes sense in programming terms whereby a function $f$ is mapped to ... |
First off, I am not sure if this is the correct stackexchange site to ask this question on, so moderators can feel free to move it.
I am working on an application that identifies an object in an image. For example, let's say that the object is an apple, and the apple can be green, red, or both.
My plan is to create an... |
So I'm just starting to learn about query processing and such in databases and I'm having some trouble. I don't really understand how to compute the minimum number of block reads given a relation and a query I guess you could say. If anyone could help me out, it'd be much appreciated. Here is an example that I'm wor... |
I am working over a homework problem and am confused on how to determine whether there is internal and external fragmentation given the following table:
Characteristic Design 1 Design 2 Design 3
Physical Memory Address Width: 8 bit 16 bit 32 bit
Virtual (Logical) Address Width: 12 bit 20 ... |
Setup
I need to develop a Turing Machine that accepts a string m that has the same number of a's and b's.
My alphabet is {a,b}, and we use a diamond in class to represent an empty space.
Problem
The part I'm having trouble with is returning to the beginning of the string.
So far
At first I was planning on taking a char... |
If you have a language L, without doing any proofs, is there a way to tell if it's recognizable or co-recognizable or decidable?
Basically any hints or tricks that can be used to tell. Or maybe the common patterns to search for to tell which kind it is?
|
From Skiena's book The Algorithm Design Manual, chapter 6, problem 22:
Let $G = (V,E,w)$ be a directed weighted graph such that all the weights are positive. Let $v$ and $u$ be two vertices in $G$ and $k \leq |V|$ be an integer. Design an algorithm to find the shortest path from $v$ to $u$ that contains exactly $k$ edg... |
Can you help me with this problem ?
Given an undirected graph $G$ and an integer $n$, prove that determining whether the graph has wheel on $n$ vertices $W_{n}$ (a wheel $W_{i}$ is such that $i$ nodes form a cycle and a $i+1$st node is connected to all other nodes, resulting in $2i$ edges) is NP-complete.
|
For the following question:
If B is an element of PSPACE and A is an element of PSPACE-Complete, and A polynomial reduces to B, then B is an element of PSPACE-Complete.
I am trying to prove this, but I don't understand how to get started. Can anyone help please?
|
Can someone give me a hand here, I am new to backtracking, and preparing for an interview. I couldn't even attempt this question, please help.
Describe a back tracking algorithm for efficiently listing all k-element subsets of n items.
For n = 5 the 3 element subsets are (1,2,3), (1,2,4), (1,2,5), (1,3,4), (1,3,5), (1,... |
Does our PC work as Turing Machine? The model of a Turing Machine consists of infinite memory tape, which means infinite states. But suppose if our PC has 128 MB memory and 30GB disk it would have 256^30128000000 states and thus, it has finite states.
I know that we can write a type of program that, if during executio... |
Consider this problem:
Given an undirected graph $G = (V, E)$, find $G' = (V', E')$ such that:
$G'$ is an induced subgraph of $G$
$G'$ has no 3-cliques
$|V'|$ is maximal
So the least number of vertices must be eliminated from $G$ so that 3-cliques are eliminated.
An equivalent problem would be to find a 2-coloring ... |
I have my end of year exams next Thursday. I'm generally doing fine but I am having some major issues with this strand of my course, this has to be the biggest issue I have. So, here is the question in the past paper:
You have been tasked with determining the validity of a
manufacturer’s claim that their widget i... |
I tried posting this in the math forum but I didn't get any responses. I was hoping someone could give me some advice for how to approach the following problem.
If $n$ is a positive integer, let $S_n$ denote the group of permutations of the set $\{1,2,\dots, n\}$. For a permutation $\pi$ in $S_3$, let $e_\pi$ be the b... |
Prove that context free languages aren't closed under this operation: $ A(L) = \{ zyx \mid x,y,z \in \{0,1 \}^*, xyz \in L \} $
Obviously, we need to find a context free language $L$ such that $A(L)$ isn't context free. Here are some of my failed attempts:
Take the language $ L = \{\ 0^n1^n \mid n \in N \} $ and then (... |
I have the dataset which you can find here, containing many different characteristics of different houses, including their types of heating, or the number of adults and children living in the house. In total there are about 500 records. I want to use an algorithm, that can be trained using the dataset above, in order t... |
How can we prove that $h(x) = g(f(x))$ is a reduction function for $A \leq_m C$,
if $f$ is the reduction function of $A \leq_m B$ and $g$ is the reduction function for $B \leq_m C$
The given Proposition is: $A \leq_m B, B \leq_m C \Rightarrow A \leq_m C$
I was thinking about using $HALT_{TM}$ for A. So on input $\lan... |
I need to construct d-regular expander graph for some small fixed d (like 3 or 4) of n vertices.
What is the easiest method to do this in practice?
Constructing a random d-regular graph, which is proven to be a.a.s. an expander?
I also read about Margulis constructions and Ramanujan graphs that are expanders and a con... |
I have a question, i was trying to reduce 3-SAT to a particular graph problem and i'm not quite sure about a thing i used in the reduction.
In fact the reduction build a bipartite graph, the edge $(x_1,c_1)$ exist if the variable $x_1$ is in the clause number 1, the costs on that edge are dependent on the truthfulness ... |
In my class we just started learning about Turing machines. I think I understand the concept but am unsure how to syntactically solve any problem related to one. I am presented with the problem:
Build a Turing machine accepting $(b + c)^+$$\#a^+$ (Please comment your
code. Any uncommented solutions will not be gr... |
Been stuck on this for a while, would really appreciate some help:
Suppose you are given an array A[1...n] of sorted integers that has been circularly shifted k positions to the right. For example, [35,42,5,15,27,29] is a sorted array that has been circularly shifted k = 2 positions, while [27,29,35,42,5,15] has been... |
I am confused about the Vapnik-Chervonenkis dimension of a linear separator in 3 dimensions.
In three dimensions, a linear separator would be a plane, and the classification model would be "everything on one side of a plane."
It's apparently proved that the VC dimension of linear separators is d+1, so in 3D, its VC d... |
From graph isomorphism, we know that two graphs A and B are isomorphic if there is a permutation matrix P such that
$A = P \times B \times P^{-1}$
So, to solve the problem, if two graphs are isomorphic, we need to find such a permutation matrix P. The problem is believed to be NP (and NP complete for the case of subgr... |
I am trying to solve this problem and I am really struggling.
A monotone boolean formula is a formula in propositional logic where all the literals are positive. For example,
$\qquad (x_1 \lor x_2) \land (x_1 \lor x_3) \land (x_3 \lor x_4 \lor x_5)$
is a monotone boolean function. On the other hand, something like
$\... |
I'm trying to solve this question in order to review for my exam, and this one has got me a bit stumped. From the looks of it, it seems like a fairly straight-forward question, but I can't figure out what steps to begin with.
Let $M$ be a linear-space Turing machine consisting of a single tape. We say $M$ is a linear-... |
Recently, I came across this problem, a variation of towers of hanoi.
Problem statement:
Consider the folowing variation of the well know problem Towers of
Hanoi:
We are given $n$ towers and m disks of sizes $1,2,3,\dots,m$ stacked on some
towers. Your objective is to transfer all the disks to the $k^{\text{th}}$ ... |
If there is a recursive function
$$
f(x) =
\begin{cases}
1 & \text{if $x \notin A$}\\
\text{undefined} & \text{if $x \in A$}\\
\end{cases}
$$
Is there a special name for the class of sets like $A$?
|
What are some problems that are prone to parallelization? When I think about this, the first thing that comes to my mind is matrix multiplication, which yields to faster calculations, meaning you can get speed ups easily. Any other examples like this?
|
Suppose you are given a polynomial-time algorithm for the following problem related to INDEPENDENT SET:
INDEPENDENT SET VALUE
Input: An undirected graph G.
Output:The size of the largest independent set in G (but not the set itself).
Show how you can use this algorithm to solve the INDEPENDENT SET problem in polynomial... |
Is there any data structure that maintain a collection of set (of finite ground set) supporting the following operations? Any sublinear running time will be appreciated?
Init an empty set.
Add an element to a set.
Given two set, report whether they intersect.
|
Were being asked to determine the whether this Turing Machine is decidable or not
"Given a two way, one-tape DTM $M$ whose tape set is $\Gamma=${$a,b,B$} and a string $x\in${$a,b$}*, determine whether $M$ will ever overwrite a symbol $a$ by a symbol $b$ in its computation on input $x$"
I'm not looking for answers, just... |
I saw this term "Glushkov NFA" at http://lambda-the-ultimate.org/node/2064 . Search engines are returning references to articles that use glushkov nfa, but nothing specific about the glushkov nfa itself.
What is Glushkov NFA? How different is it from the NFA created from Thompson Construction?
|
Is the following language context free?
$$L = \{ uxvy \mid u,v,x,y \in \{ 0,1 \}^+, |u| = |v|, u \neq v, |x| = |y|, x \neq y\} $$
As pointed out by sdcvvc, a word in this language can also be described as the concatenation of two words of the same length the hamming distance of which is 2 or greater.
I think it's not ... |
Across my studies I have noticed the following statement in my Subject Guide; namely, that two-layer feed-forward neural networks using the sigmoidal activation function are universal. My question is how are the networks 'universal' and what does 'universal' actually mean in this instance?
Thanks in advance.
|
I'd like to know if I have the right intuition and my answer is headed the correct way.
I am given a function
$ f = \{0, 1\}^* \rightarrow \{0, 1\}^* $ that is computable in space $O(\log n)$ assume that for every $x \in \{0, 1\}^*$, $f$ is length preserving, $|f(x)| = |x|$.
Define
$$L = \left\{ x\#y \mid \ x, y \in ... |
Let's say I have an optimization problem called $k$-foo which asks for a solution of size $k$ minimizing some quality criterion.
Now the corresponding decision problem $foo(M)$ would be: Is there a solution to foo with quality at least $M$ of size $k$.
For problems on one parameter (for example vertex cover) it is obv... |
I am interested in Distributed Algorithms especially in communication in network with failures.
I look for the proof of the following randomized algorithm of communication in network with failures. For me it seems like very general result in the communication, nevertheless I haven’t found the proof yet.
Algorithm: Ini... |
Why do we need to flip the kernel in 2D convolution in the first place?
What's the benefit of this?
So, why can't we leave it unflipped?
http://www.songho.ca/dsp/convolution/convolution2d_example.html
input
kernel
output
"First, flip the kernel, which is the shaded box, in both horizontal and vertical direction"
|
Prove that $L_1$ is regular if $L_2$, $L_1L_2$, $L_2L_1$ are regular.
These are the things that I would use to start.
As $L_1L_2$ is regular, then the homomorphism $h(L_1L_2)$ is regular.
Let $h(L_1) = L_2$ and $h(L_2) = L_1$, then $h(L_1L_2) = L_2L_1$ is regular (we already know that) or $h(L_2) = \epsilon$ and we ge... |
How do you prove that the language of even-lengthed palindromes, i.e.,
$L=\left\{ ww^R \mid w\in \left\lbrace 0,1 \right\}^* \right\}$, can not be accepted by a determinsitc Push-Down-Automaton?
Is there any general way to prove that a context-free language can not be accepted by a deterministic PDA? I mean something l... |
We have well established theory for measuring the information content and randomness of binary strings. Notions such as Shanon entropy and Kolmogorov-complexity were developed for binary strings.
For a binary square matrix, it is not sufficient to just convert the matrix into binary string and measure its information c... |
Famous PPAD class of problems is formally defined by specifying one of its complete problems, known as End-Of-The-Line:
End-Of-The-Line Problem:
$G$ is a (possibly exponentially large) directed graph with no isolated vertices, and with every vertex having at most one predecessor and one successor. $G$ is specified by... |
Given an undirected graph $G=(V,E)$ could we build a tree $T$ that approximates the distances from given vertex $r$ and the total weight, i.e. $\forall x \in V, d_G(r,x) \le d_T(r,x) \le 3 \cdot d_G(r,x)$ and $w(T) \le 3\cdot w(\text{MST}(G))$, where $\text{MST}$ is the minimum spanning tree and $w(\cdot)$ is the weigh... |
How can I prove that $\{0^n 1^{n^2} \mid n \in \mathbb{N}\}$ is not a context free language?
I tried to prove it using the pumping lemma, but I don't know how to deal with the case when $vxy$ contains both $0$ and $1$.
|
I've a couple of questions that I need answers for. What I am looking for here is the outline of the answers. Not necessarily the exact complete answer. I can do that.
The question is that common operating systems provide support for concurrency through processes and threads.
There are differences between processes a... |
I was looking over this question requesting an algorithm to generate all permutations of a given string. A comment in the answer caught my eye:
It might seem that it can take O(n) time per permutation, but if you think about it more carefully, you can prove that it takes only O(n log n) time for all permutations in tot... |
I'm working on a type system with extensible records, similar to ones explained in "A Polymorphic Type System for Extensible Records and Variants - Benedict R. Gaster and Mark P. Jones" and "Extensible records with scoped labels - Daan Leijen",
I already have a working implementation but I followed a completely differe... |
Is there any way to find out how to replace for/if for elementary recursive algorithms? I know that primitive recursive functions cannot basically eliminate "for", but for elementary recursive functions, there must be a way to convert the program into ones that do not have for/if/while and so on (which is elementary re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.