Most Popular

1500 questions
13
votes
2 answers

Why is FACTOR in Co-NP?

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…
Fequish
  • 233
  • 2
  • 4
13
votes
3 answers

What is the difference between Abstract Data Types and objects?

An answer on Programmers.SE characterizes an essay by Cook (Objects are not ADTs) as saying Objects behave like a characteristic function over the values of a type, rather than as an algebra. Objects use procedural abstraction rather than type…
13
votes
1 answer

Inverting a band matrix

I have a band matrix -- a sparse, square, symmetric $N \times N$ matrix whose structure looks like the following: Here, the area under the blue stripes is the non-zero elements; everything else is zero Is there an algorithm to invert this kind of…
rnels12
  • 231
  • 2
  • 3
13
votes
2 answers

Is there any way to distinguish between LL(k) and LR(k) grammar?

I am recently studying about Compilers designing. I came to know about two types of grammar one is LL grammar and other is LR grammar. We also know the facts that every LL grammar is LR that is LL grammar is a proper subset of LR grammar. First one…
Debabratta Jena
  • 359
  • 1
  • 3
  • 9
13
votes
2 answers

Why is least fixed point (lfp) important in program analysis

I am trying to get a big picture on the importance of least fixed point (lfp) in program analysis. For instance abstract interpretation seems to use the existence of lfp. Many research papers on program analysis also focus heavily on finding least…
Ram
  • 233
  • 2
  • 5
13
votes
1 answer

Unification vs. SAT solver

I read on Wikipedia that unification is a process of solving the satisfability problem. At the same time, I know that such solvers are called "SAT solvers" or "SMT solvers". So, are they different names for the same thing? If you say that they are…
Val
  • 857
  • 6
  • 16
13
votes
5 answers

Why unsafe state not always cause deadlock?

I was reading Operating Systems by Galvin and came across the below line, Not all unsafe states are deadlock, however. An unsafe state may lead to deadlock Can someone please explain how deadlock != unsafe state ? I also caught the same line…
vikkyhacks
  • 399
  • 2
  • 3
  • 9
13
votes
3 answers

Complexity-theoretic difficulty of checking the value of $\pi(x)$?

The prime-counting function, demoted $\pi(x)$, is defined as the number of prime numbers less than or equal to $x$. We can define a decision problem from $\pi(x)$ as follows: Given two numbers $x$ and $n$, written in binary, decide if $\pi(x) =…
templatetypedef
  • 9,302
  • 1
  • 32
  • 62
13
votes
1 answer

Break an authentication protocol based on a pre-shared symmetric key

Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa. $$ \begin{align*} A \to B: &\quad \text{“I'm Alice”}, R_A \\ B \to A: &\quad E(R_A, K) \\ A \to B: &\quad E(\langle R_A+1, P_A\rangle, K)…
Gilles 'SO- stop being evil'
  • 44,159
  • 8
  • 120
  • 184
13
votes
3 answers

Why does Schaefer's theorem not prove that P=NP?

This is probably a stupid question, but I just don't understand. In another question they came up with Schaefer's dichotomy theorem. To me it looks like it proves that every CSP problem is either in P or in NP-complete, but not in between. Since…
Albert Hendriks
  • 2,481
  • 16
  • 35
13
votes
2 answers

Efficient algorithm to generate two diffuse, deranged permutations of a multiset at random

Background $\newcommand\ms[1]{\mathsf #1}\def\msD{\ms D}\def\msS{\ms S}\def\mfS{\mathfrak…
13
votes
0 answers

Why do we have to forbid non-conforming lower and upper type bounds?

(it's a repost of my unanswered question from scala-user@googlegroups.com about Scala) In the Scala Language Specification, §4.4 Type Parameters, there is a requirement: The most general form of a first-order type parameter is @a1 ... @an ± t >: L…
13
votes
1 answer

What is the relationship between Turing Machines with a finite tape and Finite State Automata?

I seem to recall from an undergraduate class that for a Turing Machine with a finite tape there will always exist a corresponding Finite State Automata, but I've been unable to find this confirmed anywhere on the internet. Is this actually the case…
Jesse Berlin
  • 133
  • 1
  • 5
13
votes
1 answer

What is the optimal solution of the 1962 Procter and Gamble's TSP Contest?

In 1962, you could win a prize of \$ 10 000 (about \$ 80 000 in today's money) if you found the solution to an Euclidean travelling salesman problem defined on 33 cities. http://www.math.uwaterloo.ca/tsp/history/pictorial/car54.html Looking at the…
Martin Drozdik
  • 383
  • 2
  • 9
13
votes
2 answers

Standard constructive definitions of integers, rationals, and reals?

Natural numbers are defined inductively as (using Coq syntax as an example) Inductive nat: Set := | O: nat | S: nat -> nat. Is there a standard way to define integers (and maybe other sets like rationals and reals) constructively?
Alex
  • 273
  • 1
  • 5