instruction stringlengths 0 29.8k ⌀ |
|---|
Intuitionistic logic(s) are usually defined in a purely synthetic way, with their own deduction rules different from classical logic, but they also have semantic interpretations.
One of them, more known in mathematical logic, is Kripke semantics, originated in modal logic, in which a formula is valid iff it holds i... |
I have the following question: given a string $X^n$, where $n$ is divisible by 3, how to build a 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^2)$ machine. |
Turing machine that splits a string into 3 equal parts in $O(n\; log\ n)$ |
|algorithms|complexity-theory|time-complexity|turing-machines| |
null |
null |
null |
null |
null |
null |
Both Kripke semantics and propositions-as-types interpretation are sound and complete for the intuitionistic propositional calculus. In this sense they are equivalent.
However, there are formulas in intuitionistic first-order logic (IHOL) which are valid under propositions-as-types but are not intuitionistically pro... |
Proof width (the size of the largest clause in a proof) plays an important part in refuting an unsatisfiable formula. If a formula has a bounded-width resolution proof of its unsatisfiability, then the length of the proof is polynomially bounded, since there are only $O(n^k)$ distinct $k$-clauses over $n$ variables. We... |
Shortest unsatisfiable 3-CNF that can't be refuted with narrow resolution? |
|reference-request|logic|satisfiability| |
Here is a high level idea that, for any positive integer $c$ of choice, splits a string of length $n$ (assume that $n$ is a multiple of $\alpha$ for simplicity) into two parts of length $(c-1)n/c$ and $n/c$ using $O(n \log n)$ time. Two applications of this procedure with $c=3$ and $c=2$ (and some technical care) solve... |
Here is a high level idea that, for any positive integer $c$ of choice, splits a string of length $n$ (assume that $n$ is a multiple of $\alpha$ for simplicity) into two parts of length $(c-1)n/c$ and $n/c$ using $O(n \log n)$ time. Two applications of this procedure with $c=3$ and $c=2$ (and some technical care) solve... |
null |
Is it possible to (theoretically) develop a CPU having a hybrid ISA such that half of the cores in it use the x86 architecture and the other half uses the ARM architecture? The x86 cores would run the x86 instructions that the CPU receives, while the ARM cores would run the ARM instructions. This would allow the CPU to... |
Is a CPU with a hybrid Instruction Set Architecture (ISA) possible? |
|cpu|instruction-set| |
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^... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$\alpha(n) : \text{Inverse of a very ... |
Difficulty in last sentence in proof of "Amortized cost of $\text{Find-Set}$ operation is $O(\alpha(n))$" from CLRS |
What you're talking about is known as *asymmetric multiprocessing*, where you have multiple logical cores with different ISAs.
Not only is it possible, you might have one. Many consumer-grade CPUs have GPUs on the same die.
There is one other famous example. The IBM Cell had a main PowerPC core (with two-way simu... |
Can anyone please explain (not just through examples) that why does the greedy approach does not work in this case? Or more generally, is there any particular condition under which only the greedy solution work?
The problem link -https://codeforces.com/problemset/problem/1832/B. The problem states that we have an arra... |
Greedy algorithms criterion/ intution |
|algorithms|proof-techniques|greedy-algorithms|heuristics| |
null |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$\alpha(n) : \text{Inverse of a very ... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$\alpha(n) : \text{Inverse of a very ... |
Here is a high level idea that, for any positive integer $c$ of choice, splits a string of length $n$ (assume that $n$ is a multiple of $\alpha$ for simplicity) into two parts of length $(c-1)n/c$ and $n/c$ using $O(n \log n)$ time. Two applications of this procedure with $c=3$ and $c=2$ (and some technical care) solve... |
My question is admittedly simple, but the desire is to have an insightful view on it behind a conventional definition.
In different foundational or axiomatic systems, I have come to consider “compositionality” as possibly the single most general concept to use as a structuring principle, in any system that gives ris... |
Axiomatically, what characterizes “recursion”? |
|recursion| |
null |
A lot to unpack here! It's hard to extract a clear question from your post, but I will just comment on a few of your statements:
> the Church-Turing thesis, where it’s actually hard or nigh impossible to derive a rule, which was not already implicitly there as a rule of interpretation, to begin with
> The Church-... |
I’m working on a custom exporter for a 3d project.
I have groups of faces (quads) that are always multiples of 4, each quad could be further subdivided into another group of 4, but in the editor they are all part of the same mesh/group (no parent/child).
I would like to export these quads by iterating through the ... |
3d algorithm - Sort multiple of 4 grid, into subsequently smaller quads |
|algorithms| |
Sometimes it is good to delete the maximum element even when its value is larger than the sum of the two minimum elements. Deleting it allows the algorithm to remove the smaller elements in the next iterations.
For example: If the array is as follows: $4,4,4,4,4,4,5,5,9$ and $k = 3$.
Then, the greedy algorithm de... |
null |
Since the other two answerers really didn't put thought into this question, I think I should give a genuine encoding for subsequent readers.
We consider a 2D matrix $R(i, j)$ meaning that the vertex $i$ can reach $j$. The matrix is initialized as follows:
1. For every direct edge $i \to j$, we set $R(i, j)$ to tr... |
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
... |
A* algorithm (not the real time algorithm )how to find the right path for A* algorithm (not the real time algorithm) |
|algorithms|graphs| |
null |
how to find the right path for A* algorithm (not the real time algorithm) |
I've tried a to implement a Regex to DFA converter, and it works, so far, but I don't understand how to implement "parsing preferences" in the DFA.
A classic example is `a*`. This regex is ambiguous unlike `^a*$`, because given a string `aaaa`, we can accept `a`, `aa`, `aaa`, and `aaaa`.
Usually, the engine will sa... |
Regex to DFA - How do I implement parsing preferences in regex search? |
|formal-languages|finite-automata|regular-expressions| |
The definition of ZPP seems to be
$$ZPP = RP \cap coRP.$$
I think ZPP should then be equivalent to P, because for any language L in ZPP, there is an algorithm A and B proving that it is in RP and coRP, respectively. Since A must tell for any x s.t. $x \notin L$ the truth and B for any x s.t. $x \notin L$ as well,... |
How is P not trivially equal to ZPP? |
|time-complexity|complexity-classes|randomized-algorithms| |
I've tried a to implement a Regex to DFA converter, and it works, so far, but I don't understand how to implement "parsing preferences" in the DFA.
A classic example is $a^*$. This regex is ambiguous unlike $^\wedge a^*\$$, because given a string `aaaa`, we can accept `a`, `aa`, `aaa`, and `aaaa`.
Usually, the engi... |
null |
There is an error in your reasoning. Say that $x \not\in L$. Then when you run $A(x)$ you'll get a "no" answer with certainty. However, when you run $B(x)$ you'll get a "no" with some probability that can be up to $1/2$.
What do you do when both $A(x)$ and $B(x)$ return "no"? In order to answer correctly you'd need ... |
I’m working on a custom exporter for a 3d project.
I have groups of faces (quads) that are always multiples of 4, each quad could be further subdivided into another group of 4, but in the editor they are all part of the same mesh/group (no parent/child).
I would like to export these quads by iterating through the ... |
I’m working on a custom exporter for a 3d project.
I have groups of faces (quads) that are always multiples of 4, each quad could be further subdivided into another group of 4, but in the editor they are all part of the same mesh/group (no parent/child).
I would like to export these quads by iterating through the ... |
I’m working on a custom exporter for a 3d project.
I have groups of faces (quads) that are always multiples of 4, each quad could be further subdivided into another group of 4, but in the editor they are all part of the same mesh/group (no parent/child).
I would like to export these quads by iterating through the ... |
I’m working on a custom exporter for a 3d project.
I have groups of faces (quads) that are always multiples of 4, each quad could be further subdivided into another group of 4, but in the editor they are all part of the same mesh/group (no parent/child).
I would like to export these quads by iterating through the ... |
null |
null |
Here is a high level idea that, for any positive integer $c$ of choice, splits a string of length $n$ (assume that $n$ is a multiple of $c$ for simplicity) into two parts of length $(c-1)n/c$ and $n/c$ using $O(n \log n)$ time. Two applications of this procedure with $c=3$ and $c=2$ (and some technical care) solve your... |
What you're talking about is known as *asymmetric multiprocessing*, where you have multiple logical cores with different ISAs.
Not only is it possible, you might have one. Many consumer-grade CPUs have GPUs on the same die.
There is one other famous example. The IBM Cell had a main PowerPC core (with two-way simu... |
null |
# Dmitry
I have mixed feelings about this community. When you see someone who got stuck while genuinely doing their best trying to solve their problem, it's a very pleasant experience to be able to help them. On the other hand, it is frustrating to see questions that show no effort, no search, and often no minimal u... |
1. How would you deal with a user who produced a steady stream of valuable answers, but tends to generate a large number of arguments/flags from comments?
Depends on the arguments and the flags. For example, if the user behaves hostilely, then, after the first warning, if there are no signs of improvements, I will s... |
I think that the original poster wanted to point out that lexicographic order does not work for the purpose of enumerating all words.
1
11
111
1111
...
and you never reach 2 (and you miss 0).
Of course, as pointed out by [user253751][1], numeric order works. For example, the set of all numbers can be enum... |
null |
I have $L_1=\{b^*+b^*a(b+ab^*a)^*ab^*\}$ and $L_2=\{(b^*ab^*a)^*b^*\}$. I want to prove or disprove that they are equivalent.
I have proved that $L_2\subseteq L_1$ and I tried to transform the second expression in $L_1$ in order to find an expression contained in $L_2$ (without any luck so far). I tried also to fin... |
Prove or disprove that two regular languages are equivalent |
|formal-languages|regular-languages|regular-expressions| |
After watching 3b1b's brief primer on blockchains [here](https://youtu.be/bBC-nXj3Ng4), I noticed a bit of a "flaw" with blockchains. It isn't really a flaw, but I'm not sure how it is alleviated.
If we have two players, Alice and Bob, who are transacting with one another, each person stores their own copy of the bl... |
Blockchains where new users don't need to wait for a new node to retrieve old transactions? |
|blockchain|transactions| |
null |
Are there pairs of connected graphs that always fail the k-wl test for any k? If so, please give me an example. |
Are there pairs of connected graphs that always fail the k-wl test for any k? |
|graphs| |
Is there a pair of connected graphs where the k-wl test always fails (= judged to be isomorphic when not isomorphic) for any k? If so, please give me an example. |
Pick any two non-isomorphic $n$-vertex $r$-regular graphs. |
Is there a pair of connected graphs for which the k-wl test always fails (= judges isomorphic when not isomorphic) for any k? If so, please give an example. |
Is there a pair of connected graphs for which the k-wl test always fails (= judges isomorphic when not isomorphic) for any k? If so, please give an example.
How about the following image? I'm not sure...
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/sNFxP.png |
Is there a pair of connected graphs for which the k-wl test always fails (= judges isomorphic when not isomorphic) for any k? If so, please give an example.
How about the following image? Are they non-isomorphic? I'm not sure...
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/sNFxP.png |
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^*... |
Is there a pair of connected graphs for which the k-wl test always fails (= judges isomorphic when not isomorphic) for any k? If so, please give an example.
How about the following image? Are they non-isomorphic? I'm not sure...
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/sNFxP.png... |
I am given a group A of real numbers and I have to find the minimal group B such that for each a in A there exists at least one b in B such that |a-b|<=1
So what I think the algorithm should do is first sort A, then insert A[0]+1 to B, and then iterate on A and check if the last number we added to B is still in his ... |
Proving a greedy algorithm of finding MINIMAL group |
|algorithm-analysis|greedy-algorithms| |
I am given a group $A$ of real numbers and I have to find the minimal group $B$ such that for each $a$ in $A$ there exists at least one $b$ in $B$ such that $|a-b|\leq 1$
So what I think the algorithm should do is first sort $A$, then insert $A[0]+1$ to $B$, and then iterate on $A$ and check if the last number we ad... |
Inspired by [this answer][1], here is an idea for building a Turing machine, which follows these steps:<br>
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 exa... |
I am given a group $A$ of real numbers and I have to find the minimal group $B$ such that for each $a$ in $A$ there exists at least one $b$ in $B$ such that $|a-b|\leq 1$
So what I think the algorithm should do is first sort $A$, then insert $A[0]+1$ to $B$, and then iterate on $A$ and check if the last number we ad... |
null |
null |
Pick any two non-isomorphic $n$-vertex $r$-regular graphs.
Edit to address follow-up question. Yes, the two graphs in your figure are $k$-wl for all $k$, and yes, they are non-isomorphic.
One of the graphs has an induced $C_4$ and the other does not. |
Call a number $s$ in $A$ a milestone if your greedy algorithm add $s+1$ to $B$.
Your greedy algorithm ensures that each milestone (except the first milestone) is great than $1+1+$ the previous milestone. So any two milestones are more than 2 apart.
Hence each number in any solution can "cover" at most one milesto... |
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^*... |
Call a number $s$ a milestone if it is in $A$ and your greedy algorithm adds $s+1$ to $B$.
Your 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 ... |
I am given a group $A$ of real numbers and I have to find the minimal group $B$ such that for each $a$ in $A$ there exists at least one $b$ in $B$ such that $|a-b|\leq 1$
So what I think the algorithm should do is first sort $A$, then insert $A[0]+1$ to $B$, and then iterate on $A$ and check if the last number we ad... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.