instruction stringlengths 0 29.8k ⌀ |
|---|
Call a number $m$ a milestone if it is in $A$ and your greedy algorithm adds $m+1$ to $B$.
The greedy algorithm ensures that each milestone (except the first milestone) is great than the previous milestone $+1+1$. So any two milestones are more than 2 apart.
Hence each number in any solution can cover at most one... |
null |
In Figure 12 of my [paper on conditional attribute grammars][1], it gives the following strongly non-circular attribute grammar that is not doubly non-circular (and therefore not l-ORD):
```
S -> 0 L
L.inh1 = 0
L.inh2 = L.syn1
S.result = L.syn2
S -> 1 L
L.inh2 = 0
L.inh1 = L.syn2
S.re... |
Call a number $m$ a milestone if it is in $A$ and your greedy algorithm adds $m+1$ to $B$.
The greedy algorithm selects each next milestone so that it is greater than the current milestone${}+1+1$. So any two milestones are more than 2 apart.
Hence each number in any solution can cover at most one milestone. Any ... |
I would like to solve a shortest path problem on a graph $\mathcal{G}= (\mathcal{V},\mathcal{A})$, which comes to minimize :
\begin{equation}
\label{eq:1}
\underset{\{x_{ij}\}}{\text{argmin}}\biggl\{\sum_{(i,j)\in\mathcal{A}}a_{ij}x_{ij}\biggr\}
\end{equation}
in which $a_{ij}$ is a non negative scalar quantifying... |
Shortest path problem with multiple objectives |
|shortest-path| |
I think one possibility would be to run normal shortest path algorithms on separate graphs which respectively encode the differing objectives, and then search across possible paths in the graph.
The rationale behind this is that the different objective costs are independent of each other. Thus shortest path algorith... |
Consider the following datatypes in Haskell:
data Foo = Halt | Iter Foo
newtype BigInt = BigInt {nthBit :: Foo -> Bool}
`Foo` is Peano numbers compactified by one limit point, namely `fix Iter`. `BigInt` represents arbitrary-length integers in two's complement.
Since `Foo` is compact and `Bool` is dis... |
Does this esoteric representation of integers have decidable equality? |
|computability|functional-programming|semi-decidability|equality|topology| |
Consider the following datatypes in Haskell:
data Foo = Halt | Iter Foo
newtype BigInt = BigInt {nthBit :: Foo -> Bool}
`Foo` is Peano numbers compactified by one limit point, namely `fix Iter`. `BigInt` represents arbitrary-length integers in two's complement. The limit point `fix Iter` forces the field... |
I would like to solve the $k$ shortest paths on a directed graph $\mathcal{G}= (\mathcal{V},\mathcal{A})$ :
\begin{equation}
\label{eq:1}
\underset{\{x_{ij}\}}{\text{argmin}}\biggl\{\sum_{(i,j)\in\mathcal{A}}a_{ij}x_{ij}\biggr\}
\end{equation}
in which $a_{ij}$ is a non negative scalar quantifying the cost of arc... |
k-shortest paths with iso-timing constraint |
|shortest-path| |
lets start from VC=1 - take for example C={1}, you can shatter it! it can can the + labeling by choosing a=0.5 for example and the - labeling by a=1.5.
Now lets look at VC=2 - you can take C={1,2}:
- the labeling +, + can be easily obtained by a=0.5 again
- the labeling -, - can be easily obtained by a=2.5
- the l... |
null |
Is there a polynomial algorithm which for each graph G and each value k determines whether all the cliques of G have size smaller than k?
Is it correct to say that it doesn't exist because clique is NP-Complete?
|
Is there a polynomial algorithm which for each graph G and each value k determines whether all the cliques of G have size smaller than k? |
|complexity-theory|np-complete|polynomial-time|clique| |
If there exists such a polynomial algorithm, then we can run this algorithm for each $k=1,2,...n$ thus a polynomial algorithm with an additional factor $n$ for clique problem is generated. This is a contradiction to the fact that clique is NP-Complete (a direct reduction from independent set can proof the hardness). |
Vol. III of The Art of Computer Programming, chapter 5 (Sorting, intro) mentions:
> Computer manufacturers of the 1960s estimated that more than 25
> percent of the running time on their computers was spent on sorting,
> when all their customers were taken into account. In fact, there were
> many installations i... |
Comparison-based computation: percentage of current software development? |
|algorithms|sorting|comparison| |
Vol. III of The Art of Computer Programming, chapter 5 (Sorting, intro) mentions:
> Computer manufacturers of the 1960s estimated that more than 25
> percent of the running time on their computers was spent on sorting,
> when all their customers were taken into account. In fact, there were
> many installations i... |
Vol. III of The Art of Computer Programming, chapter 5 (Sorting, intro) mentions:
> Computer manufacturers of the 1960s estimated that more than 25
> percent of the running time on their computers was spent on sorting,
> when all their customers were taken into account. In fact, there were
> many installations i... |
I have two dataframes representing products two distributors sell. They look like this:
df1 for distributor 1.
Country, Age group, Product
{USA, Canada}, {Toddlers, Teens}, {Jeans, Shoes}
{USA, Mexico}, {Teens, Adults}, {Hair bands, Mufflers}
So, the distributor 1 sells jeans and shoes for toddle... |
Algorithm to find intersection between collection of sets |
|algorithms|graphs|computational-geometry|sets|set-cover| |
It's hard to give hints without solving the problem for you.
Some general hints:
- When working with regular expressions, the $^+$ sign ("one or more") is a useful shorthand. $X^* = \epsilon \cup X^+ = \epsilon + XX^*$.
For instance, in this case, we can write:
$L_1 = L(b^*+b^*a(b+ab^*a)^*ab^*) = L(b^*... |
A Quine–McCluskey variant for conjunctive normal form? |
Bitcoin has a [gossip protocol](https://en.wikipedia.org/wiki/Gossip_protocol) by which nodes broadcast the state of the blockchain (or updates to it) to each other. Charlie can join the Bitcoin [peer-to-peer](https://en.wikipedia.org/wiki/Peer-to-peer) network and take advantage of the gossip protocol to download a ... |
null |
The problem with the statement is the "can" word when it's talking about "every" grammar. Every grammar generates a language. They don't "can" or "cannot". The statemant should be "Every Type-2 grammar generates a regular language". And the answer is obviously false. Or "Type-2 grammars can generate regular languages" ... |
One algorithm is to consider all pairs of rows (one row from df1, one row from df2), and find whether there is any intersection between these two rows. Given two rows, this is easy: you compute the intersection of the sets in each column. The running time will be $O(n_1n_2)$ where $n_1n_2$ are the number of rows in d... |
> Is there a polynomial algorithm which for each graph G and each value k determines whether all the cliques of G have size smaller than k?
We do not know the answer to this question.
> Is it correct to say that it doesn't exist because clique is NP-Complete?
No, that would not be correct. Since we currently ... |
It depends on what you consider a polynomial-time algorithm in this case.
Given a graph and an integer $k$ you can determine if there all the cliques are of size at most $k$ by looking at all sets of $(k+1)$ vertices and determining if they form a clique. If there is any clique of size larger than $k$, then choosing... |
null |
Assuming that you intend to only count the total functions for $\mathsf{BigInt}$, then yes, equality should be decidable. Here's a sketch for how to do it for $i$ and $j$:
1. First test $i$ and $j$ on $\infty$. If they differ, then they are unequal. If they both yield $1$, then run the subsequent tests with $-i$ an... |
null |
Assuming that you intend to only count the total functions for $\mathsf{BigInt}$, then yes, equality should be decidable. Here's a sketch for how to do it for $i$ and $j$:
1. First test $i$ and $j$ on $\infty$. If they differ, then they are unequal. If they both yield $1$, then run the subsequent tests with $-i$ an... |
As it stands, the general consensus seems to be that BPP = P. If this conjecture were indeed true, what would be some of the philosophical implications beyond theoretical computer science?
I know that the construction of my question is rather fuzzy. This is in the hopes of getting a diverse set of interpretations t... |
What are some of the philosophical implications if BPP = P? |
|complexity-theory|randomness|philosophy| |
Fun question! Yes equality is *externally* decidable here, though I don't know if the procedure is *internally* expressible in Haskell. Here's a more direct solution:
Let `infty` be the infinite integer `fix Iter`. On input `a` and `b`:
- Run `a infty` and `b infty`. If they are unequal, return "false"
- Other... |
Fun question! Yes equality is *externally* decidable here, though I don't know if the procedure is *internally* expressible in Haskell. Here's a more direct solution:
Let `infty` be the infinite integer `fix Iter`. On input `a` and `b`:
- Run `a infty` and `b infty`. If they are unequal, return "false"
- Other... |
I am working on parameterized complexity of a problem for the parameter clique width. The problem is known to be polynomial-time solvable on graphs with bounded clique width; does this indicate that the problem is FPT for the parameter clique width? Similary, if the problem is linear-time solvable on graphs with bounde... |
Bounded clique width graphs vs parameter clique width |
|algorithms|graphs| |
I am Balchandar Reddy, a research scholar. I am currently working on the parameterized complexity of a problem for the parameter clique width. The problem is known to be polynomial-time solvable on graphs with bounded clique width; does this indicate that the problem is FPT for the parameter clique width? Similary, if ... |
Not necessarily, being polynomial-time solvable for graphs with bounded clique-width means that on graphs of clique-width less than $k$ an algorithm solves the problem in $O(n^{f(k)})$ time for some function $f$, so it only implies that the problem is XP (slice wise polynomial) with respect to clique-width.
On the o... |
null |
The code for degree elevation of curves in The NURBS Book by Les Piegl and Wayne Tiller pages 206--209([The_NURBS_Book][1]) assumes the knot vector for the curve is given as:
$$(0,...,0,...,1,...,1)$$
where there are p+1 0's and p+1 1's and numbers greater than 0 and less than 1 are in between the last 0 and the fir... |
NURB Sphere surface degree elevation and knot insertion |
|algorithms|computational-geometry|graphics|digital-curve| |
Negative. They have nothing to do with each other. The Turing test is a tool to assess a machine's ability to display intelligent behavior indistinguishable from that of a human.
There is nothing in the definition saying that the mentioned machine has to be a Turing machine, or that it has to be Turing complete. Not... |
null |
Condition $A$ is *stronger than* condition $B$ if $A$ implies $B$. That is, if $B$ holds in all situations in which $A$ holds. Conversely, if $A$ is stronger than $B$, then $B$ is weaker than $A$. Note that, from the definition, $A$ is stronger and weaker than itself, since $A$... |
null |
Great conversation so far...
I spend a fair bit of time with hypervisors in edge devices, and the discussion about what is Type1 and Type2 has always fascinated me. Type1 is usually associated with 'bare metal' whereas Type2 is associated with 'operating system hypervisor'. Bare metal must be always better right? ... |
null |
I have the following 2-bit binary multiplier
[![2-bit binary multiplier][1]][1]
<sub>(source: [wikimedia.org](https://upload.wikimedia.org/wikipedia/en/7/7b/Binary_multi1.jpg))</sub>
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, ... |
null |
Hey to everyone I am trying to understand A* algorithm not the real time A* algorithm
To understand this I created the following problem
- Node s is connected with Α and the heuristic value of Α is 4 with
travel cost 2
- Node s is connected with Β and heuristic value of Β is 4 with
travel cost 3
... |
null |
Is there a decomposition/structural theorem for 3-edge-connected graphs? |
null |
Let $L$ be a language. $w \in\ L$ , and $w$ could be broken in $xyz$.
Then if $L$ is regular, there exists a pumping length $p$ such that:
1. $\vert y\vert>0$
2. $\vert xy\vert \leq p$
3. $\forall i \geq 0,\ xy^i z\ \in L$
I understand that this lemma is
- based on pigeon hole principle
- we use it to... |
null |
I have a question from a test that I could not pass, I could not answer the question and I am looking for help with this question
This is the question
Will be $A\in \mathbf{NP}$
Suppose that $A\notin \mathbf{coNP}$. determine which of the claims is correct:
1. $\mathbf{P}=\mathbf{coNP}$
2. $\mathbf{P}=\mat... |
null |
Is the statement in question true? how can i prove it formally?
I know that PSPACE=CO-PSPACE and NP ⊆ PSPACE and CO-NP ⊆ CO-PSPACE |
PSPACE≠co-NP?Is the statement true? |
|complexity-theory|time-complexity|proof-techniques|space-complexity|co-np| |
There is a pattern in the first stage: the two pairs of *and*s stand for the four bitwise products. Then follows a three-bits adder stage with carries ($C_0$ is immediate).
The generalization fill involve three triples of *and*s and two adders. |
Inspired by [this answer][1], here is an idea for building a Turing machine, which follows these steps:
The problem requires that the input size ($n$) is a multiple of $3$. So, for example, let's use the input $X^{12}.$
1. Every $3$ $X$, do a mark:
$$XXXXXXXXXXXX$$
$$XXAXXAXXAXXA$$
The number of marks will be ... |
I have the following question: given a string $X^n$, where $n$ is divisible by $3$, how to build a **one-tape** Turing machine with complexity $O(n\log n)$ that splits this string into $3$ equal parts?
I manage to build an $O(n^2)$ machine that performs this task. By the way, all my attempts always result in an $O(n... |
Turing machine that splits a string into 3 equal parts in $O(n\log n)$ |
{"Voters":[{"Id":113534,"DisplayName":"Hugh Mann"}],"DeleteType":1} |
I am studying this ERD:
[![][1]][1]
[1]: https://i.stack.imgur.com/qL2Rl.png
The bank and the customer are obviously strong entities because they are a bank and a person.The bank branch is clearly a weak entity because it depends on the bank assosciated with it.How is a account and a loan not weak entities... |
ER model cant understand where I am wrong? |
|database-theory| |
Let there be $n$ processes in a general connected network with no leader such that each process has a distinct UID.
Each edge has a weight , with weights being positive or negative.
Assume that each process knows $D$, the diameter of the network.
I need to find a subset of edges such that the subgraph formed b... |
Finding a connected subset of edges with minimal sum of weights for a distributed network |
|graphs|distributed-systems| |
In this variant of #Positive-2-SAT ,we divide set of all possible clauses like this :
A = [ab ,ac ,ad ,.... ]
B =[bc ,bd ,be ,....]
C=[cd ,de ,....]
D=[de ,....]
....
In this variant ,we are allowed to select clauses from only 3 sets mentioned ,And for every k variable there are k such sets but for k ... |
Complexity of this variant of #Positive 2-SAT #P-complete? |
|complexity-theory|complexity-classes|counting| |
In this variant of #Positive-2-SAT ,we divide set of all possible clauses like this :
A = [ab ,ac ,ad ,.... ]
B =[bc ,bd ,be ,....]
C=[cd ,de ,....]
D=[de ,....]
....
In this variant ,we are allowed to select clauses from only 3 sets mentioned ,And for every k variable there are k such sets but for k ... |
If P = PSPACE then since $\text{P} \subseteq \text{coNP} \subseteq \text{PSPACE}$, we can conclude that coNP=PSPACE, and by contrapositive this means that if $\text{coNP} \neq \text{PSPACE}$ then $\text{P} \neq \text{PSPACE}$. Since the question of P vs PSPACE is unsolved, one can conclude that there's no known proof o... |
The [dragon book lists properties](https://dengking.github.io/compiler-principle/3-Lexical-Analysis/3.7-From-Regular-Expressions-to-Automata/) of an NFA N(r) created using Thompson's construction, in particular:
> 3. Each state of N(r) other than the accepting state has either one outgoing transition on a symbol in ... |
Meaning/veracity of "each state has [..] or two outgoing ϵ transitions" in Thompson's construction |
|automata|finite-automata|regular-expressions| |
null |
null |
null |
How to design Push Down Automata for a language that has equal number of a's and b's where $n \ge 1$?
I got how to do it for $n \ge 0$, not able to get it for $n \ge 1$. |
|pushdown-automata| |
null |
Asymptotic Relationship between $\frac{1}{n}$ and $\frac{1}{2^n}$ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.