instruction
stringlengths
35
29.1k
There're some existing tree layout algorithms such as Tidier Drawings of Trees and Drawing Non-layered Tidy Trees in Linear Time. I call them as automatic layout algorithms since positions of nodes are determined entirely by the algorithm instead of the user. Now I need an algorithm that allows positions of some nodes ...
How can one show that there exist Boolean functions on $n$ inputs which require at least $2^n/\log{n}$ logic gates to compute? This problem was originally stated in Exercise 3.16 of Nielsen & Chuang's Quantum Computation and Quantum Information.
I know that it is true for NFAs. It seems similar.
You are given an array of length $n$. Each element of the array belongs to one of $K$ classes. You are supposed to rearrange the array using minimum number of swap operations so that all elements from the same class are always grouped together, that is they form a contiguous subarray. For example: $$ \begin{align*} &[2...
I am looking for algorithmic techniques to solve the Subset Sum Problem in pseudopolynomial time. There is, of course, a textbook dynamic programming approach for Subset Sum. Have any other algorithmic techniques (Randomized, Linear Programming...) been successfully applied to this problem? In [1], the authors state th...
I have a very large number of constraints such as: $ A1 \land B1 \land C1 \land D1 \land E1 \land F1$ $ A2 \land B2 \land C2 \land D2 \land E2 \land F2$ $ A3 \land B3 \land C3 \land D3 \land E3 \land F3$ $ A4 \land B4 \land C4 \land D4 \land E4 \land F4$ Here a constraint is a condition. For example, A1 is (response ...
I am trying to find a good model the following problem: Given a collection of work packets x, y, z, ..., and a collection of worker nodes A, B, C, ..., assign packets to nodes. Each work packet has an affinity per worker-node, shown as a cost-value for how long a packet takes to process on a specific node. For example,...
I'm a fresh year Computer Science student. Our teacher gave us damerau levenshtein distance algorithm pseudo code (which he got from Wikipedia apparently) and asked us to explain how the algorithm works step by step. I've been looking around the net to find an article about that but nothing that explain how the algorit...
I want to know where can I find some resources on this question, because, after researching for a day and half, I couldn't find information specific to my question. Can anyone help me answer my question? I know that dynamic data structures (such as linked lists) can expand the amount of nodes at runtime, but if that's ...
I do know what a "left-most-" and a "right-most derivation" is, but I stumble across the term "sentential form" and its specific differences "right-sentential form" as well as "left-sentential form" and I just don't understand what is meant with this term. Is the concept "sentential form" so different from the concept ...
A summed-area table is a data structure and algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid [Wikipedia]. Is there any algorithm for quickly and efficiently generating the sum of values in a circular subset of a grid?
As an example, the sRGB Gamut is 256 x 256 x 256 (all powers of 2). I'm aware that computers are generally binary. However, is it simply a matter of simplicity that sRGB was made this way, or was it ESSENTIAL? After all, it probably could've safely provided just as many detectable colors with 192 X 192 X 192.
I'm working on an algorithm and there is an optimization I applied that is unpredictable because it depends on calculations done on top of the input trough several iterations, so as the input values change, the optimization gain oscillates (between a 20% to 90% step count reduction) as is adaptive to the input. Is ther...
Given three positive integers $a, b$ and $c$, my task to find the smallest positive integer $k$ such that $(k * a) \mod b = c$. I can obviously try values of $k$ from $1$ and higher, until I find the right value. My question is, can this computation be done in $O(1)$ time? That is, is there a direct way to calculate th...
To present interesting type-0 grammars to my students, I am looking for a very simple example of a type-0 language (=recursively enumerable language) that is not of type-1 (=not context sensitive). I am hoping for a language that is generated by a very small grammar, like two or three very short production rules or som...
I have seen in most of the places written that LL grammars form a subset of DCFL and DCFG. Is there a proof for that?
Assume that $x_1,\dots,x_n$ are $n$ integer variables which takes values in a subset of given numbers, say $x_i\in\{5,6,\dots,5000\}$. Let $f_i(x_i)$ and $g_i(x_i)$ both be non-decreasing non-negative functions of $x_i$. Values of both functions are given for all values of $x_i$. Now consider the optimization problem ...
Within my research of term rewriting systems (TRS) I stumbled upon a paper (Siekmann, J., and P. Szabó. “The Undecidability of the DA-Unification Problem.” The Journal of Symbolic Logic, vol. 54, no. 2, 1989, pp. 402–414. JSTOR, JSTOR, www.jstor.org/stable/2274856.) that stated the following: We show that the DA-unifi...
I am competing in a programming contest where the submission phase can be stated abstractly as follows : There is a known universe set, $U$, and a hidden target $T \subset U$. I submit $S \subset U$, and for feedback I am given $|S \cap T|$. What is a good/optimal strategy for finding $T$ in as few submissions as poss...
There are several versions of the definitions of the FST and the Mealy machine. Some of the definitions are almost same. Some have a little differences. But it seems that they both are a kind of DFA with an output function $G \colon \Sigma \times Q \rightarrow \Gamma \times Q$, where $\Sigma$ is the input alphabet and...
We say that "An algorithm is a $\beta$-approximation to problem $X$, if for any instance of problem $X$, the solution returned by this algorithm is within a factor $\beta$ of the optimal solution". Now assume that we have a $\log(N)$-approximation algorithm (called it Alg 1) for problem $X$ where $N$ is the size of pro...
I have an algorithm which searches a sorted int array for two elements which sum up to a searched value. First I thought that the complexity is $\mathcal{O}(n)$, but the interpolation search algorithm has a similar approach and has a $\mathcal{O}(\log(log(n)))$ complexity with uniform distributed elements. Which is th...
I have an algorithm which computes the size of maximum independent set of a graph $G(V, E)$. Let $n=|V|$ be the number vertices, $m=|E|$ be number of edges, and denote the size of maximum independent set of the graph $G$ as $\alpha(G)$ . Now, I want to estimate the worst-case running time the algorithm needs to compute...
In competitive programming there is a trick for storing a set of strings(or objects really) to reduce memory - you only keep the hashes of the strings in a hash-table (usually as 32 or 64 bit integers). This data structure has the same properties as a Bloom filter. You never have false negatives but you can have false ...
[Cross-posted from Math SE - apologies if this is not appropriate.] I just read these excellent lecture notes by Scott Aaronson, and I found the second homework problem at the end to be incredibly thought-provoking (this course was offered over ten years ago, so I think it's now safe to discuss the homework online): L...
Consider the following game: Two players choose numbers from a sequence of integers with even number of elements. The two can only choose from either the front or the end of the sequence. The purpose is to pick a series of numbers that form a sum greater than the opponent's. The first player always starts and tries to ...
I understand that DCFL they are not closed under concatenation or Union. As without non determinism, PDA cannot decide when to jump to the next one in case of concatenation and without epsilon moves Union is not possible. However, DCFL is a proper subset of CFL (unambiguous) and CFL is closed under union and concatenat...
I am trying to prove the following algorithm to be correct: Sum(A[1..n], s)= sum = 0 for r=1 to s i = some random index i in interval [1, n] sum = sum + A[i] return n(sum/s) where A is an array consisting of $n$ integers, where each integer A[i] belongs to the interval $[1, M]$ and $s=1/\...
Suppose we solve dictionary matching problem for $d$ patterns with the Aho-Corasick algorithm. Then our main data structure consists of a trie with $n$ vertices and auxiliary structures. I want to estimate the dictionary size $d$ via $n$. It seems reasonable that $d = o(n)$, but maybe there is some research, that provi...
Why there are two ways of accepting the input in PDA i.e. Acceptance by Final sate and Empty Stack I have seen examples which are accepted by both rules? There are some examples which are only accepted by empty stack but I found they are NPDA's, is there any relation between them
Look at this excerpt from the Algorithm Design Manual by Skiena, 2nd Edition The sum of the first $n$ even integers? Surely, the two sums given do not include only even numbers, right? Is this a mistake on the author's part, or am I missing something?
Take a look at this excerpt from the Algorithm Design Manual, 2nd Edition by Skiena. I have circled the confusing bit. Basically, everything is understandable to me, until that part. How can $Increment([m+1/2])$ be rewritten as $Increment([m])$? Clearly, if m is an integer, then the algorithm will not treat $m+1/2$ a...
Has there been any attempt at a general theory to describe how an algorithm can be "deformed" to solve the problem more efficiently? For example suppose we have an algorithm (say sorting a list of numbers) which solves the problem in $O(n^2)$. Can we deform this algorithm (in the "space of algorithms") to an algorithm ...
One can consider multimedia data as a matrix of pixels, but, of course - multimedia data contains higher-order knowledge as well. E.g. everyone can describe famous paintings in terms of colours, shapes, temper, artistic techniques and so on, only rarey one describes the painting as a matrix of pixels. So - are there sc...
A regular language is a language that can be represented by a regular expression(or for which there exists a DFA), then why is language represented by 0$^{+}$ not regular? I am asking this because for the following question the correct answer is option 2 Let L denote the languages generated by the grammar S→0S0∣00. ...
I have a menu of n items, with each item having a value. Given the total amount spent, I have to figure out all the possible combinations of items purchased. Example, I have three menu items: item 1: $4 item 2: $5 item 3: $8 with the total purchase price = $14 There is only one solution in the case, 1 purchase of item...
Let $G$ be a CFG, let $A$ be one of its non-terminals, and let $x$ be a string. Define the language = $ \{ \langle G,A,x\rangle|$there exists a derivation of $x$ in which $A$ is used $\}$. Is this language T-recognizable? Is it decidable? Obviously, we can determine if there is at least one derivation for $G$, since c...
Does anyone know whether universal queue automata have ever been considered, and, as for Universal Turing Machines, some "small" universal queue automata are known?
Background Semiautomated file merging is a critical part of version control systems (all the ones I've used anyway!). This is usually accomplished on textual source code without the tool understanding the underlying language – although semantic merging also exists. I'm interested in whether merging relational data has ...
I've recently stumbled across the field of Set constraints for program analysis, that is, solving equations of the form $exp_1 \subseteq exp_2$, where (depending on the particular variant of the problem), $exp_i$ is a term involving $\cup, \cap, \sim$, some set of "constructor" functions, and variables. The goal is to ...
Let the set $A = \{a_1,...,a_n\}$ of objects and $d(a_i,aj) \quad \forall i,j\in[n] \quad i\neq j$. Let $\;C=\{C_1,...,C_k\}$ the set of clusters, split the elements of $A$ into $C$ such as there is not $C_i$ empty. We need to maximaze the distance between clusters which is the minimum distance between all the element...
I've been struggling with a problem that is very similar to a 2014 question posted here. The question in particular is 3(1) and 3(2). To paraphrase, we are supposed to use paths and an encoding scheme in order to bound the mixing time of a Markov Chain composed of state space $\Omega$ where a given state consists of a...
Today I read a very interesting article about escape analysis in Java called Escape Analysis for Object Oriented Languages: Application to Java I think I have some grasp on how escape analysis works and how it is implemented, but I don't understand how the above algorithm works at all. I have also read two other papers...
What is the main difference between binary decision tree and binary decision diagram(BDD)? From what I can tell I only understand that a binary decision diagram is a more compact representation because it eliminates nodes that have both edges pointing to the same node, eliminates nodes that have removes and removes t...
We know that 0-1 integer linear programming is NP-Hard. What about 0-1 integer linear programming with only equality constraints? If so, how to prove it $$\min c^T x \text{ s.t. } Ax = b \quad x_i \in \{0,1\}\quad (i=1,2,...,n)$$
The theorem says: If $R(x,y)$ is a recursive relation, then there exists $y\leq2$ such that $R(x,y)$ is recursive. Here is my attempt of proof: Since $R(x,y)$ is recursive, we can construct a partial recursive function $f:\mathbb{N}^2\rightarrow\mathbb{N}$ be such that $f(x,y)=1$ if $(x,y)\in R$ and $f(x,y)=0$ if $(x,...
Here's a naïve algorithm that computes $ \binom{n}k $ (or "n choose k"), with either $k=0$ or $1\le k \le n$: def coefficient(n, k): if k == 0 or k == n: return 1 return coefficient(n-1, k-1) + coefficient(n-1, k) Now the time complexity has to be bounded by $2^n$, however we have to take $k$ into acco...
Eigenvector centrality can be calculated for graphs with non-negative weights for the edges. Is there any version of it which can be used for graphs with negative weights?
Following question was asked in a online hackathon that has been concluded. Given arrays $A_1,\ldots,A_n$ of length $\ell_1,\ldots,\ell_n$, we want to find cyclically rotate each array in a way which maximizes $$ \sum_{i=1}^{n-1} i|A_i[\ell_i] - A_{i+1}[1]|. $$ For example, on input $2,3,1 \mid 3,2 \mid 4,5$ the best ...
Black box of $f(x)$ means I can evaluate the polynomial $f(x)$ at any point. Input: A black box of monic polynomial $f(x) \in\mathbb{Z}^+[x]$ of degree $d$. Output: The $d$ coefficients of polynomial $f(x)$. My algorithm: let $$f(x) = x^{d} + a_{d-1} x^{d-1} + \cdots + a_1 x + a_0$$ Evaluate polynomial $\mathcal{f(x...
I want to compute the median in an array of size $m$ which consists of distinct integers from $\{0, 1, ..., n-1\}$, I have $m<n$. By median I mean the middle element (rounding up/down if the array size is even) in the sorted version of the array. Ideally, the expected number of passes over the array should be $\mathcal...
I did some searching before I decided to ask this question and there was nothing similar to my question that helped me. So I came to CS stack-exchange for hints. So, I am currently working on a proof to show that if $L$ is regular then $OP(L)$ is also regular without the use of pumping lemma. For the sake of this ques...
I've been thinking about embedded languages (domain-specific or otherwise), and in particular the approach where we define a datatype to represent terms of the embedded language, e.g. (in Haskell): data Expr = Numeral Int | Apply Expr Expr | Lambda String Expr | Var String | ... ...
I'm trying to prove some statements about execution in Java programs under some heavy restrictions (basically I have a conjecture that if two methods satisfy a set of constraints for a given input then the are they equivalent - i.e., that return value and state after execution are identical). To prove this I'm looking ...
Would it be possible to use the master theorem to solve the following recurrence? T(n) = 9 T(n/2) + n^3 lg n This recurrence hasn't been mentioned before in any of the questions on StackOverflow. Best,
I am a statistician by training, so am not too familiar with the computer science literature. One of the engineers at the firm I work at told me about problems with A/B testing in Canary releases. I am well versed with the literature on A/B testing, but in the case of canary release, I am not quite sure what is being t...
When we write a mathematical formula, the rule $a=42$ (when we say let $a=42$) and testing them (when we write something like $\ldots \mathrm{if} x=42$) is written in a same equal sign. I think that both of them are representing some relation. However, while programming, we write = for the first circumstance and == for...
We have give positive integer $n$, and we want to find all the pairs $(i, j), i\leq j$ such that: $$i + (i+1) +(i+2)+(i+3)+ \dots + j = n$$ Clearly we can try all possible pairs in $O(N^2)$, but that is pretty slow. Here is my observation. We already know that the sum of numbers from $1$ to $n$ equals $\frac{n\cdot(n+1...
1.10 Let A be an algorithm for minimization NP-optimization problem such that the expected cost of the solution produced by A is at most $\alpha OPT$, for a constant $\alpha>1$. What is the best approximation guarantee you can establish for this problem using algorithm A? Hint: A guarantee of $2\alpha-1$ follows easi...
I'm looking for a reference to an algorithm that does the following. Given n, and a range [min, max], generate a random ascending stream of n integers i_1, i_2 .. i_n such that min <= i_1 < i_2 < ... < i_n <= max. And this should be done in constant space. (So I'm looking for a more efficient alternative to the followi...
Is there any efficient algorithm to find shortest distance between all pairs of vertices? The graph is: Cyclic Sparse (each vertex has either 2 or 3 edge) undirected(bidirectional) weighted non-negative Since Floyd-Warshall algorithm and Johnson's algorithm are best for finding shortest path for every pairs but: Jo...
I was doing a problem about Amdahl's Law when I noticed that $s,(local$ $ speed-up)$ was incalculable. The wording: A computer takes 100 seconds to execute a program. The multiplication operations take the 80% of the time. By how much we have to improve the speed of the multiplier in such a way that the program runs 5 ...
I am struggling with the following dynamic programming problem: Given a complete $N$ vertex digraph and a list of vertices $List$, find a way for two players who start at vertices 1 and 2 respectively to visit each vertex from $List$ (order matters, i.e. $List_{i + 1}$ should be the vertex visited after $List_i$). S...
I am creating a program which searches for particular types of strings. The alphabet of these strings are in $\{a, b, c\}$, for which every sub string of length 3 contains exactly $c$. Some strings that follow these constraints are: $cabcbbca$, $cbb$ and $acaacb$ And strings that don't follow the constraints are: $aaa...
Show that the following formula is a law of LTL, i. e. the formula is satisfied on all paths in all models G(p → X q) ∧ G(q → F p) ∧ p → G F p I dont know how to go about that. Whats the standard procedure to go about checking the satisfiability of all paths in all models for a given LTL formulae?
f(n) = n/100 = Ω(n) . I am new at proving asymptotic notations , especially at big-Ω. That's why I even didnt start the beginning myself. I tried to prove myself as looking at other proofs and searched on the internet to find same question but I couldnt find. I dont think so this question is a duplicate of another whi...
So, regarding Huffman Coding we know that the optimal way of "storing" it is using a full binary tree (where all nodes have either 0 or 2 children). All leaves are the symbols $i$ of the alphabet we want to encode (all $i$ have a frequency of appearance$f_i$) and if we consider the freq. $f_i$ of each leaf (freq. of th...
Before asking my question, I have to give some background about myself. I live in Iraq and this made my education a total disaster. My middle/high school math skills are not that great and I never realized that until I got into college. I found out pretty late that great colleges cover a lot of maths materials in their...
Suppose you want to read a book with $n$ chapters, and chapter $i$ has $a_i$ pages. Now you want to read the entire book in $d$ days. But there are two restrictions: by the end of each day, you cannot be in the middle of a chapter. You must read the chapters in order. You also want to minimize the maximum number of p...
I am trying to design an algorithm that would help me distribute in this example case, 'students' to different exam rooms. All the constraints for this Theoretical problem would be: [1]"One student can only be at the exam room at a specific time "... meaning that only one student can give an exam in one of the rooms. ...
If a language L on Σ = {a, b, c}, such that L = {w | #a(w) is even and #b(w) is even and #c(w) is even and | w | is even}. Where #a(w) represents the quantity of a's in w and | w | is the length of the string w. How many states have the minimum DFA that recognizes L? Help me please!
"Ad-hoc polymorphism is obtained when a function works, or appears to work, on several different types (which may not exhibit a common structure) and may behave in unrelated ways for each type." – Strachey 1967 Subtype polymorphism seems to fit this description, albeit usually with late binding on the type that dicta...
In discussions about why most languages which implement inheritance only implement single-inheritance, the question of the precise semantics of overlaps often comes up, and having redundant data members is sometimes given as an example semantic that would be undesirable. Note that this semantic effectively implements i...
I have the following homework question. (For a bit of context - the study unit is Formal Languages and Automata). Define the predicate $\mathrm{pre}(s,t)$ over $s, t\in\Sigma^*$ by induction on the structure of $s$ such that it satisfies the following conditions: $$\mathrm{pre}(s,t) = \begin{cases} \mathsf{true} & ...
Prerequisites I've found out that photogrammetry methods allow us to fetch 3D model from set of images of a scene. I call this rigid reconstruction. There are methods of finding correspondence between two 3D scans even though scanned object performed non-rigid transformations between scans like Global Correspondence Op...
I came across to the code that convert 32-bit signed fixed-point number (16.16) to a float and it looks like (pseudocode) floating = fixed / 65536.0 Could you please explain me what's the essence of dividing by this? Why does this dividing works when fixed-point and floating-point numbers have different internal struc...
There are two nested for loops. I'm not sure but I think that it's geometric series, but I cannot get well solution for it. It seems n + n/2 + n/4 + .. + n/n^2, but how? What I tried is below up to now, $$ \sum _{i=0}^{log\left(n-1\right)}\:\sum _{j=0}^{i-1}\:1 $$ $$ \sum _{i=0}^n\:\sum _{j=0}^n\:\left(\frac{1}{2}\righ...
Question Is Infinite Union of Recursive language is Recursive? I know it is already posted here, but the i am not getting answer also i want to know if my approach is correct. My Approach/Doubt $\text{let}\,\,L_1=abcd \,\,\,L_2=a^2b^2c^2d^2=aabbccdd,L_3=a^3b^3c^3d^3=aaabbbcccddd$ here $L_{1},L_{2},L_{3}\,....\text{ar...
In CLRS , under the section "Maximum sub array problem", there is a problem to maximize the profit in the stock exchange. The problem is.. given an array A[1..n] and we have to find i and j such that i < j and A[j] - A[i] should be maximum. the solution given is O(n^2) . But I have a solution which does it in O(n) . I ...
I have seen various statements with negation( or complement) operators and when i try to negate them using De Morgan's law , i become confused about how to negate. The main doubts are what variables to negate and what operators to negate. Example:- ~(p^q)= ~p∨~q (according to De Morgan's) Doubt1 but for ~(p=q) should i...
I am reading some properties on the A* search algorithm on Wikipedia, specifically: "If the heuristic function h is admissible, meaning that it never overestimates the actual minimal cost of reaching the goal, then A* is itself admissible (or optimal) if we do not use a closed set. If a closed set is used, then h must ...
There are $n \in \mathbb{N}$ towers, each with a height and a value. Let the positive integers $h_1, h_2, \dots, h_n$ be the heights and $v_1, v_2, \dots, v_n$ be the values, respectively. Two players $A$ and $B$ take turns. Player $A$ may or may not select an arbitrary tower and reduce it's height by $a \in \mathbb{N}...
Two arrays of natural numbers are given of length $n$ and $n - 1$: e.g. $A: [a_0, a_1,..., a_{n-1}, a_n]$ $B: [b_0, b_1, ..., b_{n-2}, b_{n-1}]$ All elements of $A$ are unique (can be in $B$), all elements of $B$ are unique (can be in $A$) and every element of $B$ is smaller than the sum of all elements of $A$. Find a ...
I was tasked to order some functions in respect to the $\mathcal{O}$ notation, and have some problems with the following ones: $n^{\ln(7)} = \mathcal{O}(n^{3})$: I can't find a more elegant proof for this other than using L'Hôpital's rule and a numerical approximation of $\ln(7)$: $\lim_{n\to\infty} \frac{n^{\ln(7)}}{...
One of the undergraduate degree requirements at my university is that all Letters and Science students must take a "breadth course" in each of seven categories. If a course has multiple associated categories, you have to pick one; you can't satisfy multiple breadth requirement categories with a single course. For exam...
In any introductory course on the theory of computing, one encounters the language $$L_k = \{a_1^n \cdots a_k^n \mid n \geq 0\}$$ as a canonical (or at least pedagogical) counterexample for a language which is not regular ($k=2$) or context-free ($k=3$). The next jump is usually to the turing machine, where $L_k$ is in...
I have been looking to implement a data structure for my project. I came across AVL tree and Hash Table. As I am a beginner so I'm in dilemma what data structure I use for large data. The main operation will be mostly searching through the database efficiently. AVL Tree seems to be very good option to store around 1200...
There are 4 DNA nucleotides, each represented by one of the letters A, C, G, or T. Assume that they can be arranged in a string e.g. "GATTACA...". I want to figure out the minimum number of nucleotides I would have to encounter before I'm pigeonholed into seeing a duplicate substring of length 3. Observe that a string ...
I was studying Karatsuba multiplication where the complexity is reduced as compared to classical algorithm by splitting each number into two parts. Now I'm trying to understand how the multiplication will take place when a number is divided into three parts instead of two. I tried to solve the math but only came up wit...
The typical way to compute the factorial would take $O(n)$ because it calls itself recursively. However, there are many other ways to compute the factorial function based off the gamma function, bessel functions and whatnot. So how would you prove factorial always takes at least $O(n)$ time, no matter how you choose to...
The time required to send a frame is called frame time. Vulnerable time is the time during which no transmission should be done to avoid any collision. My question is what kind of problem will be created if vulnerable time was equal to frame time?
I'm studying a simple max flow problem: Each type of object $a_1, a_2...$ can be stored in some of several stores $b_1,b_2...$. This is described by this graph: There are $|a_i|$ objects of the type $a_i$. Store $b_j$ can contain at most $|b_j|$ objects. This shows as capacity constraints on the graph. The other edges...
I wish to use a multi-bit trie structure for storing IPv4 forwarding information with a fixed stride width of 8 bits, I think this is also called a "radix of 8" (so for any IP prefix 4 levels will exist between root and leaf nodes inclusive: 8-8-8-8). This is just a basic multibit binary trie that doesn't use any form ...
How to show that these two axioms are equivalent: 1: $\{G[v/e]\} v:=e \{G\}$ 2: $\{F\} v:=e \{\exists v' (F[v/v'] \land v=e[v/v'])\}$ I've tried with $G = \exists v' (F[v/v'] \land v=e[v/v']) $and then I get $G[v/e] = F$, but when I try $F = G[v/e]$ then from $\exists v' (F[v/v'] \land v=e[v/v'])$ I can't obtain $G$. I...
Chess is usually considered a mostly "fair game" between White and Black because the opening position of pieces has mirror symmetry (between players). In practice it also appears to be a fair game because it is combinatorially complex, so if White has a first-move-advantage, it is hard to detect in actual play. What ar...
Prove or disprove the following statement: for arbitrary regular expressions $r_1$ and $r_2$ over an alphabet $\Sigma$ such that $\epsilon$ belongs to $L(r_1)$, there exists a regular expression $r$ over $\Sigma$ such that $r = r_1r + r_2$. My Solution: Let us consider $\Sigma =\{a\}$. $L_1$ is even number of symbols s...
Let $C$ be the set of all available classes, $S$ be the set of all available students, $P$ be the set of all available phone numbers. Each student many have zero to many phone numbers, but each phone number can only belong to zero or one student. There may have little chance that some phone numbers have no owners at al...
Within a directed simple graph, are all vertices within a strongly connected component with 2 or more vertices part of a cycle?
Show that the following language $L$ is regular by describing it using a regular expression. $$L = \{1^n w 1^n \mid n > 0 \text{ and }w ∈ \{0,1\}^*\} $$ My (apparently incorrect) answer: Given $w ∈ \{0,1\}^*$ , we can rewrite $L$ as: $1^n(0\cup1)^*1^n\ for\ n ≥ 0$ However, since the language specifies that the nu...
The wiki pages about chabots mention that statistical methods, keyword search and precompiled answers are used for the chatbots. But I feel that there should exist different - semantical approach for constructing chatbots. There are formal semantics of natural language (recent results in http://www.springer.com/gp/book...