instruction
stringlengths
35
29.1k
I am trying to mathematically prove that the following program is correct: int ArraySumC(int[] a) { int i = 0; int j = 0; while (i <= n) { j = j + a[i]; i = i + 1; } return j; } When the loop ends, we want the invariant, Q, and the condition for loop termination, B'. Q ∧ B' = Q ∧ ...
I'm noodling around with making a hardware SAT solver on an FPGA, and I'm wondering if there are any interesting SAT problems smaller than, say, 50 variables both to stay within the limits of the FPGA board (namely the number of LEDs) and so I can brute-force if needed to get all possible solutions. I looked into fact...
As an exercise, I converted an old method I learned for calculating square roots on a rotary decimal hand calculator to binary. I'm sure this is not original; can anyone provide a reference? // All arithmetic is truncating unsigned integer arithmetic // Actual implementation uses bit shifts // Indention level defines s...
Using the definition for the polynomial hierarchy: $$ \Sigma_{i+1}^P = NP^{\Sigma_i^P} $$ $$ \Pi_{i+1}^P = coNP^{\Sigma_i^P} $$ I have been asked to to show that: $$ P^{\Pi_k^P } \subseteq \Pi_{k+1}^P $$ I don't really have many ideas on how to go for it: by definition $ P^{\Pi_k^P } $ is the set of languages accepted ...
I have a circuit and I should draw a moore diagram (state diagram) for that. ​ The problem is that every state can have 5 inputs and this makes the question hard for me. ​ I tried about 20 times to draw that diagram and every time I failed. ​ Can anyone help?
I am developing the algorithm reported in this article: Lest square conformal mapping Here is presented an algorithm to flat a 3d mesh on the parametric space, but i don't understand the segmentation step. Does anyone know an alternative segmentation approach simpler than the algorithm presented in that article? In oth...
When talking about DFAs and NFAs as 5-tuples, it's common to use the letter $Q$ to denote the set of states in the automaton and to denote individual states with names like $q_0$, $q_1$, etc. Is there a particular reason why the letter $Q$ was chosen? As in, is $Q$ the first letter of a word historically related to aut...
I'm interested in the memory usage of various programming languages when implemented on actual hardware. I believe that a Turing-complete programming language has, in general, unknowable memory usage since object lifetimes are not statically analyzable [1]. It also seems like a regular expression language (in the deter...
Good afternoon. At work I'm currently developing a system which takes user input (well structured) and then stores it in memory to do some processing. The input is basically a dataset formed by matrix of pxq dimension, with q columns of data and p rows; where each row has the following structure: n indexes, m attribute...
As I understand, a quick-select algorithm could use median of medians to find best suited pivot to yield the i-th item in the array, say A. I have referred to Median of Medians algorithm and steps given here for deterministic selection. This is the pseudo code as I understood for the sake of algorithm. define partitio...
I was wondering is there any relationship between degree of vertex and size of dominating set. For example, if I know the number of vertices is $n$, and I could know each vertex in the graph has degree $\ge n^k \,(k< 1)$, is it possible to bound the size of dominating set, i.e $O(n^k)$? Could anyone point me out any ma...
Many algorithms can be implemented more efficiently using SIMT instructions (e.g. CUDA) than using sequential instructions. Excluding overhead due to hardware limitations (specifically, memory copy times when using a GPU) - are there algorithms whose efficiency can only be made worse in a SIMT model? By "efficiency," I...
Let P be a set of n points that divides the unit circle into equal pieces. Let S be a set of m line segments such that their end points are points in P. The points aren't unique per line, meaning several lines can share points. I need to find the biggest subset of S of non intersecting lines. Lines that share an end po...
I\’m a novice programmer that\’s learning how to program on his own currently. I\’m currently fiddling around with a server/client program that allows me to send a signal from one computer to another. I tested both on the same computer and they did rather well for the most part. however, I want to see if I can connect ...
I've been looking at these slides about improving type error messages for programming languages. One of the things they describe, starting at Slide 8, is the concept of amechanicity. Anytime the internals of a compiler, such as optimizations or de-sugaring are exposed, this is an example of mechanicity. A goal of quali...
Didn't find a clear statement on this so I just want to make sure I'm right. If I have DFA with edges leading to a 'sink state' (non-accepting state we don't get out of) the edges leading to the sink state and the edge from the sink to itself won't get any representation in the regular expression right? We can just rem...
This picture is from Computer System Architecture 3rd Edition by Morris Mano. Is it possible to interchange the data of any two registers in a single clock pulse? I know that the data of DR (data register) and AC (accumulator register) can be interchanged in a single clock pulse. But other than this I don't understand ...
Let $\Sigma= \{1,...,n\}$. Let $T$ and $Q$ be two strings with characters from the alphabet $\Sigma$ of lengths $n,k$, respectively. I am looking for an algorithm to test whether $Q$ appears as a substring of $T$, except that I have a more relaxed notion of when two characters match. Two characters in these strings a...
I'm having trouble wrapping my head around the problems PRIME, COMPOSITE, FACTOR and how they're related in terms of complexity. I understand that PRIME has been shown to be in $P$ by the AKS primality test, and I believe this works for COMPOSITE as well. As for FACTOR, $$FACTOR = \{(m,r) :\;\; \exists s \text{ such th...
I've been trying to find an algorithm to find a maximum vertex cycle cover of a directed graph $G$ — that is, a set of disjoint cycles which contain all the vertices in $G$, with as many cycles as possible (we don't consider individual vertices cycles here). I know that the problem of finding a minimum vertex cycle cov...
I have a LR analyser and I can't find out how to know whether the grammar is or is not LALR(1). I think that I have to merge states with the same rules. So I have to merge states: $2 - 12, 3 - 13, 4 - 15, 7 - 9 -17, 8 - 16, 10 - 18 $ I think that LALR conflict is for example if I merge $ 2 - 12$ because in the rules $A...
I'm watching a video, demonstrating merge sort, https://www.youtube.com/watch?v=EeQ8pwjQxTM At 5:42, happens something I do not understand. We are merging last 2 big arrays, [4,15,50,108] and [8,16,23,42]. My understanding is - we pick each pair, since they are already in sorted arrays, and swap them if one is larger ...
It seems like people got tired of manual memory management, so they invented garbage collection, and life was reasonably good. But what about every other resource types? File descriptors, sockets, or even user created data like database connections? This feels like a naive question but I cannot find any place where a...
$n$ professors go to a conference and have to sit together at a table. See illustration below for $n=8$ Each professor has people they like to sit next to and people they do not want to sit next to. Given a $n\times n$ (non-symmetrical) matrix $M$ where $M_{ij}$ gives the score assigned by professor $i$ if s/he is m...
just read and watch some stuff on how RSA works. main idea seems to be if someone steals your communication he cannot decode it anyway. but let's say someone steals it and keeps it along with current RSA-1024 used. if in 10 years he will be able to break this RSA can he decode our communication and passwords from 10 ye...
I know that proving context free grammars equivalent is undecidable. I also know that proving if a context free grammar recognizes a regular language is undecidable. Here is my question: is proving that two regular grammars recognize the same language decidable?
I have been unable to find a graph depicting or text answering the following question: Is there a direct relationship between the complexity of an algorithm (such as best / worst case of quick sort), and class of automata that can implement the algorithm. For example is there a range of complexity push down automata ca...
I'm trying to figure out a way to find the number of inversions in permutation time O(nlogn) using red black trees. Here's how I think it can be done. So if I have an algorithm that inserts a new node into a red black tree then by inserting the node if it inserts properly then it means the values are in the proper orde...
Has there been any research on the subject of applying information theory to a processors clock? It occurred to me that a clock is actually transmitting data that is used for synchronization of different processor components. Once I started to apply information theory concepts to the clock a lot of interesting ideas ca...
I'm trying to prove that the Subgraph isomorphism problem is NPC using the Hamiltonian Cycle problem. Unfortunately I feel (or don't understand) that the solution is "empty" and doesn't explain the Hamiltonian Cycle - Subgraph Isomorphic connection, @Luke Mathieson says that "Hamiltonian Cycle to Subgraph Isomorphism i...
So I've been struggling for the past hour with $G=(\{S\},\{a,b\},P,S)$ with productions $S\to aaSb | abSbS | \varepsilon$. I need to prove whether this grammar is ambiguous or not. Thus far I think it is ambiguous, possibly cuz of abSbS, but not sure (mainly since I have no idea how to prove it's not) . Can anyone help...
I'm resolving indirect left recursion for these production rules: S -> Aa / a eq1 A -> Sb / b. eq2 Where S is the starting symbol. Now I can do this in two ways: Putting A in eq1 So I'll get the solution (sol1): S -> Sba /a /ba and then S -> aS' / baS' S' -> baS' / epsilon Replacing S in eq2: So I'll get the s...
The dynamic programming algorithm for the knapsack problem has a time complexity of $O(nW)$ where $n$ is the number of items and $W$ is the capacity of the knapsack. Why is this not a polynomial-time algorithm? I have read that one needs $\lg W$ bits to represent $W$, so it is exponential time. But, I don't understand,...
According to the definition of ADT on wikipedia , it is given that ADT is a mathematical model for data types , And as per wikipedia, definition of mathematical model says that it is composed of variables and relationships. Relationships can be described by operators, such as algebraic operators, functions, differentia...
Given a multiset of numbers $X = \{x_1, \dots, x_n\}$, such that $\sum X = 0$, how can $X$ be partitioned to the maximum number of subsets so that each subset sums to zero? I have searched around a lot, but none of the partition or packing problem variants seem to address this particular case.
I would like to know whether it is computationally possible for a computer to go through the words of an audiobook as input, output a file containing both the original audio and the text corresponding to each word (which could be reviewed by a human), and a silent software tag between each word marking each word bounda...
There is this question: As a result of the US Election, a wall is built along the entire Canadian border. You have been told there is a mouse hole in the wall, but it can only be seen when you are standing in front of it. Your task is to find the mouse hole by walking along the wall; however, you are standing in M...
Proving two push down automata equivalent is undecidable. But proving two finite state machines equivalent is decidable. You also cannot write a programming language that allows expressing the complete set of push down automata, with nothing more powerful. First question: Can a language exist that expresses up to the p...
I've studied about $FFT$ and it's use in string matching, but there are several issues that bother me. First I'll describe the problem and the solution I've seen in class: Suppose we have alphabet $\Sigma = (a, b, \phi)$ where $\phi$ is "don't care", meaning it matches with every letter, including itself. We have a tex...
Robert Sedgewick, at his Algorithms - Part 1 course in Coursera, states that people usually misunderstand the big-O notation when using it to show the order of growth of algorithms. Instead, he advocates for the tilde notation. I understand the big-O is an upper bound for certain problem at certain condition. What is t...
Is it that you need a separate method to expand the array whenever it goes over the capacity?
I'm working with a noSQL database and for certain reasons I can't use equality filtering in my queries e.g select all from database where id = 10 is NOT allowed but inequality filtering is allowed e.g select all from database where id > 1 My ID's are UNIQUE strings (emails) and I need to use equality filtering so...
Let the binary relation computed by a nondeterministic transducer be the relation between input strings and the possible output strings the transducer can produce (and accept) for the given input string. It is easy to see that the nondeterministic transducers using polynomial time can compute different binary relations...
I am little bit confused between the two answers below. What is the exact answer of this question? My query is, "Deleted data remains on a disk until...?" The data is overwritten; The recycle bin is emptied. I have searched it over internet and books, but I have found various answers. Please explain to me. Thank you ...
I have difficulties to differentiate the $H_0$ from the $E_{TM}$ problem. What exactly means $L(M)= \emptyset $? Is it dffierent from $input~ \varepsilon$ or is $L(M)= \emptyset \leftrightarrow input~ \varepsilon$ Emptiness problem: $E_{TM} = \{\langle M \rangle | ~M~ is~ a~ Turing~ machine~ and~ L(M)= \emptyset \}$ $E...
Assume I know that there is an algorithm of complexity $ \mathcal{O}( log ( \vert V \vert^2 \vert E \vert ) ) $ for a Graph $G(E,V)$. How do I compare this for example to the complexity of $ \mathcal{O}( \vert V \vert^2 + \vert E \vert ) $ or other complexity algorithms on $G$. There has to be a connection between $\...
I am looking for a Moore finite state machine that returns true if and only if the last 4 bits (the input is of bits) are 0011 or 0101, the FSM can return any value at the first 4 bits (yes, even at the 4th). The issue is that I was asked for a 7 conditions (vertexes) limit, and despite my efforts could not create one,...
My university is participating in the implementation of a library borrowing managing system at Richelieu National Library in France. I received the order to formulate the query: "find all users having borrowed every book" in relational Algebra, in relational Calculus and in SQL (which would probably not happen, probabl...
A process in an Operating System is considered to occupy several states and a process transitions between these states. A scheduler is responsible for assigning CPU time to a process. However, a process that is performing an Input Output Operation and has gone into the blocked state must transition to the ready state o...
Consider Ford–Fulkerson algorithm (FF). Look to wiki : The following example shows the first steps of Ford–Fulkerson in a flow network with 4 nodes, source A and sink D. This example shows the worst-case behaviour of the algorithm. In each step, only a flow of 1 is sent across the network. If breadth-first-search we...
I am writing a paper in which I want to include complexity results for different modal logics and possibly add a reference to a specific paper. At the moment I have the following: K- no restrictions on the frame, NPComplete T- reflexive, NPComplete K4- transitive, PSpaceComplete S4 and S4.3 also PSpaceComplete S5- symm...
This is a question from the book Algorithms by Robert Sedgewick and Kevin Wayne. "Find a sequence of keys to insert into a BST and into a red-black BST such that the height of the BST is less than the height of the red-black BST, or prove that no such sequence is possible." I think that in most cases, if not all, the h...
Suppose there is a graph G of zero nodes, there is an even number of nodes. By definition of connectivity, the graph G is connected when there is a path between every pair of nodes. But there are no pair of nodes since there are zero nodes. Does this mean G is connected because there is a path for every pair of nodes ...
In preparation for an exam, I've come upon the following problem. Given the constructors : []: -> T LIST [a]:T-> T LIST cons(a,x) : T x T LIST -> T LIST ( a is added to the beginning of the list) And the functions : size(l) : T LIST -> N (number of elements in l) reverse(l): T LIST -> T LIST ( reverses the orde...
I'm reading "Understanding Linux Kernel 3rd edition" and it starts talking about memory segments. It says that a logical address is: Included in the machine language instructions to specify the address of an oper- and or of an instruction. This type of address embodies the well-known 80 × 86 segmented architecture...
I've been working on a computer vision project in which I'm using the pinhole camera model to map one line of the world to one line in an image. From previous research on the topic, I know that it is possible to map a point in the 3D world to a point in one image using the projection matrix obtained by calibrating the ...
I am having difficult time understanding the difference between weakly fair and strongly fair schedulers. Can someone provide an example and explain how they are different? for reference, here are the definitions I have of each: weakly fair: A condition becomes true and remains true at least until after the conditional...
So the knapsack problem has an integer programming formulation as follows, $$ \max_x v\cdot x\\s.t \\x_i \in \{0,1\}\\w\cdot x \leq C$$ Now consider the second integer program which might be a variation of the knapsack integer program. $$ \max_x v\cdot x\\s.t \\x_i \in \{0,L_i\}\\ x_i \leq R \cdot \delta_i\\ \delta_i ...
Lets take POSIX, whats the difference between POSIX API, libc and actual system calls?
Is it possible, somehow, maybe by using some kind of brute force algorithm, to try and figure out what kind of file one is dealing with when one only has the raw binary without file format or meta information at all ? If one wold use a tool such as Hopper Disassembler, how would one go about figuring out what kind of f...
I am reading about a specific field of probabilistic programming, and trying to understand what the term "stateful computation" means. See: http://projects.csail.mit.edu/church/wiki/Simple_Generative_Models (search for "XRP")
I am reading Introduction to Algorithms, and I am stuck at this execercise in the Appendix: Argue for any integers $n \ge 0$, $j \ge 0$, $k \ge 0$ and $j + k \le n$. $${n \choose j + k} \le {n \choose j} {n-j \choose k}$$ Privde both an algebraic proof and an argument based on a method for choosing $j+ k$ items ou...
is there exist a formal proof for Equivalence of deterministic and non deterministic Turing Machine ? i read Martin Davis and Sipser's book and there is no formal proof
Although I am a computer science major, I am having a hard time understanding how internet providers have control over internet speed (example: offer different speeds to different customers, one with a higher price, etc.). And I mean how is it that they do it at the physical level or bit level if I may. I think that t...
How would I go about proving the following two regular expressions are equal to one another: ( a + b )* a ( a + b )* b( a + b )* = (a + b)* ab(a + b)* I can "see" why they are equal to one another because the second ( a + b )* is a redundant term as the expression will always have an ab together. But how can I formali...
In order to do this, we would probably need the non-regular language to be infinite as well, then find some definition for the non-regular language in order to fulfill the requirement, but I don't know how to construct one.
Given an arbitrary connected graph with a start and goal node, with both directed and undirected edges, where each edge has a maximum number of times it may be traversed during a single traversal (at least 1, at most infinite): Is it possible to confirm in O(n) time whether or not a walk (possibly with repeating edges...
A Boolean function $f : \{0, 1\}^n → \{0, 1\}$ is called monotone if changing any of the $n$ input bits $x_1, \ldots , x_n$ from $0$ to $1$ can only ever change the output $f(x_1, \ldots ,x_n)$ from $0$ to $1$, never from $1$ to $0$. I know how to do a simple proof of exhaustion for $f : \{0, 1\}^1$ and $f : \{0, 1\}^2...
How I can explain this. Consider the following automaton, $A$. Prove using the method of induction that every word/string $w\in L(A)$ contains an odd number(length) of $1$'s. Show that there are words/strings with odd number(length) of $1$'s that does not belong to the language $L(A)$. Describe the language $L(A)$. ...
For my application, I have to store billions of md5 values, and before storing new md5 I wanna make sure that it doesn't exist already in it. I tried using hash data structure, it worked well but no of lookups goes high with table entries. I tried using trie, each node storing a byte, but the memory consumption is to...
As part of a course I am teaching on Data Structures, I want students to research and present the use of Data Structures in popular software/services. However, basic googling shows me that this information is not so readily available. Can someone point me to the right resources that I may share with the students as a s...
I am having trouble proving that an n-element heap can have at most $\lceil \frac{n}{2^{h+1}-1} \rceil$ nodes. Please note that I am proving a loose bound. First I proved that a complete binary tree can have at most $2^{h+1} - 1$ nodes. However, I don't know how to use this fact to inductively prove the formula above? ...
How to treat $\epsilon$ and '\$' in top-down parser using predict table? The construction of the predict table Given a product $X \rightarrow w$, row $X$ and column $t$ -Mark $X \rightarrow w$ for each $t \in FIRST(w)$ -If $NULLABLE(w)$, then mark $X \rightarrow w$ for each $t \in FOLLOW(w)$ as well says to creat...
I've read about attribute grammars, but I haven't found out, how are the attributes often implemented? To me they scream objects (of classes), but they could be also variables. But are there any general rules as to how the attributes should be implemented in a practical implementation? Or is it free form?
I am teaching myself formal languages, and yesterday i got stuck at an exercise asking for a context free grammar for the language: $ L = \{x \in \Sigma ^{+} | \ \forall w \in \Sigma ^{+} \ x \neq ww\} $ with $ \Sigma = \{a,b\}$ I am trying some rules of the form $L \Rightarrow a | b $ $S \Rightarrow aSbS\ |\ bSaS\ |...
I have been trying to find an easy-to-implement approximation algorithm on the problem of Prize collecting Steiner tree on node-weighted graph without weights on the edges. The closest I have come is the one in The prize collecting Steiner tree problem: Theory and Practice by Johnson, Minkoff and Phillips, but the GW a...
The Max-Cut optimization problem on a graph $G=(V,E)$ can be written as the question of wanting to maximize the function $\frac{1}{4} \sum_{(i,j) \in E } (x_i -x_j)^2$ under the constraint $x_i^2 = 1, x_i \in \mathbb{R}, \forall i \in V$. Now the usual SDP relaxation is to lift the $x_i$s to vectors $\vec{x_i} \in \ma...
Sipser first introduces space constructible functions. Then uses the definition to prove the space hierarchy theorem: if f(n) is a space constructible function then there are languages that can be decided in O(f(n)) space but not in o(f(n)) space. The author only mentions as most encountered functions are space con...
I have a special graph in which I have two types of edges only, say one with type 0 and one with type 1. Now I have to find a longest path in the graph such that it starts with a vertex then follows as many type 0 edges as it can and then again start with a vertex and follows as many type 1 edges it can. The length of ...
I am told that with every flow network, the Ford-Fulkerson algorithm produces an execution that never decreases the value of the flow on any of the edges (i.e. never “pushes back” the flow on any of the edges). I am wondering how that can be possible. Can we choose augmenting paths that allow us to never "push back"?
I wanted to understand how to establish both the lower $\Omega$ and upper bound $O$ on an algorithm to conclude it runs in $\Theta$ (note that I am not trying to prove that the algorithm is the most optimal and that no better algorithm exists). To establish a $O$ I thought that one just has to prove somehow that the a...
How can somebody use these gates to create other gates like pauli's or other gates? Also how can somebody go from pauli's to CNOT, Hadamard and Φ quantum gates?
I'm trying to implement a brute-force algorithm. If I have one variable x, I can iterate through all its values using a for loop: for x in {1,2,..,MAX}: do something with x But what if I have an array A? The array has length SIZE, and each element takes values in the range 1..MAX. Thus, there are MAX^SIZE pos...
It seems to me that the outcome of a connected components algo is dependent on the start vertex. Is this correct? Say we had the graph If we started our connected component search from the vertex on the upper right then we would end up with different set of connected components than if we started our search with the v...
There is a simply-connected polygon $C$. It contains $n$ pairwise-interior-disjoint simply-connected polygons, $D_1,\dots,D_n$: The goal is to select one of the polygons, say $D_i$, and attach to it a polygon $E_i$ such that: $D_i\cup E_i$ is still simply-connected. $E_i$ is interior-disjoint from all other polygons ...
Given some graph $G$ with vertices $V$ and edges $E$, its Cheeger constant $h(G)$ is well defined as $$ h(G) = \min_{S\subset V,0<|S|\leq|V|}\frac{|\partial S|}{|S|}. $$ Given some doubly-stochastic Markov chain $P$ on $G$, its conductance $\Phi(P)$ is defined as $$ \Phi(P) = \min_{S\subset V,0<|S|\leq|V|}\frac{\sum_{...
The question Complexity of Independent Set on Triangle-Free Planar Cubic Graphs asks for the complexity of the independent set problem in triangle-free planar cubic graphs. In the statement of the question Independent set on cubic triangle-free graphs, it is claimed that a more general problem - maximum independent set...
I am currently reading the Practical Byzantine Fault Tolerance paper. I am unable to completely understand the difference between 2f and 2f+1. If 2f+1 means that a majority of the nodes are non-faulty then what does 2f represent?
Are there any implementations, or even academic work, regarding an application capable of looking at code and inferring what the code actually intends to do? For example, we give it a program that calculates the SQRT(x); it should go and annotate that particular piece of code with SQRT(X), regardless of implementation ...
I'm confused about the complexity of the following code: for(i=1; i<=n; i = 2*i) for(j=1; j<=i; j++) print A[j] I know that the first loop is logn, but I'm confused on what the second for loop would be since j is bound to i. Is this simply O(logn)? I've plotted out the output as follows and thought it wou...
I'm still trying to get the hang of lambda calculus: I completed simplified some of these already but am lost on the last two. I did so far: \begin{align*} (\lambda x.x)y &\to y\\ (\lambda x.y)x &\to x \end{align*} However, I'm not sure how to simplify these two: \begin{gather*} (\lambda x.x y)(\lambda y.y z)\\...
For example, you have a DFA that accepts the language comprised of strings aabbbaa and aaabbbbaaa, and you want to create a new DFA that accepts a language comprised of strings abba and aabba (strings made up of every other character in the strings in the original language). What would be the generalized construction t...
I found this proof on http://jeremykun.com/2012/02/08/busy-beavers-and-the-quest-for-big-numbers/ and have highlighted the part I don't understand in bold. (BB(n) is defined as the number of steps made by n-state Busy Beavers.) Theorem: BB(n) is uncomputable. That is, there is no Turing machine that can take as inpu...
I'm having serious issues fining an unambiguous version of a particular grammar. I've looked online for help for this particular problem and for general methods for finding unambiguous versions of grammars, and though I understand the concept, I can't seem to figure this out. Any help/advice? I keep getting really clos...
I've recently come across this problem: Find all solutions to the equation $a + 2b^2 = 3c^3 + 4d^4$ for which $a, b, c, d$ are all less than $100,000$. Hint: use one min-heap and one max-heap. I can think of an algorithm involving two min-heaps (one for the LHS and one for the RHS), but can't figure out how a max-h...
Let $\Sigma = \{ 0, 1 \}$. A language $L \subseteq \Sigma^* $ is said to have the "anti-palindrome" property if for every string $w$ that is a palindrome, $w\notin L$. In addition, for every string $u$ that is not a palindrome either $u\in L$ or $\mathrm{Reverse}(u) \in L$, but not both(!) (exclusive or). I understand ...
In the Bentley–Ottmann algorithm, Regarding : Find the segments r and t that are immediately below and above s in T (if they exist) and if their crossing forms a potential future event in the event queue, remove it. That means, every insertion of a segmant may lead to an intersection event deletion. I am thinkin...
A recursive (decidable) language is defined as a language for which there exists an algorithm deciding if a string is or not in the language that terminates for every possible input. The question is, does there exist a programming language/grammar/something that is able to represent all and only the algorithms that ar...
I am looking for a reference on the following variant of a Voronoi diagram: Instead of seed points, there are seed rectangles which are axis-parallel and pairwise-disjoint. Instead of Euclidean distance, we are interested in Manhattan distance. The goal is to partition the plane into regions, such that the points in ...
I am currently taking a class called Logic for Computer Scientist. During the first four weeks or so now we have been studying a concept Datalog with subsections Syntax and Formal Semantics and Fixed-Point Semantics. In these weeks we have looked at several definitions atoms, ground atoms, herbrand interpretations, her...