instruction
stringlengths
35
29.1k
I have a little history question, namely, as the title says, I am looking for early uses of trees (as a data structure, search tree, whatever) in computer science.
I'm wondering how to detect English plurals in natural language sentences. Such as: fish computers houses ... Using Earley parsing I'm able to get to the s or no-s, but I have difficulties in understanding how to figure out whether the ending s is because the word is in plural form. Or whether with no-s the word is in ...
I have been given a task to dynamically learn the optimum value of a parameter in a Heuristics Filtering Algorithm used in a tool. The accuracy of the tool increase as the value of K in the heuristics filtering algorithm increases. How ever a lower K leads the tool towards a low resource consumption (memory, time and t...
I wonder whether context-free grammar (or what else?) can be used to implement "member of" structures, which describe that something is a member of something. For example, I want to be able to infer the statement: John Lennon is in Beatles. The inferring process should return True since in the grammar John Lennon has...
We have $\Sigma =\{0\}$ and $$L=\{0^{2^n} \mid n\ge 0\}$$ How to prove that $L$ is irregular by using Myhill–Nerode theorem? At other languages with $\Sigma >1$ we can usually separate the word or something like this with combination and this how we can show that two words are not at the same equivalent class.... But w...
In RSA Crypto System we choose p and q such that they are distinct primes. Calculate n=pq and phi=(p-1)(q-1). Then e is chosen for public key (n,e) s.t. gcd(e,phi)=1
While learning depth first traversal, I realise there are two approaches that are followed. Method 1. The first one is as given in the Forouzan's book is as follows: Push the initial node onto the stack Pop the stack Process the popped out node Push all its adjacent nodes onto the vertex Go to step 2. Method 2. Then...
Suppose I have three qubits that of course represent $2^3=8$ states. I want to put these qubits so that they are in the particular superposition say... $$a|000\rangle + b|001\rangle + c|010\rangle + d|011\rangle + e|100\rangle + f|101\rangle + g|110\rangle + h|111\rangle\,.$$ Here's the question: do I perform a 2d rot...
I really enjoy reading up on algorithms and data structures and in the course of doing so often come across ones that rely on $k$-wise independent families of hash functions. I'm perfectly comfortable working with these families of hash functions as black boxes (that is, I understand the relevant definitions and how th...
Let's say that I want to map some string of binary digits to a single binary digit of output, like the below: $ \begin{array}{l|l} \text{Input}&\text{Output}\\ \hline 0001&0\\ 0011&1\\ 0111&0\\ 1111&1 \end{array} $ If inputs besides those listed are given, I don't care what the output is. I only care about the inputs ...
What are common models for creating rules for inferring meanings (e.g. truth values) of natural language statements such as if one wanted to infer the truth value of the input statement John Lennon is in Beatles. which would depend on, whether the model "knew" John Lennon is in Beatles.
My approach Let L ∈ P $\exists$ Turing Machine $M_1$ which decides L. We can easily construct $M_2$ which decides $\bar{L}$ $\bar{L}$ ∈ CO-NP $\implies$ P ⊆ Co-NP I'm not sure whether its a correct way to prove this or not. I found this method here Link
Consider a maximum flow problem, where each edge has a small integer capacity. Now, I want a solution that for each edge uses the entire capacity, or no flow through that edge at all. To avoid the subset-sum problem, the capacities are small. Is this solvable in polynomial time or is it NP-Complete?
I need to create a graph generator for my next project. Generally algorithms are trying to find a Hamiltonian path in a graph. So I can create a graph generator, generate a graph, and then I can decide whether the graph has a Hamiltonian path or not. If not, I can regenerate the graph but this is not a cool way. I want...
I am not sure that the problem is in general solvable, but here's an example of what I mean: Any context-free language has a trivial regular language that contains it: $\Sigma^*$. The language $L_1=\{a^nb^n\;|\;n\geq 0\}$ is contained in $L_2=\{a^nb^m\;|\;n,m\geq 0\}$, which is obviously a subset of $\Sigma^*$. Quest...
I'm trying to learn about graph isomorphism and I stumbled upon coloring. When given 2 graphs, you give each vertex a color according to properties of their neighbors and any vertex on graph 1 can only map to any vertex on graph 2 with the same color. This way you cannot have false negatives (if the algorithm says ther...
We mainly study about heap and stack data structures which act as storage allocation area in memory. Is it that queue is also a storage allocation area in memory? As far as I know, process control blocks are made in OS region and actually they also act as storage allocation area only so can I consider queue to be a sto...
Given an input item (N bytes), I'm looking for a function that will map this to an output (still N bytes). The function should have the following qualities: It should be 1-to-1 so that all inputs map to some output and so that no two inputs map to the same output. Given an output element it should be difficult to gue...
I'm trying to figure out the different way we obtain an MST with a brute force Prim's algorithm compared to the optimized version based on priority queues. Given a graph $G=(V,E)$, the former can be stated as in Dasgupta et al.: X = {} while(|X| < |V-1|) pick a subset S of V for which X has no edges between S and V-S...
The algorithm is as follows: MST-PRIM(G,w,r) 1 for each u ∈ G.V //initialization 2 u.key = ∞ 3 u.π = NIL 4 r.key = 0 5 Q = G.V //end initialization 6 while Q ≠ ∅ 7 u = EXTRACT-MIN(Q) 8 for each v ∈ G.Adj[u] 9 if v ∈ Q and w(u,v) < v.key 10 v.π = u 11 v....
Find whether given statement True or False? Explain. User level threads are transparent to the kernel? My attempt : False. Since, user level threads are managed by a user level library however, they still require a kernel system call to operate. It does not mean that the kernel knows anything about thread management...
The problem is that of spatially (with or without a fixed spatial dimension) organizing a graph so that each node becomes a cell in a grid, and each edge becomes a line, such that the total combined length of all lines (edges) is the minimal. I want to know if that problem has a name, and how complex it is. I also woul...
I am trying to make sense of the following: Taken from the MIT website. So I understand that we want to maximize the distance between the planes H0 and H1, where H0 is defined as wx+b=0 and H1 is defined as wx+b=1. I am following with the definition that the distance betweena point (x0,y0) and a line Ax+By+c=0 is |Ax0...
In the definition of 3-PARTITION of Garey&Johnson, the instance is a set of $3m$ integers such that the sum of all these integers is $mB$ and such that each integer is strictly between $B/4$ and $B/2$. This problem is strongly NP-hard. The special case DISTINCT 3-PARTITION when all the integers are distinct has been st...
I have the following #P-complete problem: Given an alphabet $\Sigma$ and a matrix $M$ where each entry can be a symbol from $\Sigma$ or the wildcard symbol $*$, find the number of strings $s$ with the property that there exists $i$ such that for all $j$, $M_{i,j} \neq *$ implies $s_j = M_{i,j}$. Example: If $\Sigma = \...
Is a singly-linked list that contains a cycle considered a corrupted data structure or is there some practical use for it? (You could argue that a car without its front shield is not corrupted, if the owner intends for it to be like that, so lets understand the word "corrupted" in a sense of "damaged into state that it...
We sometimes hear "Swift doesn't do classic (tracing) GC, it uses ARC." But I'm not sure if there is anything in the Swift semantics that requires reference counting. It seems that one could build one's own Swift compiler and runtime to use tracing GC. So what exactly is "reference-counted" about Swift? Apple's impleme...
Karnaugh maps and the Quine–McCluskey algorithm can be good choices for coming up with fairly minimal logical expressions that match the requirements of a truth table. What if I have a situation where I have $M$ input bits and $N$ output bits though? A naive way to deal with it would be to solve each output bit indepen...
In trying to understand the Halting Problem better, I am trying to come up with classes of provably non-terminating programs. For example, any program (including input) which leads to a finite-length infinite loop (with perfectly repeating state+tape) should be detectable. That leaves mostly induction/search problems ...
To me it looks that it is: irreflexivity: NaN < NaN == false transitivity: if a < b and b < c then a < c (the antecedent is never true for NaNs) asymmetry: if a < b then not b < a (again, the antecedent is never true for NaNs) However, it cannot be extended to non-strict partial ordering <= because there's no (reflex...
PDA for a Language L = { $a^i b^j \mid i \neq 2j+1 \}$ over the Alphabet $\Sigma = \{a,b\}$ If it can be constructed, how? Edit : I've tried make the PDA for $$L = \{ a^i b^j \mid i = 2j+1 \}$$ (with the intention of editing the PDA to accept if $a$ or $b$ is leftover) but can't figure out how to push the proper number...
I am reading a book called Principles of Computer Science (2008), by Carl Reynolds and Paul Tymann (published by Schaum's Outlines). The second chapter introduces algorithms with an example of a sequential search which simply iterates through a list of names and returns TRUE if a given name is found in the list. The au...
I think this question arises from not having a clear idea on encoding. So, If I have a problem intuitively there may be many ways of encoding it using TM's alphabet set. Slight variation in the encoding may(intuitively) not affect the computability of the problem, Is it true? Can I have a computable problem which on ch...
I've been reading about attribute grammars since I'm trying to extend CFGs to semantics. What I'm finding difficult to grasp is the use of the word "semantics" in the context of attribute grammars. For example here: One can see the term semantic rule. But isn't this just arithmetic?What semantical is here? Can you giv...
Just wondering if something like this... (λx. y)((λx. (x x))(λx. (x x))) Would be considered to be in normal form since it terminates with y if done by normal order but does not terminate if done by applicative order
For any three-dimensional array $A$ of size $n_1 \times n_2 \times n_3$ let $P(A)$ be the product of all its elements, i.e. $$P(A) = \prod_{i_1 = 1}^{n_1} \prod_{i_2 = 1}^{n_2} \prod_{i_3 = 1}^{n_3} a_{i_1,i_2,i_3}.$$ A subarray (cf. submatrix) of $A$ is given deleting rows in any of the tree dimensions. For e.g. the $...
How would I add 0.0.15.255 to 172.1.6.255, talking about IPv4 networks here. I have done things like 192.168.1.15 plus 0.0.1.30 to be 192.168.2.45. but when it goes over the limit of 255, I just do not now how to do this... Help? This is the what I am assigned to do: I am given the block of adresses 172.16.0.0. and am...
Here are three examples of questions I run into. I'm not looking for solutions. If $L$ is CFL then $L' = \{ ww^R | w \in L \}$ is non-regular. If $L$ is non-regular then $L' = \{ ww^R | w \in L \}$ is non-regular too. If $L_2, L_3, L_4$ are regular languages and $L_1 \cup L_2 = L_3$ and $L_1 \cap L_2 = L_4$, then $L_...
Given a directed graph $G$, we want a (simple) cycle in $G$ of maximal length. The cycle does not need to be an induced subgraph of $G$. What is known about this optimization problem? Do we know its complexity? Is it much harder than the decision problem of detecting a Hamiltonian cycle? How well-approximable is the pr...
I was looking at the basic genetic algorithm here http://www.ai-junkie.com/ga/intro/gat1.html But I have some questions about things I didn't get. To reiterate: You have a problem you want a good enough solution to. You create N random solutions (encoded as bits of 0 and 1) You evaluate a fitness or score for each for...
I want to express the following constraint, in an integer linear program: $$y = \begin{cases} 0 &\text{if } x=0\\ 1 &\text{if } x\ne 0. \end{cases}$$ I already have the integer variables $x,y$ and I'm promised that $-100 \le x \le 100$. How can I express the above constraint, in a form suitable for use with an integer...
I have a set of propositions, for example $\{a_1,a_2,\dots,a_n\}$. Some propositions depend on others (for example, $a_1,a_2\Rightarrow a_3$, means if $a_1,a_2$ are true, then $a_3$ is true). I want to find a subset of the propositions to be defined as axioms, in the sense that, these propositions being true imply that...
I am looking for a method to classify pixels into three groups: (1) Pixels which does not change their intensity much in general (the slight changes may be due to noise only), (2) Pixels which change their intensity very slowly, in general monotonically and gradually, and (3) Pixels which change their intensity drastic...
Let's consider 3SAT, so we have clauses like: (A or B or C) and (A or not B or D) and ... If we distribute the "and" over the first two clauses, we get the disjunction of: A and A --> simplifies to A A and not B A and D B and A B and not B --> simplifies to false B and D ...
I made a GANN program for evolving creatures. The genes that get put into the GA for each ind are the weights that go into the neural net for each creature. The NN is a basic 1 hidden layer NN with bias neurons and it uses TANH so the weights are from -1 to 1. The GA uses .8 crossover rate (.3 elitism) and .003 mutatio...
How can a 4-bit two's complement operation be implemented using only boolean logic gates (AND, OR, NOR, NOT, NAND, XOR, and XNOR)? (This question was redirected to CS from Stack Overflow)
I saw a proof of reduction of hamiltonian path to spanning tree with inner vertices having degree of k. The person, who proved it, constructed a spanning tree from a hamiltonian path, basically u-x1-...-xi-...-xn-v, and where xi are inner vertices and then appended k-2 leaves to each one of those vertices. I understand...
Given $n$ variables and a function $f$ such that $f(v) = N(v) + D(v)$, where $N$ and $D$ are the subfunctions of function $f$. Function $f$, can be considered as an oracle. Query: let $v \in P$, approximate/find the minimum value that $f$ could take over all possible configurations of $v$. For e.g., if 4 variables are ...
I am given an "almost sorted" array with the condition that each element is no more than $k$ places away from its position in the sorted array. I need to show that it is impossible to sort this array in sublinear time asymptotically. My proof is to suppose a sorted array of length $n$. Now assume that every second el...
I am designing a game solver. I have a binary $m*n$ Matrix, where $0$ stands for a free space, while $1$ stands for an occupied space. In the game we move a ball that we will call $x$. The ball can only move UP, DOWN, RIGHT or LEFT (no diagonal). Imagine the following matrix: $ 1 0 0\\ 0 1 0\\ x 0 1 $ We see that the b...
I have a set of n numbers whose average (arithmetic mean) is x. I have to choose a subset of k numbers from n such that its average is closest to x. Please note that k is the upper bound. If the average can be represented with less than k numbers, then that set is chosen. For example: set = {1, 2, 3, 4, 5, 6} (n = 6) (...
Given a string $s$, I would like to find the longest repeating (at least twice) subsequence. That is, I would like to find a string $w$ which is a subsequence (doesn't have to be a contiguous) of $s$ such that $w=w' \cdot w' $. That is, $w$ is a string whose halves appear twice in a row. Note that $w$ is a subsequence ...
What will be the number of states in minimal NFA that can be designed to accept the language $L = \left \{ \epsilon \right \}$ having a non empty alphabet set? My friends are saying that this can be done using $1$ state, make the only state start state & final state without any transitions. But will not thi...
This is a problem I'm having reading Arora & Barak's book, page 378-379. They define: For two words $x, y \in \{0, 1\}^m$, the fractional Hamming distance of $x$ and $y$ is equal to the fraction of bits on which they differ, i.e. $\frac{1}{m} \cdot |\{i : x_i \neq y_i\}|$, where the $x_i$ refers to the $i$-th ...
why do we use the word optimal in case of optimal sub-structure , I guess in case of divide and conquer also we have sub-problems and they too when merged together provide the solution for entire problem .So what is the difference in terminology of sub-problems in divide and conquer and dynamic programming except for t...
$$L = \{\langle M,w\rangle \mid \text{\(M\) accepts \(w\) only}\}$$ How can I prove this language is unacceptable (unrecognisable)? I think I should use a reduction, I'm not sure how.
I'm reading Cormen, Leiserson, Rivest and Stein, Introduction to Algorithms, Appendix A, page 1152. They discuss a method called "Splitting Summations", where they split the summation and bound each term separately. For example, $$\begin{align*} \sum_{k=1}^{n} k &= \sum_{k=1}^{n/2} k + \sum_{k=n/2 + 1}^{n} k\\ &\geq \s...
I have read about Von-neumann self replication from Theory of Self-reproducing automata, which are lecture notes reconstructed from lectures in book of the same name. Theory of Self-reproducing automata Its looks really interesting that neumann has formalize this even far before the discovery of DNA. I'm looking the ...
This is a conceptual issue that I am having in designing an algorithm for a memory allocator that works in conjunction with memory pooling. Free blocks are put on one of several free lists within the pool. The size of the block determines which list it is on. The question is how to figure out if the adjacent physica...
Does the same barriers of relativization, natural proofs and algebrization affect a possible $VP\neq VNP$ proof? How do existing strategies try to overcome these?
Given cartesian coordinates $x$ and $y$ as input, can a neural network output $r$ and $\theta$, the equivalent polar coordinates? This would seem to require an approximation of the pythagorean theorem (which requires approximations of $x^2$ and $\sqrt{x}$) and $\sin$, $\cos$, or $\tan$ approximations. Is this possible?...
It is kind of NP-complete problem. For example, A problem: Given a sequence of numbers, return the maximum value within these numbers. B problem: Given a sequence of numbers, return start index and end index of the maximum sum segment within these numbers. To show how to reduce A problem to B problem in O(n) time...
Is it valid (in the sense of formal grammars or formal language theory) to refer to outside of the grammar in attribute grammars? What I mean is that since attribute grammars can contain semantic functions e.g. E1 → E2+T { E1.val := sum(E2.val, T.val) } then could there (in the place of the sum function) be a functio...
For example: If the XOR operation on two languages, A and B, is described as: $A\;\mathrm{XOR}\;B = (A \cup B) \setminus (A \cap B)$, 1) How can we prove that the set of enumerable languages is closed under the XOR operation? 2) How can we prove that the set of decidable languages is closed under the XOR operation?
I know that $\emptyset$ is a an empty language, i.e. language containing no string. A law involving empty language is: $\emptyset L = L\emptyset = \emptyset$ It correctly states that we cannot concatenate non empty language $L$ with a language $\emptyset$ containing no string (as their is no string to concatenate i...
Let me clear first that I am not asking about parallel (data/task) or distributed computing architecture. A lot had been discussed here. I am just asking a plain theoretical question. What is core principal difference between Parallel and Distributed Algorithms? Below are my under standings: In parallel algorithms (tas...
This particular code is written in C. double foo(n) { int sum=0,i; if(n==0) return 1; else for(i=0;i<n;i++) sum+=foo(i); return sum; } The Question given is: Calculate the space complexity of the following function. My Solution: foo(x) never occupies more than x cells on the c...
Assuming there is a machine which can effectively calculate functions not computable by a TM (or the Church-Turing thesis as false) What can we say about aTM solving a problem encoded by this machine... Q1. Is there a not trivial example of a Turing decidable problem which still remains decidable once encoded with a n...
Production is said to be of the form $u \to v$. I want to know if you distinguish $u$ from $v$ giving them some distinguishing names, like LHS/RHS or something alike.
I had a question about altering a text file. I have data in the following format. 1 a,b,c 2 d,e 3 a, l, m,n Note that some of them have spaces after the coma Now I have to resort the data in the following format 1 a 1 b 1 c 2 d 2 e 3 a 3 l 3 m 3 n Now my plan is to first parse the data, and hold a count of how many...
Input: Planar graph $G$ and its embedding in sphere $\Pi$, edges $e, f \in E(G)$ and integer $k$. Output: The set of closed walks in $G$ using $e$ and $f$ which contains $k$ faces of $G$. In other words the set of close walks in $G$ via $e$ and $f$ which each one partition $\Pi$ into two set of faces which one is of si...
I am experimenting with implementing minimal LR(1) algorithms/techniques, but I find it very difficult to verify the correctness of what I've implemented. Is there a fast algorithm to determine if two LR(1) action/goto tables accept the same language, given that they use the same grammar rules? Or preferably a stronger...
Problem: You are to collect a total of $N$ litres of red and $M$ litres of blue liquid. For doing job $i$ for time $t$, you get $a_i t$ litres of red and $b_i t$ litres of blue liquid. $t$ need not be an integer. At a time you can only do one job. You can choose some (or all) of the jobs and do it for your desired ti...
Is there any other options of calculating integral instead of using quadratures? I know that also we can calculate spline function or use monte-carlo method but do you know something else?
I'm looking to do natural language parsing and looking for how the CFG (or CSG) should be defined for English. Surely one'd expect to find one from the internet already, but do you know where? It needs to be in "formal grammar" form, not an implementation (e.g. a Python library). It has to allow for as wide range of s...
Given string $S$ of length $n$, count the number of distinct permutations $P_n$ of a string of length $2n$ such that each of them contains $S$ twice as an interwoven subsequence. Example. $S=abc$. There are 5 permutations: $abcabc$, $abacbc$, $ababcc$, $aabcbc$, $aabbcc$. If each character of $S$ appears only once, the...
There is such a grammar string_literal ::= " { graphic_character } " The double-quotes that you see must appear in the user program and curly braces mean "any number of graphic characters in the string". The characters are defined further graphic_character ::= basic_graphic_character | lower_case_letter | other_speci...
I'm developing a program that has some entities (things) that are "classified" according to "relevancy". Sort of like search engine (think PageRank). Therefore, I'm looking to implement an automaton, which I think should handle "value hierarchies". What I mean is that each "next possible state" should have a value that...
I am having data where I would be given customers and there priorities. The priority would be food type and there flavours. In total there are N food type and 2 flavour (spicy and non spicy) so in total there are 2N choices to make. Each of the customer has a set of food types they like and they are satisfied if there...
I've just found the finite state transducer. Since the FST processes two tapes: one for input, one for output, shouldn't it be possible to use FST to "pack together" some compiler stages, such as Syntactic Analysis and Semantic Analysis. The FST could take in tokens and output semantically analysed code.
I have a directed graph that has a source node and a sink node and a subset of marked edges. I need to find a path from source to sink that contains at least one marked edge and is cycle-free.
Let $h$ be the homomorphism defined by $$ h(a) = \mathtt{01}, \quad h(b) = \mathtt{10}, \quad h(c) = \mathtt{0}, \quad h(d) = \mathtt{1} $$ and extended to strings in the usual way. Then the inverse function $h^{-1}$ is defined by $$ h^{-1}(w) = \{z\in\{a,b,c,d\}^*\mid h(z)=w\} $$ for any $w\in\{0,1\}^*$. For any such ...
I'm interested in how fast SVMs can classify new data with $c \in \mathbb{N}_{\geq 2}$ classes and $n \in \mathbb{N}_{\geq 1}$ features. Example for Neural Networks For neural networks, this depends very much on the architecture. For supposing you only have one hidden layer with $3n$ neurons, you would have a $n:3n:c$ ...
I want to know how far a type system in a programming language can be beneficial. For example, I know that in a dependently typed programming language, we can create a Vector class incorporating size of the vector in the type signature. It is like a de-facto example. We can also write a function append using those sign...
In NLP, does the lexer have to tag the tokens before the parser? I.e. does the lexer have to classify the tokens to morphological categories before the parser? I'm thinking yes, but is this also the only way to do the parsing?
Every undecidable problem that I know of falls into one of the following categories: Problems that are undecidable because of diagonalization (indirect self-reference). These problems, like the halting problem, are undecidable because you could use a purported decider for the language to construct a TM whose behavior ...
I'm speculating that this is very much known in NLP, but as I've not studied NLP, I don't know what concepts are related to this: Basically I have entities that are connected by some strings. I want to do semantic analysis using this kind of constructs. I.e. by checking whether a given sentence has entities (the yello...
How does the NFA decide in a state where there are multiple equally valid "next states"? Such as here: How does it decide on which state it takes to with 1?
Is there a way to randomly shuffle an array using only a source of random boolean values? SO to clarify, shuffle using true /false only, and not integers or decimals. For this question, I'm specifically excluding an approach whereby the booleans are just arranged into an integer and then it's used in a Fisher-Yates sh...
E.g. the algorithmic problem of sorting: input: sequence of some objects; output: reordering of sequences such that some relation works for each next element of a sequence. Right? So what's the instance of a problem? So instance could be: input type: integers; relation in the output: $\geq$. or instance is some spec...
In the Wikipedia page on the Karp–Lipton theorem it is mentioned that $$\Sigma_2\not\subseteq\mathsf{SIZE}(n^k)$$ (which is known) is not same as $$\Sigma_2\not\subseteq\mathsf{P/Poly}$$ (which is open). I was of the opinion $\mathsf{P/Poly}$ referred to polynomial size circuits which seems same as $\mathsf{SIZE}(n^k)$...
I have just completed a dynamic programming exercise on LeetCode (Coin Change). I tried a top down approach, but it failed for the larger inputs, whereas the bottom up approach worked for all inputs. Is the top down approach significantly slower because of the recursion? I thought that bottom up approaches needed to co...
I am given $n$ lines, in the form $y=ax+b$, where there are no two lines with the same $a$ no three lines intersect in the same point no vertical lines I need to find in time $O(n\log n)$ an $x'$ such that for any $x>x'$ there are no line intersections with that $x$ value. For example consider the lines on the imag...
Let: $$S \to AC \mid BC\\ A \to aAb \mid aA \mid a\\ B \to aBb \mid Bb \mid b\\ C \to Cc \mid c$$ I need to find if: the word $aabbbcc $ is in the grammer, and if so to write a very left series, and the tree. what is the languege that the grammer creates? to tell if the grammer is ambiguous My try: Yes, $aabbbcc$...
It is said that attributes supply some semantic information to the grammar. Meantime, the same attributes let you to resolve ambiguities. Text books agree that it is worth haveing a CF grammar which admits ambiguities because the ambiguities will go away anyway once you evaluate your AST with attributes anyway. For thi...
TL;DR Which sort algorithm: Works in multiple passes. Performs less and less of the total work at each subsequent pass. When visualized, makes it clear that the decreasing amount of work at each stage is the result of "reaping the benefits" of the work done in previous stages. The Long version My nephew is having tro...
Histograms of oriented gradients for human detection seems to be the paper from which all other papers cite when they use HOG features. However, this was the only description I could find in it: [...] In practice this is implemented by dividing the image window into small spatial regions (“cells”), for each cell acc...
I want to extract "best" sentences from the given (html) documents. Let me illustrate this with an example. I have a word "determine". Now I have hundreds of html files having paragraphs and sentences that contain this word. Out of those sentences, I want to collect and score only those that are capable of describing o...
My problem is the following: Input: a set of $m$ non-negative integers $\{b_1,...,b_m\}$ and a parameter $n$ with $n<m$. Output: $n$ sets of 3 numbers Task: Cut the $b_i$'s into $3n$ integers such that we can gather these numbers in $n$ sets of 3 elements where all the elements in a set are the same. Example (with $m=4...
Since Regular languages $\subset$ Context-free languages, then Regular languages are Context-free languages? Why is the terminology so different then? To me these seem like a totally different class of languages, based on the terminology, even though they're "variations" of Context-free languages. How about calling Reg...