instruction
stringlengths
35
29.1k
In Theoretical Computer Science, which one is more important? Computability of a problem or Complexity of a problem?
How to reverse the order of elements in an array between indices $i$ and $j$. Ex: For the array [A,B,C,D,E,F], calling the function reverse(array, 1,4) will modify the array to be [A,E,D,C,B,F]. I want to optimize the solution to work with multiple calls on the same array, so pre-computations allowed. What would be the...
Given three numbers $m$, $n$ and $p$ in interleaved binary encoding1, it's obviously possible to check in $O(1)$ space whether $m+n=p$. It's less obvious2 that it isn't possible to check in $O(1)$ space whether $m\cdot n=p$. I wonder whether one can prove that it isn't possible to check in $O(\log N)$ space3 whether $...
I need to prove by definition (show that for every $C$ there exists a $n_0$) that: $$5n^2+3n= o(n^3-4n)$$ By trying to simplify the expression I get to the point where I should prove that: $$ \frac{5n^2+3n}{n^3-4n} < C$$. Now, showing that $\lim\limits_{x\to\infty} \frac{5n^2+3n}{n^3-4n} = 0$ isn't a tough mission, but...
I am well aware of the DP solution to the traveling salesman problem; also known as the Held and Karp algorithm for TSP. I have implemented it with bitmask, and it's something like this: int TSP(int pos, int bitmask) { if (bitmask == (1<<(K+1))-1) return dist[pos][0]; // Completing the round tr...
Why is it that Iterative-deepening A* is optimal, even without monotonicity? How can I be sure that the first goal reached is the optimal one?
I know how to use the pumping lemma to do so, but I don't think that can be used for this language: $$L = \{x \in \{0,1\}^* : \text{no prefix of $x$ has more $1$'s than $0$'s}\}. $$ What other method can I use to prove this?
A quasi-monotone CNF formula is a formula where each variable appears at most once as a positive literal (and any number of times as a negative literal). What is the complexity of deciding its satisfiability?
I'm currently studying compilers and am having some issues with understanding regular sets. For example, lets say I had a set of binary strings, (0, 1). Would all integers that are even and positive be considered part of a regular set? Lets say I have that same set, but instead of being even, they are divisible by 5, w...
$\tau$ be a transformation that, applied to a word of $\Sigma_a^\star$, replaces each character with a word from a possibly different $\Sigma_b^\star$ and concatenates the resulting words. For instance, given a $\tau$ with the following translation table: A -> AA B -> AB C -> BA D -> BB $\tau(ABC)=AAABBA$ and $\tau(DA...
Let $\Sigma$ be a small, finite alphabet. Suppose we are given ${n\choose 2}$ sets $S_{i,j}$, where $S_{i,j} \subseteq \Sigma \times\Sigma$. I'd like to determine whether there exists a sequence $x_1,x_2,\dots,x_n \in \Sigma$ such that $(x_i,x_j) \in S_{i,j}$ for all $i,j$, and if so, find an example of such a sequen...
I cannot really find a source that does not use the same examples provided by CLRS. I need a simpler example than MULTI-POP example. Could someone provide an example and explain me: a) What is the difference between worst-case analysis and amortised analysis? b) What is the difference between average-case analysis and ...
I have read the following artice that defines the term "constructor anomaly": Cohen, Tal, and Joseph Gil. "Better Construction with Factories." journal of object technology 6.6 (2007): 103-123. http://www.jot.fm/issues/issue_2007_07/article3/ Where can I find examples and references on constructor anomalies? (also in t...
Consider $\Pi$ to be the problem to decide if there is a subset of numbers that sum to $0$ in the given list of integers. How does one construct a promise problem equivalent to $xSAT$ from this? $xSAT$ is in $NP\cap coNP$. How is it possible that the original problem was NP complete and the transformed problem is in ...
I asked this question on stackoverflow, but was suggested to post to same here. So here goes. The following problem was asked in the recent October 20-20 Hack on Hackerrank : Evil Nation A is angry and plans to launch N guided-missiles at the peaceful Nation B in an attempt to wipe out all of Nation B’s people. Na...
I am interested in what sort of metrics are there that try to give a measure of how complex a given graph is, what are the corresponding algorithms, and what is their time complexity. A short description or list of relevant paper would be great. It might help to say that I have two graphs and I want to somehow tell whi...
The Monster M is the largest of the finite sporadic groups that arises in the classification of finite, simple groups in mathematics. M can be realized as a (very large!) set of 196882 X 196882 matrices with nothing more than entries of 1's and 0's, so long as we compute arithmetic as follows: 1+1=0 1+0=1+0=1 1*1=1 0*...
I've just began studying Artificial Intelligence and am wondering why the reachable state space of an 8-puzzle is $9!/2$. I see that the number of permutations of the tiles is $9!$ but it is not immediately obvious why half the possible states of the puzzle are unreachable at any given state. Can anyone elaborate? An i...
I understand that a pipe is a form of IPC where a process creates a link to communicate with some other process (a child maybe), taking each one a end of the pipe. File descriptors are created for read and write and they can use it in half-duplex or full-duplex. My question is if the implementation of this schema is so...
After asking this question on stackoverflow, it has changed slightly. Is there a way to represent a grammar as a basis for a vector space and represent a program as an object that lives in that vector space? I'm interested in the parallels between mathematical operators (like the Hamiltonian, ladder operators, momentu...
I have a huge list of strings. The goal is to make a database of "relevant" words. Of course in the context of what I work with, "relevance" is something akin to the organization I work with. For e.g. if it is a automobile manufacturing industry they'd buy products like Automotive assembly equipment Radial tyres Etc ...
Cutting problems are problems where a certain large object should be cut to several small objects. For example, imagine you have a factory that works with large sheets of raw glass, of width $W$ and length $L$. There are several buyers, each of which wants an unbounded number of small glass sheets. Buyer $i$ wants shee...
I would like to measure what is the probability that given some data and it's CRC32 checksum there is some other data with the same checksum. Running the simulation is not feasible because of the 2^32 possible values. Running the simulation for the birthday problem is feasible (check if there is a collision among n che...
Although this seems rather obvious, I couldn't prove it rigorously. Any ideas how to prove it? The graph is assumed to be simple and connected. Explanation of the terms: $k$-regular means that all vertices have degree $k$; bipartite means that there are 2 sets of vertices $X, Y$, where vertices from $X$ only have edge...
According to the wiki-article, http://en.wikipedia.org/wiki/Tf%E2%80%93idf the term frequency of term $t$ in document $d$ is given as follows: $$ tf(t,d) = 0.5 + \frac{0.5 \times f(t,d)}{\max{\{f(w,d): w~\epsilon~d\}}} $$ This is the augmented way of computation. But what does $w$ stand for?
What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network? As I recall your basic neural network is a 3 layers kinda thing, and I have had Deep Belief Systems described as being neural networks stacked on top of each other. I've not til recently heard of a Deep Learning Systems, ...
I need to detect whether a binary pattern P of length m occurs in a binary text T of length n where m I want to state an algorithm that runs in time O(n) where we assume that arithmetic operations on O(log2n) bit numbers can be executed in constant time. The algorithm should accept with probability 1 whenever P is a s...
The Adler32 algorithm has a shortcoming as noted on Wikipedia: Jonathan Stone discovered in 2001 that Adler-32 has a weakness for very short messages. He wrote "Briefly, the problem is that, for very short packets, Adler-32 is guaranteed to give poor coverage of the available bits. Don't take my word for it, ask Mark ...
I have this code fragment: for( i=0; i<n; i++ ) for( j=0; j<i; j++ ) for( k=0; k<j; k++ ) S; I need to find the number of times that S is executed in that code block. I plugged it into Wolfram Alpha but I am not sure if that is the right answer. I want to be able to do the math in order to fig...
Is the convention of dropping the leading 1 when storing the significand a given in all binary floating point representations or not necessarily?
What is proper terminology to distinguish between an array (ordered list) data structure in which each element is of identical type/class, and an array in which each element can be different?
Say you have a loop that iterates over an array, for i in someArray: //some code This basic example would have a running time of $O(n)$. Say that you added a nested loop with equal number of operations, this then would be $O(n^2)$. My question is, is it safe to do this kind of simplication in general? For example...
How to find hyperparameters (in Gaussian Process) by log marginal likelihood. Suppose we have mean function as $m=ax^2 +bx + c$. so we have $hyperparameters = \{a,b,c,sigma_y,sigma_n,l\}$; How we calculate all these parameters by log marginal likelihood and by partial derivatives?
An independent set is a set of vertices in a graph, no two of which are adjacent. A maximum independent set is a largest independent set for a given graph G. Is there a standard term for the size of the largest independent set in a given graph? If not, what short term can you suggest for this size? Maybe "independence ...
I have an array of lines in 1D represented by coordination and weight, it can be only positive weight. I want to find all the lines that intersect a point in a given range. Is there any efficient way of doing it?
Let L be the language of all arithmetic expressions written in Reverse Polish Notation, containing only binary operators. $\Sigma(L) = \{n, o\}$, n := number, o := operator. Is there an LL grammar G so that L(G) = L?
In long-multiplication, you shift and add, once for each $1$ bit in the lower number. Let $r = p \otimes q$ be an operation similar to multiplication, but slightly simpler: when expressed via long-multiplication, the addition does not carry. Essentially you bitwise-xor the shifted numbers. Like so: $$ \left[\begin{ma...
The following is a homework assignment. I am looking for criticism / feedback on my solution, and I have a specific question. Suppose $L$ is a language over $\Sigma$, and $x_1, x_2, ... , x_n$ are strings that are pairwise $L$-distinguishable. How many distinct strings are necessary in order to distinguish between the...
Continuing in the same vein as Carry-free multiplication operation, a followup question is as follows (differences in bold): Let $r = p \oplus q$ be an operation similar to multiplication, but slightly simpler: when expressed via long-multiplication the columns aren't summed up, but rather or'd (not xor) together. Noth...
For the following function (not in particular coding style or programming languange) f (N, y) // y is an integer such that 0 <= y < N { x = rand (N) // rand (N) returns a random integer x satisfying 0 <= x < N if (y == rand (N)) return else f (N, y) } I need to find bes...
Say that you have a program with only total functions, or if that is impossible, consider a subset of the program with only total functions. Is it theoretically possible to statically determine the maximum size of the stack frame at runtime? The language may have other characteristics that are relevant/necessary (such ...
I originally read that Alpha-Beta pruning has time complexity of $O(b\ ^{m/2}\ )$ with perfect ordering (where b = branching factor, m = maximum ply depth) but have recently come across claims that this can be reduced to $O(2\ ^{m/2}\ )$ with optimal ordering. Does anyone know of a proof for this claim?
From the book Computer organization and design by Patterson&Hennessy: Parity is a function in which the output depends on the number of 1s in in the input. For an even parity function, the output is 1 if the input has an even number of ones. Suppose a ROM is used to implement an even parity function with a 4-bit input...
I'm building a GUI Desktop application that will communicate with an API(http) in a webserver. In the client side I have a GUI Desktop application and a GSM Modem(hardware). The GUI Desktop application will make requests to the API in the webserver and will get the SMS's to send. My question here goes on how can I desi...
It is known that the temporal logics LTL,CTL,CTL* can be translated/embedded into the $\mu$-calculus. In other words, the (modal) $\mu$-calculus subsumes these logics, (i.e. it is more expressive.) Could you please explain/point me to papers/books that elaborate on this matter. In particular, are there concrete fairnes...
Its is known that 3SAT (all clauses have size 3) is NP-complete. But how about 1SAT (all clauses have size 1), is it also NP-complete? I tried searching for it a lot, but couldnt find any proofs or explanations for the same. Like 3SAT has 3 clauses, what if I consider just one clause? Thanks for the help in advance.
The question is to design a CFG for the language of words that have as many c's as the difference of numbers of a's and b's, that is $\qquad\displaystyle L = \{(a^l)(b^m)(c^n) \mid l, m \in \mathbb{N}; n = |l-m|\}$. I have so far go to create the cfg for $(a^l)(b^m)$ but don't know how to do the one for $(c^n)$. It loo...
Some priority queues, like the height-based leftist tree (or here) support merging in $\mathcal O\left(\log n\right)$ time. I am looking for a priority queue that merges in (expected|average|amortized|worst-case) sub-linear time, but also has the following properties: Elements are unique peek and pop should work in (e...
I stumbled upon this wikipage that has got this proof : I rechecked sum rule of differentiation. And i can not understand where is this wrong. Any Tips ? I think that the second line x^2 = x + x +... x times... being used for differentiation is wrong. but i am not sure .
Consider the next problem. Given a large oriented graph find its diameter: maximal length over all shortest directed paths between every pair of vertices. Graph is strongly connected. It is allowed to give lower and upper bounds on the answer. Time complexity should be linear or close to it. Suppose I solved the proble...
I am using the Vlagrind lackey tool to examine the full memory reference string of a running computer program and wonder what the difference between a "store" and a "modify" might be - and do these differences reflect a real difference in category of memory manipulation, or are they merely a convenience for the user/pr...
I know how a BIT works. But I was wondering if a BIT can be used to find the minimum/maximum element in the complete range, or more specifically, to find the minimum (or maximum) value after all the update processes have been completed. Now, I know that this can very well be achieved using Segment Trees, but is it poss...
At the Wikipedia article on time complexity, only a PRAM example is given for polylogarithmic time. Let $T(n)$ denote the largest number of steps used by a machine to reach a final state on any input with size $n$ bits. Is there a program for a standard sequential model of computation (e.g. a Turing machine or a seque...
(Before actually proceeding to the question, I want to confess that this is a homework question, please do consider it and help me in improving my understanding a bit more.) I have recently started learning computer organisation and architecture. I have gained fair understanding for how caches are organised, how mappin...
To continue this post, let us define the Monotone$(+, 2^-)$-SAT problem: Given a monotone CNF formula $F^+$, where each variable appears exactly once (as a positive literal), and a monotone 2-CNF formula $F_2^-$ defined on the same variables as $F^+$, where all variables are negated. Is $F^+ \land F_2^-$ satisfiable ?...
I've been trying to get a CFG for the language of all words with unequal numbers of a and b, i.e. $$\{u \in \{a, b\}^* \mid \text{number of occurrences of $a$ and $b$ in $u$ are unequal} \},$$ but it seems that I keep getting specific cases instead of the general case. Here are some that I have tried: (S being the star...
In the compiler course by Alex Aiken on Coursera, more specifically lecture 05-02 Context Free Grammars, the professor says that CFGs give answers of the type yes/no, i.e. whether the given string of tokens is valid or not. He adds that it is also desirable to know how a particular string of tokens is in the language;...
Given an orthogonal polygon (a polygon whose sides are parallel to the axes), I want to find the smallest set of interior-disjoint squares, whose union equals the polygon. I found several references to slightly different problems, such as: Covering an orthogonal polygon with squares - similar to my problem, but the co...
I'm trying to generate a random but realistic network topology so I can test the performance of some routing algorithms. I came across Waxman's model described in Routing of Multipoint Connections, which seems pretty simple: Distribute $N$ nodes randomly across a plane (uniform in x and y). For each pair of nodes, gen...
In my homework we're given the following problem: Determine whether the context-free language described by the following grammar is regular, showing all the reasoning steps: S -> T T | U T -> 0 T | T 0 | # U -> 0 U 0 0 | #. My teacher says the pound sign (#) is just a delimiter that is in the alphabet and not epsilon. ...
Here is the variation: We have some P piles of numbers,each having some pi numbers , and in each turn a player may choose a pile, and then a number from the chosen pile. All the numbers greater than equal to the chosen number are removed from the chosen pile. We have to determine, if the player moving first has a winn...
I've got a grid consisting of squares that is 3 squares high and N squares long. Some of the squares are filled with numbers that are not greater than 3*N. You can move only to squares that are below, above, on right, or left from you. When you move on a square, you fill that square with a number of the amount of move...
Given N numbers and M range queries (starting and ending points), I need to compute majority (most frequent element, if it exists) in these ranges. I'm looking for an algorithm that would answer queries in logarithmic or even constant time.
Let $\phi$ be a 3-CNF formula over variables $x_1,x_2,\ldots,x_n$. Every variable $x_i$, $i \in [n]$, occurs equally many times as a positive literal and as a negative literal in $\phi$. Is it NP-complete to decide the satisfiability of such a formula? Assuming it is, I would be interested in knowing if it has a speci...
I am learning LR(1) parsing from the Dragon Book. I am really confused with this sentence. Formally we say that a configuration $[A \to u•v, a]$ is valid for a viable prefix $α$ if there is a rightmost derivation $S \Rightarrow^* βAw \Rightarrow^* βuvw$ where $α = βu$ and either $a$ is the first symbol of $w$ or $w$ ...
Basically, how much math background do you need to understand how category theory is applied to Haskell? If you already have mathematical maturity, can you jump right into it, or should you be familiar with certain subjects in algebra?
I'm trying to prove that every language that is not the empty set or {0,1}* is complete for NL (nondeterministic logarithmic space) under polynomial-time Karp reductions. I'm really not sure how to even approach this problem or what languages are being discussed if you exclude both the empty set and {0,1}*. Any suggest...
I am stuck and having a hard time with this question. I want to construct a CFG for the language $$L = \{{a^lb^mc^n | l,m\in N, n=|l-m|\}}$$ I know that the language consists of strings where: 1. number of a's = number of b's, so c=0 2. number of a's more than number of b's, c=l-m 3. number of a's less than number of b...
I can't figure out a proof that recursive languages are closed under concatenation. I know this is easy for most of the people but unfortunately my professor is not very good at explaining the material. If anybody can provide any hints on how to do it I would greatly appreciate it.
Is there a proof or reference that $\left\{\text{MAX},\text{MIN}\right\}\text{-True-2-XOR-SAT}$ is $NP$-hard, or that it (the decision version) is in $P$? Let: $$\Phi\left(\mathbf x\right)={\huge\wedge}_{i}^{n}C_i,\\ \forall_{C_i} \left.C_i=(p \oplus q)\right|_{\left(p\in \mathbf x \vee\neg p\in\mathbf x\right),\left(q...
I'm a fledgling computer science scholar, and I'm being asked to write a paper which involves integer factorization. As a result, I'm having to look into Shor's algorithm on quantum computers. For the other algorithms, I was able to find specific equations to calculate the number of instructions of the algorithm for a ...
I'm trying to prove that the language SPACE TMSAT (where SPACE TMSAT = {⟨$M$, $w$, $1^n$⟩ : DTM $M$ accepts $w$ in space $n$}) is PSPACE-complete. My solution is as follows: SPACE TMSAT $= \{<M,w,1^{n}> :$ DTM $M$ accepts $w$ in space $n\}$ can only be computed by running machine $M$ on $w$. As this forces the allowanc...
What is the complexity of $\text{MIN-2-XOR-SAT}$ and $\text{MAX-2-XOR-SAT}$? Are they in P? Are they NP-hard? To formalize this more precisely, let $$\Phi\left(\mathbf x\right)={\huge\wedge}_{i}^{n}C_i,$$ where $\mathbf{x} = (x_1,\dots,x_m)$ and each clause $C_i$ is of the form $(x_i \oplus x_j)$ or $(x_i \oplus \neg...
The Monster M is the largest of the finite sporadic groups that arises in the classification of finite, simple groups in mathematics. M can be realized as a (very large!) set of 196882 X 196882 matrices with nothing more than entries of 1's and 0's, so long as we compute arithmetic as follows: 1+1=0 1+0=1+0=1 1*1=1 0*...
How to prove that if a language A is not regular then A* isn't regular either? I have tried the usual methods with no result.
Please tell me if my next optimization can work: I have symmetric, weighted, undirected graph, where it is knowen that the optimal tour, that visit all the vertices exactly once and return to the starting vertex, only contains edges with the weight of 1, it is also known that there is no edge with weight less than 1. M...
I'm looking for job sites in applied/interdisciplinary mathematics, more specially, say postdocs or higher positions in mathematics and medical imaging, mathematics and computer vision. I'm aware of mostly all the popular job sites, mathjobs, euro math jobs, jobs.ac.uk, nordic math jobs etc etc, but most of the jobs th...
This is a cross post from Stack Overflow, and DSP at Stackexchange since I cannot really decide which part of Stackexchange is most fitting. If this is the wrong place please tell me and I'll remove the question. I have a matrix with numerical data. The matrix contains values from 0 to an arbitrary integer value. Each ...
Let $T$ be a tree, and there is a weight function on the edges $w:E\to X$. $(X,\oplus)$ is a monoid structure. Define $f(u,v) = \bigoplus_{i=1}^k w(e_i)$, where $e_1,\ldots,e_k$ is the unique path from $u$ to $v$. Can we preprocess the tree, such that we can use linear space (or close to linear space), so we can answer...
The question asks to: construct a DFA which accepts exactly $\frac{n(n-1)(n-2)}{6} + \frac{n(n-1)}{2}+1$ many members of $\{0, 1\}^n$ for every n. I have no idea where to start to constructing the DFA, could you give some directions? By the way, how many states should this DFA have?
I would have a brief question about how to construct a Turing machine that is accepting only this language: $\qquad\displaystyle L_2 = \{a^i b^j \mid i \geq j \}$. I can't come up with any mechanism that would preserve that there are greater or equal number of 'a's than 'b's. Could you suggest me something?
I am learning about CS Theory and specifically Nondeterministic Finite Automata (NFA) right now. In my book I came across a section of text that discussed a way to determine the length of a walk stating specifically that : If a transition graph has a walk labeled $w$, then there is a walk w of length no more than $\La...
I have found an interesting exercise in my introduction to graphs workbook: Let $ad(G) = \frac{2\vert E(G)\vert}{\vert V(G) \vert}$ and $mad(G) = max\{ad(H): H\ is\ an\ induced\ subgraph\ of\ G\}$. Given a graph $G$ and a number $k \geq 3$, prove that if $\chi(G) > k \wedge mad(G) \leq k \Rightarrow \exists A \subseteq...
I'm currently taking an Algorithms course, and we are covering Backtracking, CSP, and heuristics. However, I'm getting confused on exactly the differences between these terms and their applications. When using Backtracking on a problem, I understand we are calculating the set of all allowable solutions to satisfy some ...
They have finite resources so they can be modeled by finite number of state what is the same that a finite state machine. There are any proof that it is not true? Thanks.
For functions or computations we have terms like: Deterministic – Determinism Pure – Purity Now what is the correct corresponding noun for side-effect-free? "Side-effect freeness"? "Side-effect freedom"? "Non-side-effective"?
I am trying to create a regular expression that will generate the following language under the {a,b,c} alphabet: all words that do not contain the substring "bbc" I am having a really hard time understanding how to approach this question. I have done several other questions where a certain substring must be excluded, b...
I have an array $A[]$ of size $L$, which contains numbers in the range $1 \ldots N$. Here $L>N$, so the array will contain repetitions. If $x,y$ are two numbers that are both present in the array, define the distance $d(x,y)$ to be the minimum difference in positions where $x,y$ appear, i.e., $$d(x,y) = \min \{|i-j| ...
It is well known that any CNF formula can be transform in polynomial time into a 3-CNF formula by using new variables (see here). If using new variables is not allowed, it is not always possible (take for instance the single clause formula : $(x_1 \lor x_2 \lor x_3 \lor x_4)$). Let define the (SAT to 3-SAT) problem :...
Let $S$ be a set of $n$ integers. Consider the following weighted permutations problem. Let $m<n$ be an integer. What is an efficient algorithm to enumerate all subsets of $m$ integers of $S$ such that they are listed in order of the sum of the integers in each subset? Each subset is a permutation, and each permutati...
I have an assignment where i need to create a Turing machine that decides an infinite language $L\subset \{0,1\}^*$ for which all $L'\subseteq L$, if $|L'|=\infty$, then $L'$ is not a regular language. I think this is not possible due to Rice's Theorem. It's not possible to tell for a Turing Machine if a language is re...
Let's say we have a sport, where many competitions are organized throughout the year. In these events, a set of people compete, although not every person competes in every event. I would like to categorize these people, and the events, in such a way that people in category $A$ performed well in the events of category $...
I want to be able to describe the idea behind the pushdown automaton (no tables or diagrams). So, I already know that $L = \{ ww \mid w \text{ in } (0,1)^*\}$ is not context free. Since CFL are not closed under complement its complement $L'$ is a CFL. I also read somewhere that any odd word is part of $L'$ (what abou...
Suppose I have an undirected graph which is stored as an adjacency matrix. The graph contains a single cycle; all other vertices are isolated. How can I efficiently find the length of the cycle? The best I've been able to come up with: Starting at row 0 of the matrix, traverse through rows until an initial 1 is found,...
I'm playing around with tournaments and currently have the problem that I need to check whether a given subset of the edges of a tournament is transitive (it need not be acyclic). I'm aware that I can always take the transitive closure of the edge set and see whether it terminates without adding a single edge or not, b...
It is said in the book Artificial Intelligence: A Modern Approach for finding a solution on a tree using BFS that: breadth-first search is optimal if the path cost is a nondecreasing function of the depth of the node. The most common such scenario is that all actions have the same cost. From that I understand that...
Let's say I have a 11x11 grid with a few points (around 8) marked in the grid. One of the points is in the center cell. Call it point P. I choose a point other than P and connect it with a line segment to P. Call that point C1 I choose another point that is not C1 and connect it with a line segment to P. Call that poin...
Let $P$ be the predicate on natural numbers defined by $P(x) \iff \varphi_x(x) = 1$ where $\varphi_x$ is the $x$-th computable function. Show that $P$ is not computable.
I am aware of a logarithmic-time algorithm to maintain the connected components of graphs in the Euclidean plane (D. Eppstein, GF Italiano, R. Tamassia, RE Tarjan, J. Westbrook, and M. Yung. Maintenance of a minimum spanning forest in a dynamic plane graph. J. Algorithms, 13 (1): 33 {54, 1992.). Does anyone know if the...
Let say I have a pda : δ(q1,a,Z)=(q2,aZ) δ(q2,a,aZ)=(q2,bZ) Is this allowed.... you can see that in δ(q2,a,aZ)=(q2,bZ), we are basically popping 'a' and pushing 'b' for a single transition... Is this allowed for PDA ??