instruction stringlengths 0 29.8k ⌀ |
|---|
> 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?
Thankfully, cs.SE is not the sort of community where this happens often!
We highly discourage comment discussions, preferring that they move to chat. I would... |
null |
I have an undirected graph which grew according to a **recursive algorithm**, i.e., it started with a single vertex and then, one after another, new vertices arrived and connected to existing ones.
Now, I'm given the graph with, say, $n$ vertices. **I would like to determine (efficiently) which vertex was the first ... |
> 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?
Thankfully, cs.SE is not the sort of community where this happens often!
We highly discourage comment discussions, preferring that they move to chat. I would... |
There is the classical version of the minimum coins to make change problem where the change and the set of coins available are all integers. Given an infinite amount of each type of coin, we're asked the smallest number of coins required to make change for a given amount. This can be solved with dynamic programming, Py... |
Minimum coins to make change when real numbers are allowed |
|dynamic-programming|coin-change| |
Let $G=(V,E)$ be the original graph. Define a new graph, $G'=(V',E')$, that represents the set of all valid paths in $G$, where a path is considered valid if its $q$-values are strictly monotonically increasing.
In particular, $V'=V \times Q$, where $Q=\{q(u,v) \mid u,v \in V\} \cup \{-\infty\}$ is the set of $q$-v... |
Yes, for a tree, the decomposition corresponds to one bag per edge. However, if you consider the graph $C_6$, the cycle on 6 vertices, you don't get a _tree_ decomposition if you follow the same scheme.
What you would do for a cycle is essentially to pick an arbitrary vertex, $v_1$, remove it from the graph. Perfo... |
Unfortunately, it is NP-hard, by reduction from the [subset sum problem](https://en.wikipedia.org/wiki/Subset_sum_problem). |
That's because the set of total Turing machine((Let's say TTM)) is not recursively enumerable. If you prove that the set of Total Turing machines is not recursively enumerable, you actually prove that this set is not decidable. Because for every set S, If S is decidable, Then S is recursively enumerable. For proving th... |
If I understand correctly, the first node is the one and only one in the graph having only outgoing edges. (If no such node exists, there is no solution.)
If all you have is the graph topology (which representation ?), all you can do is an exhaustive search node by node until you find one with only outgoing edges. |
If I understand correctly, the first node is the one and only one in the graph having only outgoing edges. (If no such node exists, there is no solution.)
If all you have is the graph topology (which representation ?), all you can do is an exhaustive search node by node until you find one with only outgoing edges.
... |
The shortest non-contracting grammar we could come up with is:
\begin{align*}
S&\rightarrow a\ |\ LR\\
L&\rightarrow LD\ |\ D\\
Da&\rightarrow a^2D\\
DR&\rightarrow aR\ |\ a^2
\end{align*}
- L marks the left side of the word, produces the doubling symbol D, and can only be eliminated by conversion to a D.
- D i... |
null |
I have an undirected graph which grew according to a **recursive algorithm**, i.e., it started with a single vertex and then, one after another, new vertices arrived and connected to existing ones.
Now, I'm given the graph with, say, $n$ vertices. **I would like to estimate (efficiently) which vertex was the first o... |
Here's a wrong proof, though it only takes a moment's thought to dispel:
"**Theorem**": $\mathrm{P} \not= \mathrm{NP}$
"**proof**": There is some oracle $O$ such that $\mathrm{P}^O \not= \mathrm{NP}^O$. But if $\mathrm{P} = \mathrm{NP}$ then $\mathrm{P}^O = \mathrm{NP}^O$ for _any_ oracle $O$! QED. |
null |
Yes your way is true. But it's better to notice that your language most be countable. Because your language might be uncountable but L only contains a countable subset of it. In this case you can't enumerate all of your language's words because it is not countable. |
Yes your way is true. Because when L is recursive, your language should have a decidable alphabet. Because if it doesn't, then the set of your language's words can't contain a recursive subset. So your way to enumerate all possible words is true. |
Unfortunately, it is NP-hard, by reduction from the [subset sum problem](https://en.wikipedia.org/wiki/Subset_sum_problem).
The reduction is trivial: let $S$ be a set of integers, and $T$ a target sum (i.e., an instance of the subset-sum problem). Consider the following change-making problem: let $S$ be the set of ... |
I'm currently studying formal methods in software engineering related to state machines, specifically Mealy machines. This made me wonder how relevant Mealy machines really are for practical applications. I realize that a lot of applications are based on state machines which can at some level be modelled as Mealy machi... |
Real-life applications of pure Mealy machines |
|finite-automata|software-verification|model-checking|modelling|software-testing| |
No. Context-sensitive languages [can be recognized by linear-time nondeterministic Turing machines](https://en.wikipedia.org/wiki/Context-sensitive_language), which are not Turing complete.
The ability to recognize a recursively enumerable set also does not prove that the programming language is Turing-complete. F... |
null |
null |
Let us say you have a polyotpe define as the intersection of halfplanes. That is you are given N half-spaces. The polytope is the volume defined by all points which lie on the positive side of all N half-spaces.
I want to make a mesh of the surface of the polytope. I.e. find the positions of the vertices plus their ... |
How to turn a 3D polytope into a mesh? |
|graphs|computational-geometry|topology| |
**Hints:**
If efficiency is not your first concern, you can implement a simple solution.
Assume you have solved the problem for the first $k$ halfplanes and obtained a polyhedric representation, made of vertices, edges and faces. The next step is to cut that polyhedron with the next plane.
By means of the impl... |
null |
# Inuyasha Yagami
Hi everyone, I nominate myself for moderator.
I have been a member of the community from the past 4 years. However, I started actively participating 2 years back.
I like answering questions on the site. But I find it equally satisfying to keep the site clean. The second task is exceptionally ... |
> 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?
I will be thankful to the user for their valuable answer. In case of large number of arguments, I will suggest the user to take the discussion to chat. However... |
I have come across what seems to be a collapsed loop.
parallel-for i, j = 1...n
What would be the work and span/depth/critical path length be of loops like this? Would it be the same as that of the following:
parallel-for i = 1...n
parallel-for j = 1...n |
Parallel Algorithm Analysis: Loops |
|algorithms|complexity-theory|algorithm-analysis|runtime-analysis|parallel-computing| |
null |
I felt similar qualms about the difference between small-step and big-step semantics. I think I personally lacked a concrete example, so I will produce one here. I will use Haskell to encode both big-step and small-step semantics in the form of an evaluator.
Consider the simplest possible expression language with ju... |
null |
This [post](https://cs.stackexchange.com/q/19582/157195) introduces a new variant of 3-SAT called EQUAL-3-SAT where the number of clause is same as number of variables, and it is shown to be NP-complete.
I want to ask if the monotone version of this EQUAL-3-SAT is also NP-complete ,by monotone ,I mean where each cla... |
Complexity of variant of 3-SAT |
|complexity-theory|np-complete| |
null |
***#Positive-2SAT*** is the problem of counting the number of satisfying assignments to a given Positive 2-CNF formula i.e 2-CNF formulas in which each literal is a positive occurrence of a variable.
The following variant of *#Positive 2-SAT* is defined as follows :
For example ,We are given a set of variables :
... |
null |
***#Positive-2SAT*** is the problem of counting the number of satisfying assignments to a given Positive 2-CNF formula i.e 2-CNF formulas in which each literal is a positive occurrence of a variable.
The following variant of *#Positive 2-SAT* is defined as follows :
For example ,We are given a set of variables :
... |
null |
Several recent research work has shown that transductive learning/inference outperforms inductive learning/inference during classification problems. This has been found in few-shot learning, other metric learning works, etc. But all of these results are experimental. Is there any theoretical/mathematical reason why thi... |
Transductive Learning vs Inductive Learning in Machine Learning |
|optimization|machine-learning|classification|learning-theory|experimental-analysis| |
> 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?
I will be thankful to the user for their valuable answer. In case of large number of arguments, I will suggest the user to take the discussion to chat. However... |
All charts of machine learning performance across epochs have a logarithmic shape ( a+ b log n). Is it formally agreed that the optimal performance of machine learning algorithms is bound by O(n) = log(n) where n is the number epochs (and ultimately the number of examples the algorithm visits).
[ introduces a new variant of 3-SAT called EQUAL-3-SAT where the number of clause is same as number of variables, and it is shown to be NP-complete.
I want to ask if the monotone version of this EQUAL-3-SAT is also NP-complete ,by monotone ,I mean where each cla... |
I am trying to understand [this](https://snap.stanford.edu/class/cs224w-2016/slides/page_rank.pdf), especially the last page. For calculating the Page Rank we can use the following formula for matrices:
$$
A = \beta M + (1 - \beta) \left(\frac{1}{n}\right)_{n \times n}
$$
Then we can use power iteration for the... |
I am trying to understand [this](https://snap.stanford.edu/class/cs224w-2016/slides/page_rank.pdf), especially the last page. For calculating the Page Rank we can use the following formula for matrices:
$$
A = \beta M + (1 - \beta) \left(\frac{1}{n}\right)_{n \times n}
$$
Then we can use power iteration for the... |
You know how programming languages can be based on Lambda Calculus or the Turing Machine and SQL is based on relational algebra. Is there any such thing for CSS or any foundation that could be used for styling languages in general if we were to design a new language from scratch?
I wonder this because if there's non... |
Is there theoretical foundation behind CSS? |
|formal-languages| |
null |
I don't think there is a deeper foundation, as CSS is just a lookup table of key value pairs declared under certain rules. It then gets interpreted by the browsers' graphical renderer. From a linguistics perspective, I'd see CSS syntax as the following: `Map<Rule, Map<String, Value>>`, where `Rule` is its own querying ... |
You know how programming languages can be based on Lambda Calculus or the Turing Machine and SQL is based on relational algebra. Is there any such thing for CSS or any foundation that could be used for styling languages in general if we were to design a new language from scratch?
Styling and layout in general is som... |
Is there a theoretical foundation behind CSS? |
|formal-languages|programming-languages| |
The idea is to find infinitely many strings that are distinguishable from each other with respect to the Myhill-Nerode equivalence relation defined by $L$.
Consider the strings $a, a^2, a^3, \cdots$. Let us check they are distinguishable from each other.
Let $a^{k_1}$ and $a^{k_2}$ be two of them. WLOG, assume $k... |
I have searched quite a few posts here so that I can prove that the language $$L=\{a^kb^l: 1\leq k\leq l\}$$ is not regular (using Myhill-Nerode's theorem). I know that I must find an infinite number of pairs $(c,d)$ such that if $R$ is the equivalence relation defined by Myhill-Nerode's theorem, there is a string $z \... |
Prove $\{a^kb^l: 1\leq k\leq l\}$ is not regular using Myhill-Nerode theorem |
null |
A graph is 2-edge-connected if and only if it has a closed ear decomposition.
I am looking for such a theorem for the **3**-edge-connected case. Unfortunately, I have not been able to find one. Is there something like this in the literature? |
Is there a decomposition theorem for 3-edge-connected graphs? |
|graphs| |
I am trying to understand [this](https://snap.stanford.edu/class/cs224w-2016/slides/page_rank.pdf), especially the last page. For calculating the Page Rank we can use the following formula for matrices:
$$
A = \beta M + (1 - \beta) \left(\frac{1}{n}\right)_{n \times n} \quad \quad \quad \quad (1)
$$
Then we ... |
null |
Type Systems
============
The page you link to is about type systems. The differences most people should be aware of when starting out is static vs dynamic typing and strong vs weak typing (though feel free to explore and ask about more).
Type systems are logical rules built into compilers and interpreters for a... |
All charts of machine learning performance (y-axis:accuracy 0.0-1.0) across epochs have the below shape. Is there any research that explain how this convergence is bounded O(n) where n is the number epochs (and ultimately the number of examples the algorithm visits).
[![enter image description here][1]][1]
... |
how Is Convergence of machine learning bounded O(n)? |
A type definition is the creation of a new type, that gets a name. Can be a `typedef`, a `class`/`struct`/`union`/`enum` definition...
Simple example:
typedef int MyInt;
creates the type `MyInt`. |
The problem you're solving is called the MLCS (multiple longest common subsequence).
A standard sequential algorithm for three strings `A`, `B`, `C` of lengths `a`, `b`, `c` would look something like:
```
R <- a × b × c array
-- initialise the base cases
for i <- 1...a:
R[i, 0, 0] <- 0
for i <- 1...b:
R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.