instruction stringlengths 35 29.1k |
|---|
Wikipedia has this about Pigeonhole sort:
Pigeonhole sorting is a sorting algorithm that is suitable for sorting lists of elements where the number of elements (n) and the length of the range of possible key values (N) are approximately the same.
I can see how it would be counterproductive to have more key values tha... |
A policy $P$ is defined as a set of parameters. We want to know the optimal policy $O$, which certainly exists but unfortunately unknown.
$D(P)$ shows how far $P$ is from $O$. The function $D$ itself is unfortunately not known. However, $D(P) - D(Q)$ is known. That is, one can always know which among $P$ and $Q$ is clo... |
I have an assignment where i have to encode certain problem to conjunctive normal form so i can solve it by using SAT solver. I have been able to encode my problem correctly but the solver is quite slow and most likely the cause for this is the length of some clauses which i have.
So my question is:
How can one break ... |
I have an array of elements $A = [x_0, x_1, \ldots, x_n]$, such that for some $0 \leq k \leq \frac{n}{2}$, there are $k$ 'bad' elements in $A$, but I don't know what indices they are at, or indeed, how many there are aside from the given bounds. I have a function which can, in $O(1)$ time, check if something is 'bad' o... |
I have a set of experiments with distributed environments.
I am planning to present a total network I/O bytes usage of the system for each run.
Which one should I report as total network I/O bytes among Sum(InBound Traffic) or Sum(InBound Traffic + OutBound Traffic)?
For example, say there are two machines A and B in ... |
In Khan Academy's RSA Encryption 2 video, I can't understand how they have got from
$$m^e\bmod N\equiv c$$
to
$$c^d\bmod N\equiv m\,.$$
The transcript says,
01:39 some piece of information that makes it
01:41 easy to reverse the encryption
01:44 we need to raise $c$ to some other exponent, say $d$,
01:48 which w... |
How can i remove from a red/black tree a subtree whose root and its sibling are red, and their parent is black, in $O(\lg n)$ time, while keeping the red/black properties at the end of the process?
In other words:
I have a black/red tree with $n$ nodes, a given black node $y$, and his two red children $x$ and $z$. How... |
I'm trying to wrap my head around the coin change problem, where you try to find the total number of ways $N$ cents can be exchanged using $M$ coins $\{C_1, C_2, ..., C_m\}$.
The recurrence relation is this:
I'm having difficulty understanding the 3rd line where it says solution[i][j-v[i-1]]. What exactly is this v th... |
Let f$(n)=O(n)$, $g(n)=\Omega(n)$ and $h(n)=\Theta(n)$.
Then $g(n)+f(n)\cdot h(n)$ is equal to what among $O(n)$,$\Omega(n)$ and $\Theta(n)$?
Also explain how to evaluate it.
|
Given an array with only 0 & 1. Can we have an algorithm which has all the following desirable characteristics-
The algorithm runs in $O(n)$ time.
The algorithm is stable.
The algorithm sorts in place.
I know the algorithms if only 2 characteristics are required but want to know if all the three characteristics po... |
Let $T_1(n) = O(f(n))$ and $T_2(n) = O(f(n))$.
Then $T_1(n) / T_2(n) = O(1)$ is a false statement. A counterexample is $T_1(n) = n^2$, $T_2(n) = n$, and $f(n) = n^2$.
I don't get this counterexample, if $T_2(n) = n$, then $T_2$ is $O(n)$ and not $O(n^2)$. (As indicated by $T_2 = O(f(n))$ and $f(n) = n^2)$. Therefore,... |
I have a function application:
E1 E2
Can someone please show me an example, how to execute function?
|
I can not see the difference between beta reduction and substitution.
For example:
(+ x 1) [x -> 2]
Here I can do the substitution, replace the variable x through 2(lambda expression) and result is:
(+ 2 1)
An example of beta reduction:
(λ x. + x 1) 2
the result would be
+ 2 1
For me, there are no difference betwe... |
There is a classic problem of finding the only number that occurs an odd number of times in a list. The solution is to xor everything and the result is the requested number.
The key properties used here are the involution of xor (i.e. a number's inverse is the same number) and the closure over integer range of the vari... |
I am trying to calculate the big theta of $ \lceil{log(n+1)}\rceil $.
I derived the following inequality:
$ log(n+1) \le \lceil{log(n+1)}\rceil \le log(n+1) + 1 $
Based on the definition of big theta, a function $ f(n) \in \Theta({g(n))} $ iff $ \exists \ c_1,\ c_2 > 0 $ and a constant $k $ such that $ \forall n \ge k... |
Assume we have a fixed number of $n$ one-dimensional affine functions of the form $f_i(x) = a_i x + b_i$ for $i \in N = \{1,\ldots,n\}$.
Consider some fixed value $k \in \{0,\ldots,n\}$. Let $S_k : \mathbb{R} \mapsto 2^N$ (power set) denote a function mapping some value $x \in \mathbb{R}$ to the set of indices of the $... |
Assume $u(n)$ calculates $n^2$ in $n$ steps, thus is in $O(n)$, and $v(n)$ calculates the square root of $n$ in $\sqrt n$ steps, thus is in $O(\sqrt n)$.
What is the runtime of the program u(v(n))?
The argumentation in my solution is:
"We calculate the square root first, then we take it's square. $\sqrt n + \sqrt n = 2... |
I'm considering the problem (a variant of 3-PARTITION, see here) with description
Instance: Set of positive integers $A={w_{1},...,w_{n}}$ with $S(A)=\sum\limits_{i=1}^{n}w_{i} = 3m$.
Question: Is there a partition of $A$ into 3 subsets $A=A_{1}\cup A_{2}\cup A_{3}$ such that $S(A_{1})=S(A_{2})=S(A_{3})$?
I plan... |
I am having trouble to get the intuition behind the following approach:
We take the fraction point (say: .642) and continuously multiply by 2,
taking whatever ends up right of the point as our next number (either 0 or 1) after the fixed point in the binary number. Then we take whatever is left after the decimal point a... |
We know that for general graphs vertex coloring problem/ minimum clique cover problem are NP-hard and for perfect graphs, they can be solved in polynomial time. There are classes of graphs which are perfect, e.g., bipartite graphs, chordal graphs, linear graphs, etc.
My question is that:
Are there any families of graph... |
There are Two Write Hit policies: Write Through and Write back
There are Two Write miss policies: Write Allocate and No Write
Allocate
There are two memory access techniques: simultaneous and
hierarchical access
Can any gentleman PLEASE write formulas for different combinations ?
I am having very importan... |
$$T(n) = T(\frac{n}{3}) + T(\frac{2n}{3}) + \sqrt n$$
Use the substitution method to prove $T(n) = O(n)$
What I have so far...
$T(n) \leq C_1n + C_2 \sqrt n-C_3 $
$T(n) \leq \frac{C_1n}{3} -C_3 + \frac{2C_1n}{3}+C_2 \frac{\sqrt {2n}}{3}-C_3 + \sqrt n$
I'm not really sure if I'm on the right track.
|
What does it mean when we say that an algorithm $X$ is asymptotically more efficient than $Y$ ?
$X$ will be a better choice for all inputs.
$X$ will be a better choice for all inputs except small inputs.
$X$ will be a better choice for all inputs except large inputs.
$Y$ will be a better choice for small inputs.
The... |
I have noticed this strange thing.All things related to Computers come in values which are powers of $2$.For eg. Rams come in $2,4,8$ or $16$ GB,pendrives and memory cards also come in similar values.Computers are $8,16$ or $32$ or $64$ bit values.
Everything remarkably a power of $2$.Why is everything $2^n$?
Why?Than... |
We know that $NTIME(t(n)) \subseteq DSPACE(t(n))$ and we know - by Savitch's theorem - that $NSPACE(s(n)) \subseteq DSPACE(s^2(n))$.
By the space/time relation $(s(n) \leq t(n))$ I know that $NTIME(t(n)) \subseteq NSPACE(t(n))$, then by Savitch's theorem $NSPACE(t(n)) \subseteq DSPACE(t^2(n))$ and not $DSPACE(t(n))$, a... |
My goal is to create a method that gets an array that only has 1's and 0's in it, and then turns every number into the amount of 'steps' it is away from the closest 0, left or right.
So for example [1] - [1] - [0] - [1] - [1] - [1] - [1] - [1] - [0] - [1] would be
[2] - [1] - [0] - [1] - [2] - [3] - [2] - [1] - [0] - ... |
I have been so confused for a while!! Please help me with this, thank you very much in advance!!
Given hypergraph $H = (V,E)$ consists of a set $V = \{v_1, v_2, \cdots, v_n\}$ of vertices and a set $E = \{e_1, e_2, \cdots , e_m\}$ of edges, each being a subset of $V$.
A subset $M \subseteq E$ is a matching if every p... |
Google is failing me, so here goes:
The data structure is used to describe a set of positive integers.
It works conceptually, by keeping track of disjoint ranges [a,b) on the number line.
These ranges are stored, in a sorted manner. For two consecutive ranges [a, b), [c, d) the invariant is that a < b < c < d.
The ran... |
Write-to-Read Relaxation means that for a processor:
later reads can bypass earlier writes
But what does that mean?
What exactly is the difference between a read and a write for a Cache?
An example we had in the lectures about Processor Consistency:
Isn't c2 also a write for w? How can it be before c1?
Why can CPU C... |
I am trying to understand what is MaxSNP-complete. I have read the wiki definition. I would like to get the intuition behind it. My knowledge of computational complexity is very basic.
|
I'm not an computer scientist, but still use/have an algorithm to find the $k$ nearest neighbours from a cloud of $N$ points in $d$ (my case $d=3$) dimensional space using some distance measure (in my case Euclidean). I had some look at the literature and it appears that the standard is J. H. Friedman, J. L. Bentley, a... |
If $L_1,\, L_2 \in RE / R$, must there exist a (computable) many-one reduction between them?
I can prove that for every two languages in $R$ exists a reduction between them. A possible reduction $L_3 \leq L_4$ where $L_3,\, L_4\in R$ goes as follows:
given an input $x$ to $L_3$, run $M_3$ (it's TM), if it accepted, ret... |
A hypergraph $H = (V,E)$ consists of a set $V = \{v_1, v_2, \cdots, v_n\}$ of vertices and a set $E = \{e_1, e_2, \cdots , e_m\}$ of edges, each being a subset of $V$.
A subset $M \subseteq E(H)$ is a matching if every pair of edges from $M$ has an empty intersection.
The dual $H^*$ of $H$ is a hypergraph whose vertic... |
I have been reading about how to test the undecidability of a problem, and some tests talk about the reduction technique. For what I could understand of this technique is that if I want to prove that problem X is undecidable I can take a problem Y which has already been proven to be undecidable. Then by using logic or ... |
Is there a DFA that accepts no string, but has at least one final state?
I think it would be possible to make a DFA that accepts no string only by creating no final states or by making sure that the final states are not accessible. But how can a state not be accessible if a DFA has all of its transitions defined?
|
I have to construct a pushdown automaton for the following language over alphabet {a,b,c}:
L={ ucv | |u|!=|v|; u,v={a,b}* }
(note: u,v are substrings over alphabet {a,b}, |u| is length of substring u)
My tutor has constructed a PDA using 4 states, however - I believe it's possible to construct this with only 3. Here's ... |
I am trying to interpret the following problem:
"Describe an algorithm for a Turing machine which receives the integer n as
input and proceeds to write the description of the n-th Turing machine from
the standard enumeration on its tape."
I am confused about how a Turing machine itself can represent another Turing mach... |
$T(n)=n\displaystyle \cdot T\left(\frac{n}{2}\right)+n^{\log_{2}n}$.
$f(n) = n^{\log_{2}n}$
Number of leaves = $n^{\log_{a}b} = n^{\log_{2}n}$
CASE 2 (All level same)
$f(n) = \Theta(n^{\log_{b}a} {\log^{k}n}) $
$f(n) = \Theta(n^{\log_{2}n} {\log^{0}n}), $ because $b = 2$, $a = n$, $k = 0$
Is $T(n) = \Theta(n^{\log_{2}n... |
If there are given two arrays, A and B, each containing n real numbers in sorted order. How to compute the median of all the numbers in A and B, in O(log n) time. I have to make an algorithm that takes at most logarithmic time.
My idea:
A = 1, 3, 6, 8, 10, 15, 20
B = 1, 2, 3, 7, 10, 30
C = sort(A, B)
a = len(A) // 7... |
Let us define a Turing machine by a machine description that is a string of symbols produced by some numerical encoding. For example, a Turing machine $M_1$ can be represented by 9,900,599 ([0 0 halt], where halt = 5 and the start and end of an instruction is 99). A standard enumeration consists of all possible Turing ... |
I have some questions regarding the emptiness problem of Turing machines when we have a TM which accepts empty language, and we have to make sure that the TM does not accept any string. My questions are:
in formal description of TM I have read that input alphabet can't be
empty then how a machine can accept empty inpu... |
Good day.
Consider N points forming a circle (N is even and is between 1 and 200).
The task is to calculate the minimum cost of linking all 2 points (as pairs) without any lines intersecting.
Each point is given an ID. The cost to link 2 points a and b is (id(a)+id(b))²
Please note: a point can't be part of 2 pairs.
Ex... |
Suppose I have distinct letters in an alphabet $\sum = \{a_1,a_2,...,a_n\}$. I also have two permutations of these letters, let's call them $A,B$. How can I find the Edit distance between $A$ and $B$ with block edit operations allowed?
To make it clearer, an example would be $\sum =\{a,b,c,d \}$. Two possible permutati... |
Let's say that I define the language $L$ over the alphabet $\{0, 1\}$ to be a language containing only one word, $w$, where:
$$ w =
\begin{cases}
1 & \text{if the continuum hypothesis is true}\\
0 & \text{otherwise.}
\end{cases}
$$
$L$ is finite, therefore there is a Turing Machine which can decide whe... |
The definition of NP-hard problem in Wikipedia is :
NP-hardness (non-deterministic polynomial-time hard), in computational complexity theory, is a class of problems that are, informally, "at least as hard as the hardest problems in NP".
There are NP-hard problems not in NP class. My question (more curiosity) concerns t... |
I am implementing a couple of PSO (particle swarm optimization) algorithms, and I got stuck on a bit of detail which I could not clearly determine from the papers I have read. In lbest PSO, for each particle, the velocity update step takes the best particle's position in that particle's neighbourhood into account. What... |
I am trying to build a tool for solving TSP problem using a conversion to SAT.
Does there exist an efficient conversion from the Travelling Salesman Problem to the Satisfiability problem? Since they both are NP-Complete it seems like the answer might be yes. I just need a conversion that is tractable in practice. Th... |
The log rank conjecture states that there is some universal constant $c > 0$ so that
$$CC(f) = O(\log^c \text{rk}\,(M_f))$$
where $f : X \times Y \to \{0, 1\}$ is a boolean function, $CC$ denotes the deterministic communication complexity, $M_f$ is the $|X| \times |Y|$ binary matrix associated to $f$, and $\text{rk}\,(... |
I would like to work on urbanisation and I've read that cellular automata has potential use on model urban sprawl. However I need some kind of introductory to cellular automata in order to tackle an academic paper I have found.
I have a fair background in Computer Science. Moreover I am looking for any tools from CS ap... |
I am learning about Hashing and have struggles with the following assignment:
$U$ is a universe of keys with $Z(m)=\{0,\ldots, m-1 \}$ the amount of possible hash-values.
Given $U= \mathbb{Z}_{55} = \{0, \ldots, 54 \}$ and $m=5$.
Does the function $h(k,i)= (k+i) \bmod{5}$ fulfill the conditions for Uniform Hashing?
... |
For $k = 0,\ldots, K - 1$, $M_k$ is a subset of $\{0, \ldots, N - 1\}$, and the subsets $M_k$ are not necessarily disjoint. I want to find a permutation on $\{0, \ldots, N - 1\}$ such that the range of values of each subset is as small as possible after permuting everything. Formally speaking, let $\sigma(M) = \{\sigma... |
Let be $G=(V,E)$ a directed graph without self loops, where each node has an out-degree of at least $k$.
We want to find a $E'\subset E$, so that $G'=(V,E')$ has the following properties:
Almost all nodes in $G'$ have an out-degree of: $l \le k$
$G'$ has the highest possible diameter
The almost all nodes part is to ... |
Does this problem have a solution with $o(n^2)$ time complexity? If so, what would be an example of such a solution?
Given $N$ integers in the range $[−50\ 000,\ 50\ 000]$, how many
ways are there to pick three integers $a_i$, $a_j$, $a_k$, such that $i$,
$j$, $k$ are pairwise distinct and $a_i + a_j = a_k$? Two ... |
The multiple knapsack problem (MKP) is defined in "A PTAS for the Multiple Knapsack Problem" as:
Instance: A pair $(B, S)$ where $B$ is a set of $m$ knapsacks and $S$ is a set of $n$ items. Each bin $j\in B$ has a capacity $c(j)$, and each item has a size $s(i)$ and a profit $p(i)$.
Objective: Find a subset $U\subsete... |
While I was using the Genetic Algorithm to generate full correct Sudoku grids starting from a population of random grids, I occasionally face the problem of the process being stuck on a local maxima until the population loses its diversity.
So, I decided to find a mechanism for maintaining the diversity of the populati... |
$$L=\{M\mid \text{there exist }x,y\in\Sigma^* \text{ s.t. }x \in L(M)\text{ and } y \notin L(M)\}\,.$$
I think it's not recursively enumerable because this language reduces to complement of the membership problem. $\langle M,w\rangle$ would be input where $y$ would become $w$ and $x$ belongs to $L(M)$.
Please tell me ... |
There are two orderings of numbers from the same set. Number $a$ is "immediately before" $b$ iff $a$ appears before $b$ in both sequences and there is no other number that appears between them in both sequences.
So in this example:
Seq 1: 1 2 3 4 5 6
Seq 2: 6 2 1 3 5 4
1 is not immediately before 2 because they appea... |
I have an undirected graph with weighted edges, in which I want to find the shortest paths from an initial node to every other node. Obviously Dijkstra's algorithm is usually a good choice, and I have previously used the variant where a min-priority queue (heap) is used to keep the set of tentative nodes $N_T$, and nod... |
I'm trying to find any publications involving a system that can classify if there is physical contact in a video. Ideally, if the physical contact is brief, it would also be beneficial to classify. However, despite this clearly defined problem, I've been unable to find any mention of this in the literature. I am able t... |
Consider this example from Wikipedia:
P1 | W(x)1
----------------------------------
P2 | R(x)1 W(x)2
----------------------------------
P3 | R(x)2 R(x)1
----------------------------------
P4 | R(x)1 R(x)2
Where P1 - P4 are different processors that issu... |
Assume $n$ is much greater than $m$. Would $O(nm)$ simplify to $O(n)$? Is there an explanation?
|
To check that a rational number is in the Cantor set, I have written an algorithm to obtain its base-3 representation. To verify if the representation is periodic, I used a hash table in order to save memory.
Is there any easier solution to check that a rational number is in the Cantor set?
|
i want to do a polynomial reduction from the Independent-Set-Problem which is NP-complete to the AUCTION-Problem, to show that AUCTION $\in$ NP-complete,
but why do i always have to show first, that our problem(in this case AUCTION) $ \in $ NP?
|
Why is computing the function at certain ranges of h
$$f(x) = \dfrac{\sqrt{-x+a} - \sqrt{2x+a}}{ 4a}$$
unstable? How would I rewrite this function so that it is stable?
|
I'm stuck trying to implement a DFA to do this. Everything I've tried so far seems to have to be able check the next nine elements to determine if the string terminates. Any tips?
|
I read the Wikipedia entry about "List of NP-complete problems" and found that games like super mario, pokemon, tetris or candy crush saga are np-complete. How can I imagine np-completeness of a game? Answers don't need to be too precise. I just want to get an overview what it means that games can be np-complete.
|
Well known example of Context-sensitive grammar which produces language $\{a^nb^nc^n|n\geq 1\}$ is widely used in various papers. But actually, while this language is definitely context-sensitive, it is also belongs to smaller subset of CS-languages: it is indexed language, because it can be described with indexed gram... |
I am trying to prove $L =$ {${a^k|k=2^n, n \ge 0}$} is not regular.
So far I have identifed a string $s = a^{2^p}$, and I've divided $s$ into $xyz$ as follows:
$x = a^l$
$y = a^k$
*(where $k + l \le p$)
$z = a^{2^p-l-k}$
Now, when I start to look at pumping, I first select $i=0$:
$xy^iz = xy^0z = xz = a^la^{2^p-l-k}=a... |
Let's say that I have a standard feedforward neural network which has $M$ inputs, some number of hidden layers $N$, and a single neuron in the output.
Is it possible to construct a network such that the output neuron's output value is the maximum weighted input value?
I know that I could easily hard code something to m... |
I am struggling with a proof from my discrete mathematics class. We have to prove that multiset union is idempotent, i.e. $M \sqcup M = M$, where $\sqcup $ denotes the union of multisets.
We have defined multiset union (using lambda notation) as $M_1 \sqcup M_2 := \lambda x : X \cdot M_1(x) + M_2(x)$, which means that ... |
I am trying to answer exercise 3.1 from Sedgewick and Flajolet's "Introduction to the Analysis of Algorithms". That is, I am trying to find the Ordinary Generating Function for the sequence:
$$\{kH_k\}_{k \geq 1}$$
I think that the generating function for this sequence is:
$$H_1 + 2H_2z + 3H_3z^2 + 4H_4z^3 + ...$$
whi... |
I know for pretty sure that there is a function with the type $f: \forall \alpha, \beta . \alpha \rightarrow \beta$ (at least in a Hindley-Milner type system), but I can't wrap my head over it. Neither could I think of an actual function with this type.
I found a function of this type, which in Standard ML would be wri... |
According to Wikipedia,
A $\rho$-approximation algorithm $A$ is defined to be an algorithm for which it has been proven that the value/cost, $f(x)$, of the approximate solution $A(x)$ to an instance $x$ will not be more (or less, depending on the situation) than a factor $\rho$ times the value, $OPT$, of an optimum sol... |
Wikipedia has this pseudocode on bucket sort:
function bucketSort(array, n) is
buckets ← new array of n empty lists
for i = 0 to (length(array)-1) do
insert array[i] into buckets[msbits(array[i], k)]
for i = 0 to n - 1 do
nextSort(buckets[i]);
return the concatenation of buckets[0], ...., b... |
To my understanding:
The Church-Turing thesis means that one could theoretically compute anything that can be computed using either a Turing Machine or the Lambda Calculus.
The Lambda Calculus is based on mathematical functions. This leads to the inability of "pure" functional programming languages based on Lambda ... |
In this How to show composition of one way function is not such? question, the accepted answer uses g(x,y) as a one way function.
But, for a given output of g(x,y) = 0|x| of length l (say), isn't the output of g(any x of length l, 0l) the same as the earlier output? Isn't this a possible preimage of 0|x|?
|
Before we start, my textbook declares lgn as base two.
I only have one question, how did log2 become n (both highlighted in yellow in the picture)? Is it because log2 = 1, which is too small to even matter?
|
I have recently been investigating dynamic topology neural networks and there is only one problem I have with understanding them. Because a neuron could be inserted at any point, the neurons are no longer organised into layers, so how is it possible to ensure that all of the inputs for Neuron A at position X have been ... |
I'm trying to prove the following language is in $L$ (decided by a TM in $O(\log n)$ space):
$$A = \{ (C,x) \mid C(x)=1\text{ and $C$ is a Boolean formula with depth }\log(n)\}\,,$$
where $n = |(C,x)|$. Equivalently, $C$ can be a Boolean circuit with maximum fan-out of $1$.)
Checking if a word $w$ is in "the right for... |
The a^n was pretty easy:
function powN(a, n) {
if(n == 0) return 1;
return a * powN(a, n - 1);
};
But somehow I got stuck on a^(2^n), any suggestions or even a hint?
I need a recursive algorithm that solves: a^(2^n).
|
Let $X=\{x_1,...,x_N\}$ be a set of real numbers. We consider $M$ sums over its subsets, e.g. $N=9$, $M=3$
$$
\begin{align*}
s_1&=x_1+x_2+x_3+x_9,\\
s_2&=x_1+x_2+x_4+x_9,\\
s_3&=x_1+x_2+x_5+x_9
\end{align*}$$
There are repeating subsums, e.g. $x_1+x_2+x_9$. If subsums are extracted and summed up separately, one needs 5... |
Given a Turing machine $M$, we associate a partial function $f_M : \Sigma^{\ast} \to \Sigma^{\ast}$ to it (this is called the function computed by the machine), where $\Sigma$ denotes the finite input and output alphabet, defined as
$$
f(u) = v :\Leftrightarrow \mbox{The machine halts on input $u$ with output $v$}.
$$... |
I implemented Q-learning and double-Q-learning as presented in Sutton's "Reinforcement Learning: An Introduction".
I test the algorithms on the OpenAI cliff walking gym and analyze the resulting policies after 500 episodes.
I was expecting the two policies to be the same, but actually the policies differ:
Policy learn... |
I brought the book Lambda-Calculus and Combinators: An Introduction by J. Roger Hindley and the author explains what is $\beta$-reduction.
Now there is a difference between $\beta$-contracts and $\beta$-reduces:
$$
\begin{align*}
P &\rhd_{1\beta} P^\prime\\
P &\rhd_{\beta} P^\prime
\end{align*}
$$
Could someone please... |
I've just had a thought about multiple precision number (i.e. variable length integers). The naive way to represent numbers is to use an array sized in such a way that the number of required bits can be stored. Example say we dispose of words of size $L$ and we want to store $N \leq 1$ bits, then we need an array of si... |
Consider a consensus process in which participants
Initially take a position
Receive positions only from their neighbors
Accept a new position that is a super-majority of neighbors positions.
Under what conditions is it possible for any participants to accept different new positions, regardless of whether they are ne... |
I have a problem, which appears to be similar to number partitioning:
a set of numbers partitioned (two-way), such that the sum of the numbers in each subset are as close as possible to a targeted ratio (instead of having the minimum difference, as in the number partitioning problem). Can I use the same algorithms? How... |
While calculating the cost in linear regression (for either with multiple features or a single one using gradient descent) we compute the cost by squaring and summing up the cost related to each training set. What is the point of summing up the cost related to each training example is what I do not understand.
Why not ... |
I want to do an analysis on the sum $ \Sigma_{i=0}^n f(i)$. All that is known about $f(i)$ is that $f(i) \in \Theta (i \log i ) $.
How do I do this?
|
I was working through an NFA to DFA conversion tutorial: where I'm converting the following NFA to a DFA:
I used lazy subset construction which I'm sure the tutorial did as well because we had the same transition table of:
delta | 0 | 1 |
===========+===========+==========+
{a} |{a,b,c,d,e}|... |
I have a question on the statement of the s-m-n Theorem and the implication
$$
\varphi_{f(x,y)} = \lambda z \varphi_x(\varphi_y(z))
$$
for some recursive function $f(x,y)$ cited in the above link. In what sense does this follows from the s-m-n theorem and in what sense does it gives anything new?
To be more specific.... |
In Chapter 5 of the Arora–Barak complexity theory textbook we are asked to prove the following statement:
If 3SAT is polynomial-time reducible to its complement then PH=NP.
How do I prove this statement?
|
I feel understanding why data flow is higher level than control flow is key to writing good code (and convincing others during code reviews). I find this repeatedly when arguing why my functional style programming with immutability is superior to their mutable state code which is more common and expected.
But I don't u... |
This is something I couldn't find - but I always found it interesting that the pumping lemma is just a lemma (especially since it has the same name for regular languages, context free languages, etc...)
What is it a lemma to?
|
The Schensted insertion algorithm has an $O(n^2)$ running time, for constructing such a standard Young's Tableaux.
But, since every permutation has a unique Young's tableau, there seems no reason as to why it cannot be done in $O(n \log n)$ time, which is the optimal time to identify a permutation.
Are there any known ... |
I am studying what coinduction is. In particular, I am reading that coinductive datatypes can be defined as elements of a final coalgebra for a
given polynomial endofunctor on $\tt Set$. I've seen that $A^w$, infinite streams over an alphabet $A$, is the final coalgebra of the functor $FX \rightarrow A \times X$, and s... |
There exists a very close and well-known relation between a vertex cover and an independent set
in a graph $G(V,E)$ ([1]): if $S$ is an independent set of $G$, then the set $V$ \ $S$ is a vertex cover of $G$. The same complementarity relation holds obviously for a maximum independent set $S$ and the set $C = V$ \ $S$ t... |
How would you write the following equations in $O,\Omega,\Theta$ notation?
$$
\begin{align*}
t(n) &= 4n^4 + 3n^5 + 3n^6 \\
g(n) &= 2n^6 + 5\log n \\
f(n) &= 50n^5
\end{align*}
$$
|
In the second phase of the paxos algorithm, the proposer issues an accept request with the number n and the value v it got from the acceptor, if the acceptor has already chosen a value previously. My questions is why the proposer is doing this? Because once a value if chosen it is permanent and cannot be changed, so in... |
Consider the language $L = \{0^p \mid p \text{ is a composite number}\}$.
I know that this is not a regular language. I have thought that to prove this language is not regular take the complement (prime numbers) which must be regular, but its complement has prime numbers and 0 and 1 occurrences of 0's.
Could anybody gi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.