instruction
stringlengths
35
11.4k
Suppose we have an $N \times N \times N$ 3-d sorted array meaning that every row,column, and file is in sorted order. Searching for an element in this structure can be done using $O(N^2)$ comparisons. However are $\Omega(N^2)$ comparisons needed in the worst-case? For an $N \times N$ 2-d sorted array I recall a proof t...
I was asked to give a formal description of a Turing machine I have no experience with this, and was wondering what "formal description" entails.
I will try to give the motivation behind this problem and later the math formality. Given a grayscale image (1 Channel - M by N Matrix). Someone marks some pixels as anchors. Now, you need to interpolate the other pixels (Which are not anchors) by minimizing a given cost function s.t. the end result is an image which h...
If $A \leq_m B$ and $A$ is not mapping reducible to $co\text{-}B$, then $A \leq_T co\text{-}B$. Is this true? My intuition is false even if we can find some special case to make it true such as $A=B=co\text{-}A_{TM}$. However, I still can't find a counterexample. Could anyone give me a little hint?
I'm having trouble grasping this the concept of reductions. I found the solution and it looks like this: Assume that $M_5$ is a Turing Machine that can decide if a given Turing Machine $M$ accepts any string of length $5$, i.e., $L(M)$ contains a string of length $5$. The above figure shows how we can use this to cons...
I'm writing an algorithm to solve a research problem involving searching for numbers on very large arrays. I encountered a sub-problem that requires me to break up sums of numbers which are power of 2, i.e. how to find combinations of these numbers that sum up to a certain value. The sum and the combination size are gi...
In section 9.2 of CLRS (Introduction to Algorithms; page 185 in the 2nd edition and page 215 in the 3rd edition), a randomized selection algorithm is presented. For its analysis, $T(n)$ is a random variable denoting the time required on an input array $A[p \cdots r]$ of $n$ elements and $X_k$ is an indicator random va...
In the coursera NLP course, Dan Jurofsky says you might want to extract relations from text to serve as input to other algorithms. What are examples of ways that researchers have used or might use relations extracted from text as the input for later "downstream" algorithms?
When learning about the architecture of computers and how it works, we are thought that the lowest language that we can find that the machine understands is binary as 1&0. And anything that we input will have to be transformed/converted to binary, but being binary numbers wouldn't that mean that we would need another i...
I am trying to figure out what the big o estimate of the following for loop is. for(int i = 10; i to 100; i++){ for(int j = 1; j to i; j++){ for(int k = 1; k to j; k++){ s=s+i+j; } } } I was thinking that the two inner loops run n times but I am unsure about the first loop. What would the Big O estimate be for this c...
Suppose I have a array of real numbers with $n$ rows and $m$ columns. I want to consider possible ways of dividing that array into rectangular regions of three different possible types: a constant value over the entire region, a linear gradient across rows or a linear gradient across columns. For example, the array $\...
For $L_1,L_2 \in RE - R $ , I want to prove or disprove if the following can occur: $L_1 \cap L_2 \in R$ $L_1 \cup L_2 \in R$ $L_1 \cap L_2 \in R$ and $L_1 \cup L_2 \in R$ What I did: I think any two disjoint languages suffice, since the empty set is decidable. I think something along the lines of a language and its...
If I have 2 CPU's of the same manufacturer... say AMD Both are Quad-Core, Both are rated at 3.6Ghz 1 is 100W, the other is 65W Will the one with the higher wattage out-perform the lower one and why?
With regards to introductory (beginner) Von Neumann computer architecture, how does a program change the order in which instructions are executed? I know the control unit is responsible for retrieving the instruction from memory and then decodes and executes the instruction. Their connected by a bus. The control unit a...
Here's the code for the algorithm: Foo(n) lcm = 1 for i = 2 to n lcm = lcm*i/Euclid(lcm,i) return lcm The running time of Euclid$(a, b)$ is given as $O(\log(\min(a, b)))$ So the running time of the for loop will be $O(n)$, so would this be the final running time? or do I have to take the $O(\log(\min(a, b...
For instance, the tape on a Turing machine is infinite, where as we usually only have a finite amount of available memory. Secondly Turing machines are not really convenient IMHO for proving things about everyday algorithms on an everyday computer. I want a model that makes computations in a ring, namely $\Bbb{Z}_p\ti...
Thanks to Yuval Filmus, I got to read these lecture notes by Trevisan. At the bottom half of Page 5, The capacity of cut $S$ is the number of edges that go from $S$ to $\overline{S}$, that is $\text{Capacity}(S) = |L_2|+|R_1|+\text{edges}(L_1, R_2)$. Here, $L_1 = S \cap L$, $L_2 = L \setminus S$, $R_1 = S \cap R$ an...
I'm studying Distributed Systems and synchronization and I didn't catch this solution of totally ordered multicast with Lamport timestamps. I read that it doesn't need ack to deliver a message to the application, but "It is sufficient to multicast any other type of message, as long as that message has a timestamp larg...
Given a program $P$ which takes a binary string as input, can one always (effectively) construct a program $P'$ such that $P'(0x)$ runs $P(x)$ and $P'(1x)$ outputs the source code of $P'$? I didn't find anything with some googling, but it seems like the kind of thing that could be known.
Let $L = \{ <M> | M$ halts on every input $x$ in at most $200 * |x|$ steps $\}$. Is $L$ decidable? Recognizable? Given that membership in $L$ asserts something about $M$'s behavior on an infinite set of strings, it seems extremely unlikely to me that $L$ could be either. I have shown that co-$L$ is Turing-recognizable...
Sorry for the trivial question; has the following decision problem an "official" (possibly short) name? Given two $n \times m$ $\text{0-1}$ (binary) matrices $M_1, M_2$ check if they are the same up to row and column permutations. (something like the short names used in complexity theory for decision problems: e.g. ...
On the matter of the Heartbleed bug, Bruce Schneier wrote in his Crypto-Gram of 15th April: '"Catastrophic" is the right word. On the scale of 1 to 10, this is an 11.' I read several years ago that a kernel of a certain operating system has been rigorously verified with a modern program verification system. Could hence...
I am trying to find out accept, loop and reject in this Turing Machine because it doesnt have any...I am not sure if I completely understand it but this is the turing machine I am talking about... so accept state would be --> Accept(T2) - all words with a a loop state would be --> Loop (T2) - /\ ...
On math.stackexchange, someone asked how to count the number of ways to place $1$'s into a $10 \times 10$ matrix so that every row and column has $5$ $1$'s. Each element of the matrix must be either zero or one. I came up with a recursive solution for an $N \times 10$ matrix. Subproblems are indexed by the counts $c_...
Wikipedia shows how one can determine the minimum vertex cover in a bipartite graph ($G(X \cup Y, E)$) in polytime from a maximum flow using alternating paths. However, I read that the (S,T) cut (extracted from the final residual network) can also be used to determine the minimum vertex cover: $$(X\cap T)\cup(Y\cap S)$...
I read that Category Theory has alot to do with how programs and information can be organised.Can Category theory simplify various programming strategies? If a specific Category is represented as a directed graph is this similar to flow charts used in programming?
Could most categories , or a finite part of them be represented on a subset of a complete graph of N vertices (Kn) which is connected. and partly directed? Could all the axioms of category theory be written for such graphs?
Is the language $L = \{a^nb^m : n = 2^m\}$ context-free? Assume L is a context-free language. Then $\ \exists p\in \mathbb{Z}^{+}:\forall s\in L\left | s \right |\geq p. s = uvxyz,\left | vy \right |\geq 1,\left | vxy \right |\leq p. s_i = uv^{i}xy^{i}z\in L\forall i\geq 0\ $. Let s = $\ a^{2^p}b^{p}\ $ Pumping i times...
I have N events, each repeats after some time ti. I want a queue where I can pop out next event. For example, I have events A,B,C with intervals 2,3,5 At the beginning they all are in the queue with values: A-2, B-3, C-5 When I take out event, it should be A, after that I put it back, but add +2. B-3, A-4, C-5 Next is ...
I was reading a paper for recognizing interval graphs. Here is an excerpt from the paper: Each interval graph has a corresponding interval model in which two intervals overlap if and only if their corresponding vertices are adjacent. Such a representation is usually far from unique. To eliminate uninterest...
I'm looking for a sweep line algorithm for finding all intersections in a set of line segments which doesn't necessarily require the general position constraint of Bentley-Ottman's algorithm (taken from Wikipedia): No two line segment endpoints or crossings have the same x-coordinate No line segment endpoint lies upon...
I have done the proof until the point when $T(n) \leq cn^{\log7}$. But when it comes to finding the value of constant $c$, I am getting stuck. The given recurrence relation is $T(n) = 7T(n/2) + n^2$. Since we already calculated the solution above which is $cn^{\log 7}$. Inductive step: Now we have to prove that $T(n) ...
I am in an entry-level algorithms class, and for our final project we are coding and thoroughly analyzing 6 different sorting methods. Part of the analyzation is timing the methods and comparing the runtime results depending on the original order of the array (in order to more fully grasp the concept of constant costs,...
I was searching through Google and I couldn't find anything. Can a Post machine have more than one accepting state?
Suppose there is a travelling salesman who wants to travel through N cities in k countries(k <= N). For convenience, he will travel all the cities within a certain country and then move to another. In each country, he wants to find out the shortest simple path to traverse through all the cities.[Classic TSP problem] Q...
According to information theory, the logic gates AND, NAND, OR, NOR all lose 1.189 bits of information each with two bits of information at their inputs and with all inputs being independently and uniformly distributed. When gates are used in combination with other gates in a circuit, to calculate the entropy loss for ...
Considering above terminologies for drawing control flow graphs for any program, it is very simple. For example : While A if B do .. else do .. end while For above example, while doing decomposition, I can say its D2 (D1) i.e while and then inside while, its if-then-else. Considering same situation. How can you r...
I am reading The Algorithm Design Manual, 2nd Edition. The book gives an example task and then explains how to solve it step by step. (The task and solution is detailed here) But I don't follow one step from the solution. That step doesn't contain enough details for me so I don't understand it. I'm asking if someone c...
let's consider a table with carID | hireDate | manufactory | model | custID | custName | outletNo | outletLoc I want to evaluate all the functional dependencies to bring in first, second and then third normal form. Functional dependencies carID,hireDate -> custID Partial dependencies carID->manufactory, model, outle...
Say I want to compute a covnex hull of given points on the plane. I would like to write an algorithm, that only compares the points and doesn't do any arithmetic operations. Wikipedia states, that: The standard $\Omega(n \log n)$ lower bound for sorting is proven in the decision tree model of computing, in which only ...
I am wanting to create a map where the key contains multiple elements and the elements can be empty/null. The empty values are treated as "anything". I want to lookup function to match when the stored key is the lookup value or it is a generalised version - index key has empties where lookup value has values. I think t...
I'm creating a sudoku solver, and I'm wondering at what point, with a simple backtracking sudoku solving algorithm, does the result take way too long to compute? I'm thinking like more than 30 minutes? I'll probably try to implement some heuristics, but I want to know at what point should I not expect a solution within...
Suppose we have $n$ balls and $n$ bins. We put the balls into the bins randomly. If we count the maximum number of balls in any bin, the expected value of this is $\Theta(\ln n/\ln\ln n)$. How can we derive this fact? Are Chernoff bounds helpful?
I'm trying to construct a deterministic multi-tape turing machine for the following language in order to show that $L$ is in $DTIME(n)$: $$L = \{ www \mid w \in \{a,b\}^+ \}$$ I'm not sure how to get started. Any hints would be appreciated.
So if k is the number of tapes, is a multi-tape Turing machine allowed to have k = ∞ tapes. I'd assume not since this would give an infinite transition function?
I'm given a graph and two weight functions, $w_1$ and $w_2$, such that there doesn't exist a negative loop in the graph in $w_1$ and $w_2$. I'm also given two vertices, $s$ and $t$, and am asked to find the lightest path from $s$ to $t$ in relation to $w_1$, out of all the lightest paths from $s$ to $t$ in relation to ...
A polynomial map is equal to another polynomial map iff they take on the same values at each point. So this is different from formal polynomials. So since in $\Bbb{Z}_p$, $x^{p-1} = 1$ for all $x \neq 0$, and is $0$ on $0$, we have that there are a finite number of polynomial maps in $\Bbb{Z}_p[x_1, \dots, x_k]$. F...
I've googled this problem somewhat pretty extensively, and all the relevant literature understandably deals with 2-d or 3-d cases, rather than the n-d case. EDIT: Yes, ℝn. I've done many searches combining terms like union, intersection, volume, convex hulls, polytope, etc. I've come across papers like this and this. M...
I'm currently trying to prove a language regular (for personal amusement). The language is: The language containing all numbers in ternary that have even bit-parity when encoded in binary. Now, I've currently tried a few different approaches that have not led me to any success. I've tried using the pumping lemma (could...
I am trying to tackle a specific problem so any help would be greatly appreciated: Let $G = (V,E)$ be an undirected graph with vertex set $V$ and edge set $E$. A 3-coloring of $G$ is a map $\chi:V\to \{R,G,Y\}$ such that if $\{x,y\}\in E$ then $\chi(x)\neq \chi(y)$. (Let $R,G,Y$ stand for red, blue, and yellow respect...
I'm trying to make an algorithm to calculate what combination of cards from what buyers I should get to get the cheapest deal. Taking the shipping costs into consideration. It's for a website called MagicCardMarket, which is kind of an Ebay for trading cards. The problem is that the site doesn't have a proper optimizat...
I was wondering about the nature of these managed languages i-e since c# and java both are converted into intermediate language and byte code respectively, and are interpreted by their respective runtime(s). So if they are somehow pure interpreted languages then is it feasible to develop any crucial application on thes...
I'm trying to reduce an optimization problem to a decision problem, more specifically, consider the Max-Cut problem in its decision version: Given $(G=(V,E),k)$ as input, where $G$ is an undirected weighted graph (all weights are positive integers, formally: $w: E\rightarrow \mathbb{N}$ is the weight function) and $k\i...
My textbook says: "The Boolean hierarchy is contained in the class $P^{NP}\subseteq\Sigma^P_2\cap\Pi^P_2$." However, it provides neither a proof nor a proof sketch nor some hint. How can I convince myself that the claim is true?
Given $n$ points $x_1, x_2, ..., x_n \in \mathbb{R}^k$, where $\mathbb{R}^k$ can be high dimensional. Is it possible to devise a fast algorithm (1) Preparation: first take the n points as an input, do whatever preprocessing necessary. (2) Query: for each query $f_i = w^\top x$ being a hyperplane and a constant $b$, f...
I'm looking for a type inference algorithm for a language I'm developing, but I couldn't find one that suits my needs because they usually are either: à la Haskell, with polymorphism but no ad-hoc overloading à la C++ (auto) in which you have ad-hoc overloading but functions are monomorphic In particular my type syst...
I have been reading a lot and I am still unsure of how to determine this. Let's say I have an initial binary state vector (1, 1, 1). How would I go about determining whether (1, 1, 1) is a fixed point in the network? My initial understanding was to put the state through the network and if it converged to (1, 1, 1) the...
In my textbook, enumeration machines are defined as possessing a special write-only output tape, which they can write characters to, but not move the head of. When they hit the print state, the string on the output tape is enumerated and reset to a blank tape. Is this equivalent to the model of enumeration machines whe...
For instance, given the polynomial expression $xy + x + y + 1$ it will output $(x+1)(y+1)$. Thanks!
Why does packet don't need trailer/footer while frame needs it? I am trying to understand networking concept regarding OSI & TCP/IP layering. I have googled a bit and it says that the footer in data link layer pdu (frame) is needed as a mark of the end of the pdu. But why does packet data etc in the layers above it doe...
The principle (called a Löwenheim–Skolem theorem by Huth and Ryan) states Let $\phi$ be a sentence of predicate logic such that for any natural number $n \geq 1$, there is a model of $\phi$ with at least $n$ elements. Then $\phi$ has a model with infinitely many elements. IMO, it basically states that if you can ...
I'm trying to construct the small-step semantic rules involving the for-loops, but I can't find anything about it in the literature (only about while-loops). I was wondering if anyone could help me out with this? This is a first attempt, where $s$ represents a statement and $e$ an expression: $\quad \displaystyle\sigma...
I'm trying to reduce the MAX-2SAT problem to finding a cut in a graph, with no luck so far. Let me first show a description of the problem: 2SAT: Given a boolean formula $\varphi$ in a CNF form, where every clause has 2 literals (a variable or its negation), one should decide whether there is an assignment that will sa...
We know that $BPP \subseteq BQP$ but we have no proof $BPP \subset BQP$ (Though we have the proof that BQP $!=$ BPP with an oracle) Since Simon's problem (as factoring) it's easily solvable by a quantum computer, and in exponential time complexity solvable by a classical computer, that's a hint of the separation betwee...
Let the following datatype be defined: data T = A | B T | C T T That is, B, B T, B (B T), C A A, C (B T) A and so on all are members of T. Now, suppose we define two functions that operate on that type: f :: T -> T f A = A f (B x) = B (B (f x)) g :: T -> T g A = A g (B x) = B (B (B (g x))) There are restrictions on...
Let $C = m(P,X,Y) \leftarrow m(Q,X,Z), m(R,Z,Y)$. Is it possible to do the following substitution? $D = C\theta$ where $\theta = \{Q/R,R/Q\}$ s.t. $D = m(P,X,Y) \leftarrow m(R,X,Z),m(Q,Z,Y)$
So here is the challenge problem statement: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1512 Basically, given a 0/1 matrix, you need to permute the columns so that the first column is fixed and after the permutation of columns, then for each row the 1's in the...
In the Wagner Fischer algorithm to calculate the Levenshtein distance for two input strings, the first step is to compare each input string with the empty string for each input. Why is this step necessary? Is the purpose simply to keep the algorithm consistent when checking the strings for matches and mismatches to det...
How would one search for a string of digits in a large digit sequence? For example, I'd like to search for 351814 in Euler's number. I'm not too keen on computer science, I'm a pure math major, so I don't really know how to begin. I also wouldn't know how to run said code. Any help would be greatly appreciated.
I have been using C for a while, for some reasons I learnt C++. I can't see why object oriented is a "new" feature. For me an object is just a structure, and a set of functions which have a pointer to this structure as a parameter(the this parameter). So instead of creating structures then functions that modify them, ...
When simulating the clock page replacement algorithm, when a reference comes in which is already in memory, does the clock hand still increment? Here is an example: With 4 slots, using the clock page replacement algorithm Reference list: 1 2 3 4 1 2 5 1 3 2 4 5 Initial list would look like this: -> [1][1] [2][1] ...
I have pretty simple question, but still can't find an answer just googling it. I'm trying to understand Chomsky Normal Form (CNF). There are three production rules: $A \to BC$ $A \to \alpha$ $S \to \epsilon$ First two I understand. But last one $\epsilon$ doesn't makes sense for me. Why do we need this rule? What is...
I have heard of machine learning systems that can learn from trials of data what effect it should have, but I was wondering is it possible to make a learning appliance that builds on past data? Instead of only receiving new entries, once the database is big enough to begin going over it and doing pseudo consideration, ...
Is it necessary to take the same bit size of "p" and "q" in case of RSA algorithm? i had read that bitsize of p and q must be same. BUT after calculating, i found that bit size could be different also. But time complexity will increase. Can anyone help me?
I am trying to define a Odd Parity Function that takes three 1 bit inputs and will output a 1 if the 3 bits are odd as a Boolean function. 1 1 0 = 0 1 0 0 = 1 0 0 0 = 0 1 1 1 = 1 I understand this has a relationship to XOR as I can define this with 2 parameter as X xor Y = (XY')+(X'Y) My assumption is the function w...
I recently discussed with a friend about a website that proposed regex challenges, mainly matching a group a of words with a special property. He was looking for a regex that matches strings like |||||||| where the number of | is prime. I immediatly told him that won't ever work because if such a language was regular, ...
I have a VHDL elaboration engine/simulator. As I understand it, the language syntax allows for ambiguities at syntax level. That is, an assignment pin_value <= bus(5) can be interpreted as picking a child of the bus by index. Here the bus is a signal (an object). However, it can also be that paranthis are applied to a...
Is it more plausible that $NP\subseteq TIME[O(n^{\log n})]$ than $NP\subseteq P$? I don't see this mentioned much and is there a reason why? If this question doesn't make sense, explain why.
Whilst reading up on Xorshift I came across the following (emphases added): The following xorshift+ generator, instead, has 128 bits of state, a maximal period of 2^128 − 1 and passes BigCrush: [snip code] This generator is one of the fastest generator passing BigCrush; however, it is only 1-dimensionally equidistribu...
To add onto the question, how are elliptical differential equations applicable in this context? I was listening to a talk about Bayesian networks and someone asked if they were using differential elliptical equations in the context of linear relaxation.
Is there any class of NP problems that have one unique solution? I'm asking that, because when I was studying cryptography I read about the knapsack and I found very interesting the idea.
I'm not sure if this is the appropriate forum for asking the following question. Please guide me to the right forum. I am trying to understand the algorithms used by kernels(such as Integer Sort) in NAS parallel benchmarks. I could not find any source online that explained the algorithms used by the kernels. I could tr...
If I have a set $A$ with positive and negative numbers, and a number to find C. It is possible to reduce the problem to one with only positive numbers in set $A$? I mean, it is possible to find a new set $A$ and a new number $C$, so $A$ were only positive numbers, but the same problem?
I have made and trained a simple neural network which now seems to produce outputs reasonable in all the aspects but one: it gives negative values from time to time even though the outputs are always either 0 or 1 (positive) in all my treaining samples (the actual neural outputs show to be more or less close to the an...
I have a CS course at Uni. Had an exam about two last week with a question I did not get, but still, am not totally comfortable with the expected answer. Basically, we were asked Many processes can execute simultaneously on the Von Neuman architecture [True/False] I wrote True. Got it wrong, lost some points. But...
I am looking for concrete and simple problems that may be solved using bipartite graphs or bipartite graph properties. Any idea along with explanations are welcome.
How many arithmetic operations are required to find a Moore–Penrose pseudoinverse matrix of a arbitrary field? If the matrix is invertible and complex valued, then it's just the inverse. Finding the inverse takes $O(n^\omega)$ time, where $\omega$ is the matrix multiplication constant. It is Theorem 28.2 in Intro...
As far as I know choosing an activation function for the input layer is relatively straightforward: I use Sigmoid if the input data domain is (0,1) and TANH if it is (-1,1). But what activation functions to set for hidden and output layers? Is there any conventional logic for making thish choice reasonably? How do I kn...
The following recurrence relation, $$T(n)=16T(\frac{n}{4}) + n^2$$ has been given to me to be solved via the Master Theorem. I'm pretty sure this is a case 2 situation, since $$\log_4{16} = 2$$ and $$\log_n{n^2} = 2$$ Where $b = 4$, $a = 16$, and $c = 2$, such that $f(n) = n^c$ What I'm not sure about is the end run...
Every time I solve these questions, I get stuck at the end where I need to find a closed form for the summation. Here in this case, I have reached until this point: $$ \begin{align} T(n) &= T(n-2) + 1/\lg n \\ &= T(n-4)+ 1/\lg(n-2) + 1/\lg n \\ &= T(n-6) + 1/\lg(n-4) + 1/\lg(n-2) + 1/\lg n. \qquad (1) \end{align} $$ A...
I'm following Jeff heatons book 'Introduction to Neural Networks with Java'. To get node deltas, we need to calculate $f'(sum)$. In the very first row for Training Element #1, we need to compute $f'(1.13) \cdot 0.25$ which Heaton evaluates to $0.045$. Using my calculator, I get $f'(1.13)=-0.13$ (derivative of sigmoid ...
I have a doubt about the runtime of the Euclidean algorithm; the slide of my Professor says: The calculation of $\mathrm{GCD} (a, b)$ stops at the most after $2\log_2 a$ iterations. Since $\log_2 a$ is the size of the input, calculation requires a linear number of iterations. The algorithm therefore has polynomial ru...
In the standard proof why Subset-Sum is (weakly) NP-complete, one reduces Vertex Cover to Subset-Sum by using suitable numbers with O(m+n) bits (where m is the number of edges and n the number of vertices). But how can we talk about a polynomial time reduction if we generate exponential-size numbers? I guess that this ...
I am having difficulty with the concept of $LK-\Phi$ proofs, here is a question I have been working on: Let $\Phi = \{Pafa\}$, where $P$ is a binary predicate symbol and $f$ is a unary function symbol. Give an $LK-\Phi$ proof of $\exists y Pby$. You do not need to show exchanges and weakenings. My intution for these ...
Hello I am having difficulty with this question, I am not even sure what strategy one would go about proving something like this: Suppose $L$ is a language which includes an infinite list $c_1,c_2,\cdots$ of constant symbols. Let $\Gamma$ be a set of sentences $\Gamma = \{c_i \neq c_j \mid i,j\in N, i < j\}$. Let A be...
I just read "Boole's Algebra Isn't Boolean Algebra" by Theodore Halperin (behind a paywall here). I don't have a strong background in abstract algebra, so, frankly, the paper is a bit over my head but the gist of it is as follows: the algebra developed by Boole in the 19th century has some strange properties. Boole int...
Has some sort of canonical - or reference - implementation of Dual-pivot Quicksort been posted anywhere? I would like to include that algorithm in a comparison among sorting algorithms for a specialized need that I have, but the Java versions I've seen appear to have various kinds of tweaks applied to them, like using ...
I came across this notation and I don't know the meaning of it, or if it's a typo: $\{$ some set $\}^{+}$ What does the + mean, i.e., the plus operator applied to a set?
How can we prove that: $$ L = \{ w_1\#w_2 \mid w_1 \in w_2;\; |w_2| > |w_1|;\; w_1 , w_2 \in \{0, 1\}^*\} $$ is not context-free? The language defines $w_1$ as a sub-string of $w_2$, and they are separated by a $\#$. This is easy with the CFG pumping-lemma for a slightly different language with $|w_2| \ge |w_1|$ by us...
I've been given the following question and I've been finding it hard to give a good answer: Prove or disprove: given a max-heap with n distinct elements, using Extract-Max to extract n/2 of the elements takes Ω(nlogn) time. Because the heap contains distinct elements, I'm lead to believe the claim is true: I've tried t...