instruction stringlengths 0 29.8k ⌀ |
|---|
I was reading this question on CS stack exchange called [How important is initial state for local search optimisation?][1]
I would like to extend it with the following example:
I have been reading about optimisation techniques and noticed that if a random initial state is provided to a genetic algorithm, it may s... |
while solving some questions about network flow I was wondering about the following statement:
> Given a network flow (a graph $G=(V,E)$ with a source $s \in V$ and sink $t \neq s \in V$) > and an arbitrary vertex $v \in V$, how can we find if the vertex $v$ belongs to any minimum cut?
A vertex $v$ belongs to a m... |
I was reading David J.C. MacKay's [Information Theory, Inference and Learning Algorithms][1](pdf available in the link), and in section 16.4 of Chapter 16: Message Passing, he writes about how only separable problems can be solved using a message passing approach. One of the non-separable problems he mentions is:
> ... |
Finding Large Subset of Variables Approximately Equal, Low-Cost with Neural Network |
|algorithms|neural-networks| |
I was reading David J.C. MacKay's [Information Theory, Inference and Learning Algorithms][1](pdf available in the link), and in section 16.4 of Chapter 16: Message Passing, he writes about how only separable problems can be solved using a message passing approach. One of the non-separable problems he mentions is:
> ... |
[![Describe the langauge accepted by the DFA][1]][1]
[1]: https://i.stack.imgur.com/0SdF7.png
Describe the language accepted by the DFA shown above |
Describe the language accepted by the DFA |
|automata|finite-automata| |
null |
Network flow - properties of a vertex that belong to any minimum cut |
The answer is 'it depends'. It depends on the particular problem you are optimizing. I doubt you are going to get a single answer that applies to everything. In general, reducing the dependence on the initial state is generally considered a good property of an optimization algorithm, but there is no clear way to eva... |
(sci-fi-esque question inspired by Counterpart).
A portal between our world (called $A$) and a parallel world that's exactly the same (called $B$) opens up. Bob sees himself through this portal.
$A$-Bob says hello, but since he's in the exact same circumstance, $B$-Bob also says hello at the exact same time. Bas... |
Asymmetric communication between two symmetric parties? |
|information-theory|cryptography|communication-protocols|physics|philosophy| |
null |
(sci-fi-esque question inspired by Counterpart).
A portal between our world (called $A$) and a parallel world that's exactly the same (called $B$) opens up. Bob sees himself through this portal.
$A$-Bob says hello, but since he's in the exact same circumstance, $B$-Bob also says hello at the exact same time. Bas... |
Category theory is useful only in a few places in functional programming:
- Implementing libraries that work with arbitrary type constructors. Category theory is good for this kind of highly abstract code. For example, one can define a product of arbitrary endofunctors, a co-product of arbitrary endofunctors, etc., ... |
null |
Category theory is useful only in a few places in functional programming:
- Implementing libraries that work with arbitrary type constructors. Category theory is good for this kind of highly abstract code. For example, one can define a product of arbitrary endofunctors, a co-product of arbitrary endofunctors, etc., ... |
I have been studying the necessity of a WHILE loop when defining the Ackermann Function.
I am looking to write a program to compute the Ackermann function in a high level language such as Python or JavaScript to compare it to the [WHILE language][1].
The Ackermann function is defined recursively, and recursive call... |
Ackermann Function without Recursion or Stack |
|algorithms|computability| |
Your code snippet is a bit misleading.
```
floating = fixed / 65536.0
```
It would be more correct to write it as:
```
floating = float(fixed) / float(65536)
```
With the `float()` being the CPU's built-in operation for converting `int` to `float`.
If you're working with C/C++ the `float()` is implic... |
null |
> I have a question about the relation between functions and truth, such as that discussed in the Church-Turing thesis.
This doesn't have much of anything to do with the Church-Turing thesis! Your question, and formalization here, is related to the study of Boolean logic and truth values.
> If we assume the state... |
null |
Good question! It is possible using only natural numbers and arithmetic to implement a stack, due to [Gödel numbering](https://en.wikipedia.org/wiki/G%C3%B6del_numbering).
What's the basic idea? Well, a stack is basically a nested sequence of pairs: the stack $(1, 2, 3)$ (with $1$ on top) can be thought of as $(1, (... |
Good question! It is possible using only natural numbers and arithmetic to implement a stack, due to [Gödel numbering](https://en.wikipedia.org/wiki/G%C3%B6del_numbering).
What's the basic idea? Well, a stack is basically a nested sequence of pairs: the stack $(1, 2, 3)$ (with $1$ on top) can be thought of as $(1, (... |
Category theory is useful only in a few places in functional programming:
- Implementing libraries that work with arbitrary type constructors. Category theory is good for this kind of highly abstract code. For example, one can define a product of arbitrary endofunctors, a co-product of arbitrary endofunctors, etc., ... |
Category theory is not a good basis for understanding Haskell. Category theory has certain but limited use for learning functional programming and in actual practice of functional programming. I recently made a presentation to answer the question "What did category theory ever do for us (functional programmers)". See h... |
Category theory is useful only in a few places in functional programming:
- Implementing libraries that work with arbitrary type constructors. Category theory is good for this kind of highly abstract code. For example, one can define a product of arbitrary endofunctors, a co-product of arbitrary endofunctors, etc., ... |
null |
After accepting the command entered by user,the shell generates a readily executable simple command line by parsing it evaluating variables(if present),performs command substitution,interprets metecharacters like * and ?(if present) and identifies the PATH.
Can anyone explain to me in simple terms the parsing par... |
I need help in understanding the sentence |
|operating-systems| |
null |
I came across a simple solution: Ignore the fact that it is a heap, reverse pardition around the median, and repeat this log(n) times, each time for the left half of the previos part... |
(I haven't read any literature on this paradox nor am I good at formal proofs, so this is just my intuitive thoughts on the paradox.)
If we assume the statement "This statement is false" as a function `f()` on a state machine `M`, where `M` has 2 states `S0` and `S1` representing `false` and `true`, we'd just be eva... |
Good question! It is possible using only natural numbers and arithmetic to implement a stack, due to [Gödel numbering](https://en.wikipedia.org/wiki/G%C3%B6del_numbering).
What's the basic idea? Well, a stack is basically a nested sequence of pairs: the stack $(1, 2, 3)$ (with $1$ on top) can be thought of as $(1, (... |
The DFA accepts strings of the language $(ab)^{*}$.
Informally, the string $ab$ repeated an arbitrary number of times is accepted by the DFA. |
Good question! It is possible using only natural numbers and arithmetic to implement a stack, due to [Gödel numbering](https://en.wikipedia.org/wiki/G%C3%B6del_numbering).
What's the basic idea? Well, a stack is basically a nested sequence of pairs: the stack $(1, 2, 3)$ (with $1$ on top) can be thought of as $(1, (... |
I found "Combinators: A Centennial View" but it has too much advertising in it. Every second page Wolfram tries to sell the reader his programming language. Is tehre any wellwritten book with less advertisemenet. |
Book references for Combinator logic as applied in Haskell? |
|combinatory-logic| |
I am looking for book references on combinatory logic. Is there a book focused on how combinatory logic is applied in the context of pure functional languages like Haskell?
I found ["Combinators: A Centennial View"](https://arxiv.org/abs/2103.12811) by Stephen Wolfram (2021), but it has too much advertising in it. E... |
Book references for combinatory logic as applied in Haskell? |
|functional-programming|haskell|combinatory-logic| |
> If we assume the statement "This statement is false" as a function `f()` on a state machine `M`
This is a good example of choosing the wrong concept to formalize something :)
First of all, you really mean a function on the *set of states* of the state machine M. But more importantly, the "state machine" part is... |
The paradox which you seem to be alluding to is often referenced as the [Liar's paradox][1] or in another form, [Russell's paradox][2] which in such form technically speaking is set theoretic. The crux of such a paradox is a statement that seems to produce the following logical form:
**S<sub>1</sub>** If x is true, ... |
This language satisfies the conditions of the [pumping lemma][1]. (By the way, your question title is wrong: you are not asking why it is context-free; you are asking why it satisfies the conditions of the lemma, which it does.)
Take the string $s=a^mb^m$ and assume $m>0$. Don’t use $p$ or $n$; otherwise it is confu... |
null |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaces by minus conditional entropy.... |
How can be the mutual information be equal to conditional entropy? |
|information-theory|entropy| |
How can the mutual information be equal to conditional entropy? |
How can the mutual information be equal to minus conditional entropy? |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaced by minus conditional entropy.... |
null |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaced by minus conditional entropy.... |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaced by minus conditional entropy.... |
I am reading the following paper:
https://arxiv.org/abs/2301.06941
The authors in Eq.(8) have obtained a relation which has the mutual information, $i$, in the exponent of the exponential on the RHS of the 1st line. At the end of this equation, it seems mutual information is replaced by minus conditional entropy.... |
Not sure if I can use a figure, but I am trying to understand how KD-tree works when we insert a node and how it splits the xy plane, please. Below $[5, 4]$ splits the xy-plane into left and right parts while $[2,6]$ splits it into top and bottom. Why we don't say that $[2,6]$ again splits the space into left and right... |
Visualizing How of KD-tree Data Structure Splits Space |
|kd-tree| |
Suppose we have a metric space $(X,d)$ and we call $r$ to be a root vertex and then there are $n$ clients(i.e. $n$ vertices/nodes) who need packages delivered to them from $r$. The $i$th client demands a package of weight $w_i$ and is $d(r,i)$ distance away. Two clients $i,j$ are $d(i,j)$ distance away. Initially, all ... |
Suppose we have a metric space $(X,d)$ and we call $r$ to be a root vertex and then there are $n$ clients(i.e. $n$ vertices/nodes) who need packages delivered to them from $r$. The $i$th client demands a package of weight $w_i$ and is $d(r,i)$ distance away. Two clients $i,j$ are $d(i,j)$ distance away. Initially, all ... |
Contiguous arrays with variable length, such as C++'s `std::vector`, have been a major sequential container for languages whose evaluation is eager. However, it has been commonly considered that contiguous arrays do not mix well with lazy evaluation. Indeed, `Array`s that Haskell provides are strictly evaluated for its... |
Can contiguous arrays be lazily evaluated? |
|data-structures|programming-languages|arrays|language-design|evaluation-strategies| |
# Pseudonym
G'day, everyone. I would like to nominate myself for moderator. Thank you in advance for considering me.
I chose this handle when I was a teenager (at some point in the 1980s) after reading Douglas Hofstadter's *Gödel, Escher, Bach: an Eternal Golden Braid*.
I have been a fairly active member for o... |
> 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 |
# Pseudonym
G'day, everyone. I would like to nominate myself for moderator. Thank you in advance for considering me.
I chose this handle when I was a teenager (at some point in the 1980s) after reading Douglas Hofstadter's *Gödel, Escher, Bach: an Eternal Golden Braid*.
I have been a mostly-active member for o... |
> 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... |
Suppose, I have a list of lists where multiple lists can have same elements. In my final output, I just want one list with the same element. An example is the following:
**Input:** A=[[1,2,0], [0,1,2], [2,1,0], [4,5,6], [6,5,4]]
**Desired Output:** $[[0,1,2], [4,5,6]]$
Can someone help me with an easy function... |
Discarding lists of same elements |
|programming-languages|python| |
This isn't a complete answer, but you could do a lot worse than to go through the relevant sections of *[The Implementation of Functional Programming Languages][1]* by Simon Peyton-Jones, particularly the chapter on SK combinators. The book is now free.
[1]: https://www.microsoft.com/en-us/research/uploads/prod/... |
The root will choose the split in one direction (in your case, (5,4) creates a vertical split). Then any nodes at the next level in your tree will split horizontally, then the nodes in the next level of the tree will split vertically again.
If you are only splitting one way - like you suggest with only vertical spli... |
# Pseudonym
G'day, everyone. I would like to nominate myself for moderator. Thank you in advance for considering me.
I chose this handle when I was a teenager (at some point in the 1980s) after reading Douglas Hofstadter's *Gödel, Escher, Bach: an Eternal Golden Braid*.
I have been a mostly-active member for o... |
null |
Apart from their more complex structure, [Y-fast](https://en.wikipedia.org/wiki/Y-fast_trie) and [X-fast](https://en.wikipedia.org/wiki/X-fast_trie) trie assumes that data to be stored are integers, while balanced [BSTs](https://en.wikipedia.org/wiki/Binary_search_tree) only assumes that data be from some ordered unive... |
Your code snippet is a bit misleading.
```
floating = fixed / 65536.0
```
It would be more correct to write it as:
```
floating = float(fixed) / float(65536)
```
With the `float()` being the CPU's built-in operation for converting `int` to `float`.
If you're working with C/C++ the conversion to float... |
The question is the following:
Construct CFG for the L = {w ∈ {0, 1}∗ : w is a palindrome and |w| is divisible by 3}.
I am able to construct CFG for the set of all palindromes as below:
**S --> aSa | bSb | a | b | ϵ**
I am not able to figure out how to make |w| divisible by 3 in my CFG.
|
CFG for the language {w ∈ {0, 1}∗ : w is a palindrome and |w| is divisible by 3} |
|formal-languages|context-free|formal-grammars| |
Use additonal "state" information to the variable $S$ that specifies the number of terminal symbols generated, mod 3.
So we have three variables $S_i$, $i=0,1,2$.
One example of a new production would be $S_1 \to aS_2 a$. |
This appears to be an instance of the [set cover](https://en.wikipedia.org/wiki/Set_cover_problem) problem. There is no efficient algorithm, but you can read about standard algorithms. |
I am a bit confused on what the difference between a "function problem" and a "search problem" is.
The specific problem I have been studying is known as End-Of-The-Line:
> Given two functions, $P(x)$ and $N(x)$, a value $v$ is said to be balanced if $N(P(v)) = P(N(v)) = v \lor N(P(v)) \neq P(N(v)) \neq v$. Given... |
Difference between function and search problems? |
|complexity-theory|search-problem| |
You have $n$ questions in an exam. Question $i$ is answered correctly with probability $pi > 0$. If question $i$ is answered correctly, you get $R_i$ marks. You can choose to answer
the questions in any order. As long as you are giving correct answers, you can
accumulate all the marks. However, whenever your answer t... |
Dynamic Programming: Optimal Order |
|optimization|dynamic-programming|reinforcement-learning| |
I think answer itself is wrong(pls correct me if not) because first Choose 0 from (0+10)* and 11 from (11+€) so we get 011 and from final (0+10)* if we choose 10 final string becomes 01110 where we get 2 consecutive 1 pairs. This may work (0+10)* (11+£) (0+01)* |
null |
First, if any $p_i=0$, then immediately throw it away since you're guaranteed to lose. If any probability is $1$ then immediately ask it! (after all why *risk* not getting the reward when you're guaranteed to get it!). So I'll assume we're now considering probabilities in the range $(0,1)$.
Suppose you **know** tha... |
Contiguous arrays with variable length, such as C++'s `std::vector`, have been a major sequential container for languages whose evaluation is eager. However, it has been commonly considered that contiguous arrays do not mix well with lazy evaluation. Indeed, `Array`s that Haskell provides are strictly evaluated for its... |
forgive me if my question is vaguely phrased.
I’m fishing around for a PRNG algorithm which generates numbers of a constant length, regardless of the seed.
I tried experimenting with a LCG but obviously the output for that is 0<=Xi+1<=m. Plus points if the algorithm is reversible (like you could get the seed bac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.