instruction
stringlengths
35
29.1k
While going through bubble_down implementation for min-heap in The Algorithm Design Manual By Steven Skiena, since routine pq_young_child gives the index for youngest child which can be replaced with the parent I feel the lines 10 - 13 are useless or maybe I am not able to identify the cases it handles. Here is the imp...
I would like to classify data coming from a sensor. In the literature Hidden Markov Model and SVM are used, but I would like to improve results with another methods.The picture how data and classes are as follows; x is time axis and y is sensor outputs axis. The yellow is how signal looks like and it randomly changes ...
folks. Hope you all doing well. I have a question regarding to the topic Equivalence of NFA and DFAs. While converting from NFA to DFA why we always say we'll have 2^n states, and should it be always 2^n ? Thanks in advance.
I'm taking Andrew Ng's machine learning course and week 5 covers the training of neural networks. The modified cost function for neural network training is derived from the logistic regression cost function, and is described as follows: $$\begin{gather*} J(\Theta) = - \frac{1}{m} \sum_{i=1}^m \sum_{k=1}^K \left[y^{(i)}...
I need to prove that if $L1,L2$ is regular languages $L=\left\{ a_{1}b_{1}a_{2}b_{2}\cdot\cdot\cdot a_{k}b_{k}\mid a_{1}\cdot\cdot\cdot a_{k}\in L_{1},b_{1}\cdot\cdot\cdot b_{k}\in L_{2}\right\} $ will be regular as well. My approuch is : There is $A_{1}=\left\langle Q_{1},\Sigma,\delta_{2},q_{0_{1}},F_{1}\right\rangl...
Are there useful programs that don't take inputs from a user, environment etc. such as key input, or the current time? A program that computed/printed out predefined data could be turned into a file, right?
When you insert a new item in a B+tree leaf node, and the node is full, two new nodes are created and they're both filled halfway and the values get re-distributed accordingly. Before the insertion: After inserting 6: Problem that I'm having is that this leaves lots of empty spots across my nodes. I could even end up...
The algorithms I've seen for building an LL(1) parse table involve calculating first and follow sets such that: predict(nonterminal, production) == if epsilon in FIRST(production): first(production) union follow(nonterminal) else: first(production) where production is a sequence of symbols...
I'm having a hard time understanding the following. Assuming we have a complete graph with $n$ vertices, where initially, one of those has an information. At this point, all we care about is that in each time $t$ a node that has the information chooses randomly one of it's neighboors and sends it the info, only if the ...
I need help with my CS homework, and I don't quite know what to do.. The problem is to define a function and return a string as shown as: 1111 2222 3333 I wrote my function as: def steps(): for i in range (1,4): string = str(i) * 4 print(string) How do I put in the little spacings? I k...
Problem: I am trying to solve the $N$-Queens problem using Constraint Satisfaction and Heuristic Repair (also known as Min-Conflicts). I wrote a program to do this for any given $N$ queens and $N * N$ board. I observed that a solution should be found in $N$ passes or less (since we need to find $N$ non-conflicting loca...
In this article : Kinodynamic Motion Planning B. Donald, P. Xavier, J. Canny, J. Reif https://www.cs.duke.edu/brd/papers/src-papers/jacm-final.pdf The authors present a PTAS algorithm that can compute a safe, close to optimal trajectory from a point A (having a certain speed vector) to a point B (having a certain spee...
I am a musician/producer and very interested in the way humans are able to identify sounds. I am interested in a way to have an algorithm identifying different instruments that were originally mastered as stereo or mono. Maybe computers would be able in future to isolate different instrument tracks and remaster them. ...
We have a DFA $A = (Q,\Sigma, \delta, q_0, F)$. States $p, q$ $\in Q$ are equivalent, $p \sim q$ if $ \forall w \in \Sigma ^ \ast$ $ \delta^*(p,w) \in F \iff \delta^*(q,w) \in F$ States $p,q$ are equivalent after $i$ steps, $p \sim ^i q$, if $ \forall w \in \Sigma ^ \ast$ such that $|w|\le i$ $ \delta^*(p,w) \in F \if...
I'm writing an algorithm that, given a limit N, and given a list of elements of value V, find all the possible combinations so that the sum of the elements is equal to N. Note that several elements can have the same value. A simple example to demonstrate this, if N=16, and that we have 3 elements, a, with a value of 3,...
I have a DAG with $n$ nodes and $n-1$ edges. The edges in DAG (fixed) are defined as follows: For every node $i$, $1 \le i \le n-1$ is connected to node $i+1$. The lengths of the $n-1$ edges are given as input. I need to compute the sum of all of the distances between all pairs of different vertices, i.e., to compute...
Is there a numbering (not Gödel numbering) of all computable functions $U(p, x)$, such that the set of numbers of functions defined in zero is exactly the set of even numbers. More formally: $I = \{p,\ |\ U(p, 0)\ \mathrm{defined}\} = 2\mathbb{N}$. My guess that it's true. But I'm not sure how to prove it. Ideas: We c...
I'm trying to understand functional dependencies in databases. Let's say, there are 3 tuples in an instance of a certain relation S as shown below. I'm trying to determine if a certain functional dependency will hold over S. Please correct me if I'm wrong. 1) A -> B should hold because no 2 similar value of a give 2 d...
I'm having trouble with this problem. Can't find a CFG. Someone an idea? $$L=\{a^n b c^n | n \ge0\}$$
Let $s = \{x_1, x_2, \ldots, x_n\}$ be a set of $n$ random non-negative integers where $\sum_i x_i = n$. And let $\{y_1, y_2, \ldots, y_{\sqrt{n}}\}$ denote a subset of size $\sqrt{n}$ of $s$, chosen uniformly at random. Defining $y$ to be $\sum_i y_i$ I am interested in calculating the value of $y$. By linearity of ex...
I am trying to do automated programming research: business software generation from the knowledge base that is implemented as Scheme (Lisp dialect) code (in the framework of http://opencog.org/ Atomspace). My question is - how to generate Java source code in academically acceptable way? I know or I can imagine several ...
In my CS class, we've discussed two ways of dealing with the temporary array required for the merging phase of mergesort. One of them is to pass a full-size temporary array as a parameter, e.g. merge(array, tempArray, first, last), and another is to create a temporary array of appropriate size (or two half-sized arrays...
Why is big omega of finding a peak in an unsorted array Omega(lg n), not Omega(1)? I understand that peak finding is O(lg n), because in the worst case, we find a peak in the last possible step, so when drawing a decision tree, the height of the tree (lg n) would be the worst case situation. However, in the best case, ...
Does affinity propagation work well for for multidimensional data? While I was reading about it I couldn't find much information on this topic and all the examples I've seen we about 2D data. Could it be that Affinity propagation is still good for 3D and 4D data but is bad for 10+ dimensions? I am quite sorry for askin...
I have noticed that while doing research in computer science you come across many weak but negative results. Now, not every negative result deserves a paper of its own. So I was wondering, is there a website where people can dump their weak results? If so, how do I look about on this website? For example, recently we s...
I am trying to understand quantum computing concepts and have gone through alot of websites and books such as: Quantum Computing by Mikio and https://people.eecs.berkeley.edu/~vazirani/f04quantum/notes/lecture1.pdf So I do understand conceptually how to make measurements but I have enclosed images of a circuit i devise...
Let $G$ be a DAG with $v \in V$. Suppose that there exists some $i$ such that for all topological orderings $v_1, \ldots, v_n$ we have $v_i = v$. What's a set of necessary and sufficient conditions about $v$ for this to occur?
I am learning OS from Silberschatz book. I read the Valid-invalid bit in a process page table also. But I could not understand why valid-invalid bit is required. The pagetable is dynamically built as pages are mapped to frames. So all the entries in page-table are valid. thanks
I see that most definitions of what it is to be Turing-complete are tautological to a degree. For example if you Google "what does being Turing complete mean", you get: A computer is Turing complete if it can solve any problem that a Turing machine can... While it is very well defined whether different systems are Tu...
I have a problem at work where I have set of hyperrectangles, in no particular order, that do not overlap and when unioned create a hyperrectangle with no gaps. At the moment I am looking for a way to efficiently figure out which hyperrectangle a given coordinate is within. I do not always have too many hyperrectangle...
For example, many reductions from $A_{TM}$ will often have the lines: Simulate M on w: if M accepts ... else But: a reduction is a computable function, right? So why are we allowed to say "if M accepts"? Also, I can take the same logic and reduce $A_{TM}$ to a deciable language: Let L be the empty lang...
I am working on a proof of the theorem that every LEFT-RESET Turing machine has an equivalent conventional, single tape Turing machine. The transitions for the LEFT-RESET Turing machine are {Right, RESET}, and the transitions for the conventional Turing machine are {Left, Right}. Here is the general outline of my proof...
I am going through the book operating system principles by Hansen . Hansen begins the third chapter on concurrent programming by discussing interleaving of the machine instructions of processes being run at the same time . Then it begins with providing the language notation for multiprogramming and writes the followin...
Reading this wikipedia article on B Trees, I have implemented the algorithm. I got to the section on Initial construction and ran my algorithm implementation and it differed. With 8 being the root index. Am I right in thinking, that when you bulk load your leafs are going to full, but when you add the indexes individua...
I want to figure out how two languages are different. If we have TM M and TM N, how would I figure out if the languages are different? My intuition is that if a M accepts an input a and N does not then that would prove the languages are different, right? I'm not too sure if I'm thinking of this correctly.
So, I'm refreshing my undecidablility knowledge, and I came across this statement reading about Post's Correspondence Problem on Wikipedia: A simple variant is to fix n, the number of tiles. This problem is decidable if n ≤ 2, but remains undecidable for n ≥ 5. It is unknown whether the problem is decidable for 3 ≤ n ...
Let be $k\ge1\in \mathbb{N}$. Is there a deterministic automata graph that recognizes the language $L_k=\{w|w \mbox{ contains an a within the k last chars}\}$ ? The language is $\{a,b\}$. Reformulation : the question is like : How to construct an automata that does $L_k=\Sigma^*(\Sigma^k\mbox\ b^k)$. (I'm not sure...
I am currently running my head around to understand if i am actually getting it correct or not? A memory chip with 1 byte cell size has 12 address lines. How many data lines does the chip have? What is the memory size of the chip in Mbytes? 12 address lines means it has 2^12 cells in the memory, right? Then what is MBy...
We have $A_{TM}=\{(M,w)|M$ is a TM, $w\in \Sigma^*_{TM},M$ accepts $w\}$ We intend to show that $HALT(M,w)\leq_T A_{TM}$ i.e. if we are given a machine for $A_{TM}$, we can decide whether $M$ halts on $w$ using it. So, if $M$ accepts $w$, machine halts and we are done. But if $A_{TM}$ says rejected how to know if $M$ h...
For proving a language is not CF, I was wondering when we split up the string to 5 pieces are we allowed to proportion it anyway as long as we satisfy the following conditions : \begin{align} |vwx| &\le p \text{ (pumping length)}\\ |vx| &> 0 \end{align} Could I possibly make the $u$ value take on a majority of the str...
I read a paper which mentioned routine induction many times. But when I google it, there are nothing showed up. I think routine induction means the induction on the structure, analyzing possible cases in proofs. am I right? Just to make sure, I am asking it here.
I am a little bit confused about the emptiness problem of the linear bounded automaton (LBA). I know that this problem is undecidable. However if we assume that is decidable, what could be wrong if we reduce it to the acceptance problem of LBA?
Are Interrupts really just an abstracted form of polling? I saw a system-file-watcher library that stated it used polling, as opposed to listening for events. Is the .NET framework SystemFileWatcher class just an abstraction of polling? In a computer, interrupts are stacked, and the CPU checks the interrupt stack after...
$L$ is the class of languages that are decideable in logarithmic space on a deterministic Turing machine. In other words, L = SPACE$( \log n)$ But why $\log n$, instead of $\log^2 n$ or $\sqrt n$. This is what, I find out in the Theory of computation book by Michael Sipser Theory of computation book by Michael Sipser...
The general question, as the title suggests, is: What is the difference between DS and OR/optimization. On a conceptual level I understand that DS tries to extract knowledge from the available data and uses mostly Statistical, Machine Learning techniques. On the other hand, OR uses the data in order to make decisions...
Is there any difference in between these two declaration: (1). char ch; (2). char ch[2] Actually the thing because of which this question arrived in my mind is the ending with '\0' i.e. null character so one of the 2 characters of the array ch[2] is null character hence only one character can be input in this. Please...
This was adapted from Quantum Mechanichs for Computer Scientists. On this equation, we have $I$ representing the identity operator, with $Z$ being defined for 1 bit as: $$ Z|0⟩ = |0⟩, \quad Z|1⟩ = -|1⟩\,.$$ The operation $\frac 12{(I+Z_1Z_0)}$ acts as the identity for the two-bit states $|00⟩$ and $|11⟩$ while returni...
Given an NFA, to decide if it accepts a word w, one could use the following algorithm: Transform the NFA into a DFA. Then, run w on the DFA and accept/reject if the DFA accepts/rejects. Could this be done on a linear bounded automata? How do I know for sure that the encoding of the DFA won't go over the input space?
Knowledge bases and expert systems are usually production rules systems and as such they lack expressive means for expressing modalities like "agent believes in statement", "agent has duty to perform action", "agent has permission to perform action". Modalities are usualy written as modal operators (diamond and square ...
I have the following 2-bit binary multiplier (source: wikimedia.org) How can I modify this 2-bit binary multiplier to make it a 3-bit binary multiplier? I notice that there are 2 half-adders, and there are a bunch of ANDs to begin with. It is tricky to see a pattern here, I would normally use a truth table but there w...
What does it mean if I'm given a description of a TM? Does that mean, that since I'm given I know exactly what M will accept/reject/loop? Not sure exactly of what to think
Texts on microprocessors use lines like the following ones : "The instructions in an instruction set of a microprocessors have their own address " "In the first clock cycle the instruction is fetched from its address and then the operands (variables) "It was a breakthrough to realize that both the instructions and vari...
I am working on $\lambda$-terms and trying to prove the $=$ is an equivalence relation on $\lambda$-terms. My problem is proving reflexive relation. $\frac{}{\theta \vdash x = x}$ $\frac{ \theta,x \# N, y \# M \vdash M = [y := x]N } { \theta \vdash \texttt{$\lambda x.M$ $=$ $\lambda y.N$} } $ $\frac...
I'm reading the Wikipedia page on Linear Search and it is mentioned that there are on average $\frac{n}{2}$ comparisons. I tried working this out on my own. First I considered the number of cases. There are $n$ cases corresponding to when the target value is the $1$st, $2$nd, ..., $n$th entry of the list. There is also...
I'm having a hard time thinking of context free languages. The only example I've been able to think of is $0^n1^n$, but I'm having a hard time thinking of any others. Can I get some examples?
This is a question from Hackerrank. Given a string S, find the number of "unordered anagrammatic pairs" of substrings. In other words, find the number of unordered pairs of substrings of S that are anagrams of each other. Two strings are anagrams of each other if the letters of one string can be rearranged to form the...
Suppose I maintain a proprietary database and claim that it has N records. Before subscribing to my database a client wants a proof that the database is indeed this large. What theoretical protocol can I employ to prove my database size with possibly revealing only a small number of records?
In his famous article, "Computing Machinery and Intelligence", Allan Turing talks about discrete-state machines and the largeness of the number of states provided by that time "state-of-the-art" machine, "Manchester Machine", which he states is about 2^165,000. Link to the article Well, that was 1950's. I'm trying to c...
In (An Introduction to the Analysis of Algorithms) by Philippe Flajolet and Robert Sedgewick it's written that: Insertions and search misses in a BST built from N random keys require ~ 2 ln N (about 1.39 lg N) compares, on the average. I didn't get it well, even after I read their explanation, can you help to understan...
I have an encoding of an unambiguous grammar $G$. Can I apply a morphism $σ$ so that the grammar becomes ambiguous? I have no clear concepts about this, only the idea: "grammar $G$ is ambiguous if there's a string $x \in L(G)$ having two different leftmost derivations in $G$". I would like a good explanation and if it'...
I have modelled the craps game (https://en.wikipedia.org/wiki/Craps#Rules_of_play) as a dtmc with the prism model checker: dtmc module craps // local state - won = 7, lost = 8 s : [0..8] init 0; // first roll [] s=0 -> 1/12: (s'=1) + // point 4 1/12: (s'=2) + // point 10 1/9 : (...
I have been asked to find a grammar that will generate the language $\{a^{n^2}:n \ge0\}$ in an exercise. So far I tried to replicate the previously written characters with my grammar rules but it didn't work. Any idea on how to setup such grammar? Any help will be appreciated.
Write a program that takes N numbers as input and prints all 3^(N-1) equations that can be formed by inserting the operators +, -, or * between these numbers (keeping them in the initial order). Also count how many unique answers there are and print that as well. So far, I have this code import math def expressions(...
In order to find the recurrence function of The Height in Heap, the following figure is drawn. Question 1: How can we compute the height if Right subtree in form of Log in base 3, and why do we have the height of Left subtree as log in base 3/2? Question 2: it is stated that: "for a complete binary tree to have the ma...
Is it in general acceptable by computer science community, if the run-time or space consumption of an algorithm is derived by experiment and not analytically? For example let's say we have an algorithm for which it's running time is given by function $f(n)$, where $n$ is the size of the problem. There is no way to deri...
I am working on a project on recommendation systems, and would like to know about specific areas/research papers on which some new work can be performed, but not something too time/coding intensive. Its for a project due in 2 months.
I was reading notes on computability theory when I came across the term "Linearity" which I was not familiar with, in the context of boolean functions. I am quite comfortable what linear maps mean in Vector Spaces (say in the context of linear algebra and functional analysis) but I had never seen this term being used i...
I have the following idea for a network-based operating system. Suppose we have two computers A and B in a network. If computer B wants to access the memory of computer A, it can access by using the following addressing method which uses Media Access Control (MAC) address of the machines, (MAC Address of target machine...
This is my first question in this forum. I hope you will help me. I was asked by a colleague to solve this puzzle. The puzzle goes like this: I have an m x n grid where each cell can be in either of two states: on or off. Initially the cells are in off state. I would like to have an algorithm that takes an integer inpu...
This is the problem above. Can anyone help me here?
Pictured is the problem in question. How do I compute the line equations for these two crossing tangents? These lines happen to be supporting two point sets for two convex hulls.
Why is the optimum vertex cover problem interesting? Are there practical applications, or is it just another theoretical NP-hard problem?
Hi I wrote the following recursive decimal to binary function while studying for Andela. def binary_converter(q): if q>255 or not isinstance(q, int) or q<0: return "Invalid input" if q==0: return '0' elif q!=0: q, r = divmod(q, 2) return str(r)+binary_converter(q) The code w...
Figuring out whether one convex polygon lies in another seems fairly straightforward... however the problem lies in computing counterclockwise points of tangency.
Let's consider a greedy algorithm for the coloration problem called the Dsatur algorithm, designed by Daniel Brélaz in 1979 at the EPFL, Switzerland.. This algorithm is based on an order of vertices which we can obtain from considering the saturation degree of each vertex $v$ from $G$. The saturation degree of a verte...
Given a full binary tree of size $n$, I need to cut the tree into two by choosing an edge and removing it. I want the cutting to be as equal as possible (i.e. the two subtrees have as equal weight as possible). Can I always cut the tree into two equal subtrees? If not, what is the lower bound for the cut (the smallest ...
There are $n$ charges placed on the x-axis at points $1,2,3,\dots,n$. We need to calculate the force on each charge by every other charge. I need the exact force. Charges can be arbitrary. Inputs are the charges possibly in the form of an array. Force is defined in the usual physical way. I know an $O(n^2)$ algorithm t...
I'm currently learning about graphs and I have some questions regarding adjacency matrices. Given an arbitrary adjacency matrix: Is there any way to tell if that matrix represents a hierarchal graph structure? Obviously in the above case it's not. Something like: I know the rows of and i x i adjacency matrix repr...
Lets say we know the co-ordinates of each object in a camera co-ordinate systems. How do we find out if some object is on top of each other? My idea is: Compare each object and point with one another.For two different points on different objects check if the X and Z values are the same and the difference between the Y ...
I've included an example of one such orthogonal pyramid. I would like to find a way to prove that this orthogonal pyramid can be partitioned by diagonals into convex quadrilaterals, and do so with an algorithm in linear time. My understanding is that a sweep-line algorithm from top to bottom would work well. However, ...
I find it hard to find formal definitions of function complexity classes. Here are two from Wikipedia. A binary relation $P(x,y)$ is in FP if and only if there is a deterministic polynomial time algorithm that, given $x$, can find some $y$ such that $P(x,y)$ holds. The definition above seems to imply that for all...
I am trying to understand the difference between Paris-traceroute and normal traceroute. I am using this website ( https://paris-traceroute.net/about) and trying to get the idea, what is Paris-traceroute trying to achieve. If I understand correctly,original traceroute does not care about the flow that is assigned by th...
So diagonalization as we all know is an extremely productive way of showing uncomputability, the other main tool used by CS people for this task being reduction. But it has occurred to me that I do not know a single uncomputable problem whose demonstration of uncomputability does not rely on diagonalization or reductio...
I already have a network which is like random complex network. Is there any way I can delete some of nodes and reduce the network into a scale-free network? I notice there are some methods that can sample a scale-free subnet from a scale-free network. But I have not found anyone sampled a scale-free subnet from a rand...
A while ago, I was asked to solve a question similar to this: We are given an array arr and we would like to find all pairs of items (a, b) where a = b + k. The items are NOT unique and it is also possible to have k = 0. I know that if items are unique, this problem can be solved in linear time by using a hashmap. Ho...
When we have a recurrence relation of a program, as an example: T(N) = N log N + 9N + 55 and the CPU capability let's say (10^6) or any other number. What is the formula or the method to estimate the run time (in second) if we run a program represented by a function of N, and a given N "inputs"?
This example is from Algebraic Subtyping, p. 14. Let's say we have a type system with just function types, $\bot$ and $\top$; propositions involving type variables are defined by quantification over ground types. I understand why $$(\bot \rightarrow \top) \rightarrow \bot \leqslant (\alpha \rightarrow \bot) \sqcup \alp...
I have provided a picture as an example. We have two point sets, P and Q. P is to the left of this vertical line (named x = x0), and Q is to the right of it. The goal is to compute the line equations for both l1 and l2, as listed in the picture. My understanding is that this is a linear programming problem. The algori...
How does the DB manage a pool of buffers when the operating system ends up controlling what's really in memory? For example, couldn't the operating system decide to evict a page frame from a DB's buffer?
We know that $f(n) \in O(g(n))$ notation means shortly, that $f(n) \leq cg(n)$ for $n>n_o$ where n and c are some positive constants. And actually it gives the behavior of $f$ as $n$ goes to infinity. But in the case $f(n) \in O(\frac{1}{n})$ where n is at most 1, shouldn't be more intuitive to say that the behavior of...
Like let’s say you find the shortest path, but you want to find an alternate path as well. In order to do that, you have to ignore each edge in the shortest path one at a time, and then find the shortest path without using that respective edge. At that point you have a set of alternate paths, of which you want to selec...
Let $A$ be an $m \times n$ matrix. Let $F(A,S(t),t)$ be a program function, where $t$ is an integer counter beginning at $0$ and stopping at some $k \leq m,$ and such that $S(0)$ is empty. The function first iterates $t=1$ and then operates on $A$ in such a way that indices for a subset of columns of $A$ are stored in...
I restate the question: if $ b(x) <f(x) \leq g(x)$ where $b, g \in \Theta(x)$ can we state $f(x) \in \Theta(x)?$ notice that $b(x)< f(x)$ and not $b(x) \leq f(x)$. In other words what if $f(x) \in \omega(b(x)) $ and $f(x) \in O(g(x))$ can we state $f(x) \in \Theta(x)$?
There are x digits and y boxes where y is between 1 and x inclusive. I have to print all the possible digits in boxes (combinations) in any order. For examples, if x = 5 and y = 2 we can have the following 4 combinations: 1234 5 123 45 12 345 1 2345 Similarly if x = 5 and y = 3 123 4 5 12 34 5 12 3 45 1 234 5 1 23 45...
I came across linear equation $G(x,y) = g_k(x,y) l_k(x,y)$ mod $(y^{2^{k}})$ while reading factoring algorithm see section 3 for bivariate polynomials. I need to find the $G(x,y)$ and $l_k(x,y)$. Given : $g_k(x,y)$, where $deg_y(g_k(x,y)) < y^{2^{k}}$ and $deg_x(g_k(x,y)) < d $. Find : $G(x,y)$ and $l_k(x,y)$. (non tr...
I understand that "structure" of data is totally dependent on Boolean Algebra, but: Why is data considered to be a discrete mathematical entity rather than a continuous one? Related to this: What are the drawbacks, or invariants, that are violated in structuring data as a continuous entity in $r$ dimensions? I am...
I was studying loop invariant and came across Tomas Petricek's example. Here's the equivalent(I believe) program after I revised it a bit for proof in Hoare logic: j = 9; i = 0; while (i < 10) { i = i + 1; j = j - 1; } The loop invariant given by Petricek is i + j == 9, which makes sense to me. And the pre-con...
Is there any general result to show that which automaton is more succinct? I have a set of LTL properties and I would like to know (show) which automaton is more efficient in term of state number and edge number.
I have an array say 8 3 5 4 4 4 4 4 3 2 7 11 12 7 7 7 7 1 2 total =17 elements now you are given a range say [2,11] both included ,now you have o find out the element that has occurred the max number of times and the number of times it has occurred A simple traversing through the array in the range and keeping the ...
I was reading nominal unification paper. I could not understand the proof of a lemma. The paper is here nominal unification. The lemma is following. $\sigma$ is a substitution, $\pi$ is a permutation (swapping of atoms). Lemma 3.3. if $\Delta \vdash \sigma(\pi .X) \approx \sigma(t)$, then $\sigma.[X:=\pi^{-1}.t] = \s...