instruction stringlengths 35 29.1k |
|---|
Let $\mathcal{L}$ be context free language over alphabet $\Sigma$. Define $\mathcal{G}$ as
$$\mathcal{G} = \{ v_2 v_4 \ldots v_{k} : v_1 v_2 v_3 v_4 \ldots v_{k-1} v_{k} \in \mathcal{L}, \text{ $k$ even} \} $$
I have seen a similar question (asked 5 years ago) but I am not sure how it can work.
Proposition
$\mathcal{L}... |
Speedback is the merging of speed-dating with feedback: a 2 min. 1-on-1 talk with all members of a group of people.
I'm in a team and I want to plan the ideal speedback setup: all team members have to give feedback to eachother.
I want to group people in a way that maximizes the concurrency of simultaneous pairs so we ... |
A program must construct and then use a set $S$ of 1000 integers.
/* part 1 */
S = empty
for i from 1 to 10000 {
...
x = ...
add x to S
}
/* part 2 */
for j from 1 to 100000 {
...
y = ....
test if y belongs to S
...
}
To represent S you have the choice between
a double-linked list
a balanced binary search tree... |
I am trying to compute the shortest binary string that contains all binary palindrome of length n as substring. For example, for n=3, 00010111 is such a shortest string. However, brutal force performs really bad even for n=6, n=7 etc. Is there any optimization like branch and bound I can do here. My current optimizatio... |
I have a network line that runs at a speed of 400kbps. How long do I have to download 6GB.
|
Can somebody explain the characteristics for a BFS Tree from a complete graph?. Thanks in advance. I would need the shape of the tree, explain me a little bit how the algorithm would work in this certain graph
|
I'm working with a list of objects ("Section") that contains a string value among other fields. The strings in all of the sections can be concatenated to form the complete text. I am, however, wanting to implement a method that searches for a specific (given) value and returns the Section object(s) it found the value i... |
Note: First posted this on Theoretical Computer Science Stack Exchange, but deleted it from there since it seems to be off-topic.
The Slepian-Wolf theorem states that sequences of outputs from two separate random variable sources A and B that have a joint probability distribution defined on them, if encoded with the fo... |
Let's define a "semi-rewritable" memory device as having the following properties:
The initial blank media is initialised with all zeroes.
When writing to the media, individual zeroes can be turned into ones.
Ones can not be turned back into zeroes.
Making a physical interpretation of this is easy. Consider for insta... |
What does [ we cannot both correct double errors and detect quadruple errors because this would require us to interpret a received codeword in two different ways] means? I understand how double error correction works but I cannot imagine quadruple error detection. Can anybody show me example why double error correctio... |
How can I prove that for a natural number K, a language that accepted by a Turing machine with K cells after the input word ends, belongs to R (which R is the set of languages that there is Turing machine that accept them while for each input the run is finite)?
|
If we remove subtyping (https://coq.inria.fr/distrib/current/refman/language/cic.html#subtyping-rules) from CIC we will lose some expressive power. But is that power necessary for a programming language?
If we demand programmer to write e.g. Type(1) and Type(2) to mean respectively type and kind, that won't be anything... |
I have been reading about Unification algorithm here https://en.wikipedia.org/wiki/Unification_(computer_science)#A_unification_algorithm
. And I wonder about the importance of occur check.
I know that without occur check an unsound inference may occur. But OTOH, does the algorithm always terminate without occur chec... |
I'm having a hard time understand the reasoning in the solution of 18.7 in Elements of programming interviews (EPI):
Let $s$ and $t$ be stings and $D$ a dictionary, i.e., a set of strings. Define $s$ to produce $t$ if there exists a sequence of strings from the dictionary $P = \langle s_0,s_1,\ldots,s_{n-1} \rangle$ s... |
this is a HW question, but its considered a bonus question so I'd appreciate a direction.
Definitions:
The actual question:
**Images taken from HW in TAU Complexity course by Amnon Ta-Shma.
My thoughts on the question:
My intuition is that C2 = NL, because NSPACE(O(f(n)) ⊆ DTIME(2^O(f(n))), so for a verifier for a l... |
I've been trying to find information on various program data virtual memory compression algorithms that are in the "WK" family of algorithms. So far, I've been successful with the "WKdm" compression algorithm ( see here and here ). The other algorithm that I'm interested in is a variation on the "WKdm" algorithm called... |
For the union of sets we use the union operator $\cup$ (or $\bigcup$). And for a concatenation (Kleene star) we also use the union operator. The operations are different, but why the same terminology and operator?
The following is my understanding of the union of sets versus the concatenation of sets (Kleene star). P... |
I've just started Algorithms at university. There's a task to write an algorithm for a Turing machine to solve quadratic equations. The task doesn't specify if it's x^2+bx+c or ax^2+bx+c. I've searched whole bunch of information over Russian and English Internet.
I did find articles, which say it's not possible because... |
Suppose, I wanted to verify the solution to $2$^$3$. Which is $8$.
The $powers~of~2$ have only one 1-bit at the start of the binary-string.
Verify Solution Efficently
n = 8
N = 3
IF only ONE 1-bit at start of binary-string:
IF total_0-bits == N:
if n is a power_of_2:
OUTPUT solution verified, 2^3 == 8
A solu... |
I am a bit confused about using the subset of the turning machine to prove the desirability of the turning machine.
If I have a Turing Machine M and we have already know M has a single halting state. If we already the machine takes a string was the input and reaches to the state q0, is it possible to prove that M is de... |
From where are the following probabilities?
We consider BSCε with ε = 0,1 and block code C = {c1, c2} with the code words c1 = 010 and c2 = 101. On the received word y we use the decoder D = {D1,D2} which decodes the word to the code word which has the lowest hamming distance to y. Determine D1 and D2 and the global er... |
How do i solve this? I am not sure where to start.
I am trying to define a Optimum solution which i can use to create a dynamic program. I am not sure what the characteristics of the optimum should be.
right now i am thinking,
at any instance of the problem, we know, the person will move right , left or up.( He can'... |
A question asks me to simplify the following boolean expression then use a multiplexer to implement it.
$$\overline{A}BC + \overline{A+B+C}+A\overline{B}\overline{C} + B\overline{C}$$
I evaluated the expression and got this result:
$$\overline{A}BC + \overline{C}$$
However, I stuck here because I cannot see the connect... |
I'm trying to found a way how to prove this language is not context free. Using pumping lemma I'm halfway done. Consider word $a^{n^2}b^n$. If you divide it into $uvwxy$ and have only $a$'s in $v$ and $x$, you clearly get out of language when you pump up. If you do the same with $b$'s and pump down, you get out of lang... |
I've been using Intel Pin tool to perform analysis of cache miss rates of a parallel application in multi-level caches, using one of the examples allcache.cpp, the results differentiate load and write misses, and the miss rates of each one vary significantly in L1, load miss rates of 20% vs store misses 90%.
Why can be... |
$k$-Path problem
The problem: Given a graph $G$ with $n$ vertices and $m$ edges, does there exist a path of length $k$ in the graph?
The trivial algorithm to solve is in $O^*(n^k)$ time using dynamic programming. ($^*$ hides the polynomial factor.)
Question: What is the fastest algorithm for the $k$-Path problem?
|
In a graph, I need to remove some vertices in order to get at least k-connected components. The no. of removed vertices should be low. Is there a heuristic that I could follow for this?
|
Is there an undecidable language A that is mapping reducible to its complement?
If it is possible, since A is an undecidable language, so A's complement must also be an undecidable language. But i don't know whether undecidable languages is closed under complement or not.
|
This is a question from the book Algorithms by Jeff Erickson.
Suppose A is a circular array. In this setting, a “contiguous subarray” can be either an interval A[i .. j] or a suffix followed by a prefix A[i .. n] · A[1 .. j]. Describe and analyze an algorithm that finds a contiguous subarray of A with the largest sum.... |
In this question in the first answer someone mentions a "special transduction hierarchy". I cannot find anywhere anything about it. Could someone point me to resources on this topic?
|
Give a CFG for the languague L = $ \{ 1^n +1^m = 1^{n+m}| n,m \in N_{0}\} $ , with the alphabet $\Sigma =\{1,+,=\}$.
I am currently trying to solve the given task, I thought a good way is to split the Languague into two more simple languagues, but I am keep failing. May some can help
|
Situation :
I started watching Algorithm Lectures from Stanford University (Corsera). I stuck on one video lecture(https://www.coursera.org/lecture/algorithms-divide-conquer/counting-minimum-cuts-96RUg).
In the lecture the professor is proving largest number of minimum cut in a graph.
My Problem :
To prove largest nu... |
I need to prove that a Turing machine that can move only $k$ steps on the tape after the last latter of the input word is not equal to a normal Turning machine.
My idea is that given a finite input with a finite alphabet the limited machine can write only a finite number of "outputs" on the tape while a normal Turing ... |
Let $G$ be a CFG in Chomsky normal form that contains $b$ variables. Show that if $G$
generates some string with a derivation having at least $2^b$ steps, then $L(G)$ is infinite.
This question is from Sipser(Introduction to the theory of computation)
|
P is RE, but is the complement of the class of languages decidable in polynomial time also recursively enumerable?
If both are RE then this makes P recursive?
|
Given the language:
$MIN_{TM}$= $\{ \langle M,k\rangle: there\ exists\ a\ TM\ D\ s.t.\ L(M)=L(D)\ and\ D\ has\ less\ than\ k\ states \}$
I need to prove if this language is in $R$ or $RE-R$ or $coRE-R$ or $\overline{RE\cup coRE}$.
I suspect this language is in $\overline{RE\cup coRE}$
but I can't prove it. (I Tried us... |
I'm kind of desperate at this point about this question.
A predicate-logic resolution derivation of a clause $C$ from a set of clauses $F$ is a
sequence of clauses $C_1,\dots,C_m$, with $C_m = C$ such that each $C_i$ is either a clause
of $F$ (possibly with the variables renamed) or follows by a resolution step from t... |
How strong have the oracles needed to be for these two classes to be proven equivalent with respect to them?
For instance: is $P^H$ = $NP^H$ (ie. is $P$ equipped with an oracle to solve the halting problem equivalent to $NP$ equipped with an oracle to solve the halting problem)?
From Theodore Baker, John Gill, and Robe... |
Terms:
A literal is a variable or its negation.
A clause is a set of literals.
An exact 3-in-1 clause is satisfied if an assignment of values to variables results in exactly 1 true literal and 2 false literals.
Exact 3-in-1 SAT is the problem, given a set of exact 3-in-1 clauses, is there as assignment of variables tha... |
Given a point in N-dimensional space, I'd like to be able to determine which face of an N-dimensional hypercube of edge length 1 that the point is closest to.
In the 2-dimensional case it's fairly trivial, you simply split the square along its diagonals:
if (x < y) then
if (x + y < 0) then
// Side 1
els... |
A is decidable if A$\le_m$A complement
Can i think that it is true because decidable is close under complement, so if A complement is decidable, so is A
|
Both are based on the principle of locality. Then why virtual memory uses table lookup while cache memory uses associative memory for block identification?
|
I have a 256 bit string (indistinguishable from random) which I wish to encode into a greater length string using an error correction code.
The result must also be indistinguishable from random. It should not be possible to detect the presence of error correction from the result.
Is it possible? And if so, how?
PS: Rel... |
Is there a factor in $M$ that is $>$ $1$, but $<$ $M$ that is NOT a factor of $N$?
False Result Example
$N$ = 8
$M$ = 16
1, 2, 4, 8, 16
There is no integer that is NOT a factor of $N$ that is $>$ $1$ but < $M$
True Result Example
$N$ = 2
$M$ = 26
1, 2, 13, 26
There is an integer $13$ which is NOT a factor of $N$ that i... |
Here is an excerpt from Andrew S. Tanenbaum, Computer Networks, 5th edition, Chapter 3 (The data link layer), Page 208:
The internal state is kept in six memory registers. Each time another bit is input, the values in the registers are shifted to the right. For example, if 111 is input and the initial state is all zer... |
Given an edge-weighted digraph $G = (V, E \subseteq V^2, w \in E \to \{0, 1\})$, is there an algorithm that returns TRUE if there is a cycle in this graph whose total weight is odd and FALSE otherwise, which runs faster than $O((|V| + |E|)(c + 1))$ (where $c$ is the number of simple cycles in the graph, which is of cou... |
We want implement a data structure that have the following methods: Init(A,k)- Gets an array A with n different values and initialize our data structure that so it will divide A into k equally sized sub-arrays (+-1), that each value in the i'th sub-array will be larger than any value in the (i-1)'th sub-array, and smal... |
Can you give some real world examples of what graphs algorithms people are actually using in applications?
Given a complicated graphs, say social networks, what properties/quantity people want to know about them?
—-
It would be great if you can give some references. Thanks.
|
In CLRS in the dynamic programming chapter, there is a theorem about the longest common subsequence prefix that states the following:
Theorem Let the $X=(x_1,x_2,\dots,x_m)$ and $Y=(y_1,y_2,\dots,y_n)$ be sequences, and let $Z =(z_1,z_2,\dots,z_k)$ be their LCS.
If $x_m = y_n$, then $z_k = x_m = y_n$ and $Z_{k-1}$ is... |
Never used this site before so not sure the best way to get help. However, I've been looking at many-one reductions in relations to sentences in logic.
Let TH(N) = {ϕ : ϕ is a first order sentence in the language of arithmetic and N |= ϕ} (Where N is the standard model of arithmetic - , x, <, +, 0, and the successor; ... |
Q: Prove that for any AVL tree that has $n$ nodes ($n\geq 1$)
and has a height of $h$ this property is true:
$n \geq F(h)$ where $F(h)$ is the $h$-th element in the Fibonacci sequence:
$F(0) =0, F(1)=1, F(n) = F(n-1) + F(n-2) ~~~~\forall n \geq 2$
This is my go:
We know it is an AVL tree so $h = \log_2{n}$
Thus we ... |
If I have a proof for a separation between two complexity classes (using no oracles) and I want to see if it relativizes, how do I go about doing so?
Especially in the case where there already exist proofs for these classes being equal with respect to one oracle and not equal with respect to another oracle. I'm wonderi... |
I am trying to write a mini parser for a simple language whose specification is as follows:
A search term is represented by. Both searchkey and searchvalue is a word formed by using alphanumeric characters.
<searchkey> <searchoperator> <search value>
: represents the exact match(similar to "=").
ex :
response:success
... |
I have problem in determine whether it is decidable or not, can somebody help me please
|
I'm trying to understand what is the minimum of the following function,
$$
f(\mu) = \frac{1}{n}\sum_{i=1}^n F\left(\frac{\pi(i)}{n}\right) (x_i - \mu )^2
$$
where $F$ is a step function that assign $1$ to any $t \in [0, \gamma]$ and $0$ in $(\gamma, 1]$, $\pi$ is a permutation that sorts the $i$s based on the ascending... |
I have a question to enhance a B-Tree and add a function called find(k) which gets a key - k and returns the index of it in the sorted keys of the tree, using $O(N)$ space complexity, and it needs to be in $O(t \cdot \log_t{n})$ time complexity. I also need to show that the function does not make the regular functions ... |
I have some difficulty proving the correctness of my solution to the following exercise. Let $G = (V,E)$ undirected connected graph, $w \colon E \to \mathbb{R}$ weight function. Let $T$ a MST (minimum spanning tree) of $G$. Now, we add a new edge $e'$ to $E$ with weight $w(e')$. Find an algorithm that updates $T$ so it... |
I'm pretty new to complexity theory and it seems like I stuck with this problem. We should find language $B$ such that it accepts any words rejected by $A$ but in that case, it seems that $B$ is a complement of $A$ and therefore $B$ belongs to $coNPC$. What is my mistake? Thank you!
|
Here is an excerpt from Andrew S. Tanenbaum, Computer Networks, 5th edition, Chapter 3 (The data link layer), Page 208:
My question is about this part.
[Convolutional codes have been popular in practice because it is easy to factor the uncertainty of a bit being a 0 or a 1 into the decoding.]
Why is it easy to use con... |
The Question is from DP tiling a 2xN tile with L shaped tiles and 2x1 tiles?
I want an explanation about this question or theory
|
I have tried to solve the following question:
van Emde Boas Bounds Show that $T(u) = T(\sqrt{u}) + O(1)$ has the solution $T(u) = O(\log\log u)$. Hint: consider the binary representation of $u$.
In CLRS (Introduction to Algorithms), they make use of the master method case 2. They let $m = \log_2u$ so we have $T(2^m) ... |
I have a Data Structure question where I need to manage an hotel, each room has a number between $1-n$
and it can be occupied or not.
Available Data structures: AVL* Trees, B-Trees, Arrays, Stacks, Queues, Binary Trees.
$O(n)$ Space complexity available.
Using AVL OR B-Tree is a must.
I have to support these func... |
I am not quite sure howto define SET-PARTITION as a language as in Sipser. Is it
$$
\left\{ \langle S,A,B\rangle \;\middle|\; (A,B) \text{ is partition of } S \text{ and } \sum_{n\in A} n = \sum_{n\in B} n \right\}
\quad \text{ or } \\
\left\{ \langle S\rangle \;\middle|\; \text{ there exists a partition } (A,B) \te... |
TAPL (page 549) proposes the following lemma in order to prove soundness of System F type system:
Substitution lemma for types:
$E, X, \Delta \vdash t: T \implies E, [X \mapsto S] \Delta \vdash [X \mapsto S]t: [X \mapsto S]T$
Proof of the T-TApp case:
$ E,X,\Delta \vdash t[A]: [Y \mapsto A]T $
and by rule T-TApp we ha... |
I have an undirected unweighted graph with a single component. I want to know if removing a given node will disconnect the graph. I know that I can remove the edges to the node and then use DFS to get the number of components, however this seems rather inefficient as I need to check all vertices in the graph for this. ... |
I was reading a Wikipedia page on Primitive Recursive Functions but there is a phrase for describing the simple for loops which I really don't understand. Can anyone explain this to me?
The Phrase:
An upper bound of the number of iterations of every loop can be determined before entering the loop
The Wikipedia page
|
Let's say I have a long text of 1M words and I would like to create a table of all the words ordered by the number of occurrences in the text.
One approach would be populating a dynamic array with each word and linear search them to count the occurrences in $O(n^2)$ then sort the array by occurrences in $O(n \log n)$. ... |
I am new in this field. In the book Foundations of Machine Learning by Mehryar Mohri, Afshi Rostamizadeh, and Ameet Talwalkar. The authors define the generalized error of a hypothesis as
$ R(h) = \Pr_{x \sim D}[h(x) \neq c(x)] = E_{x \sim D}[1_{h(x) \neq c(x)}]$
which is a number. However in the Definition 2.3 a conce... |
In classical optimization literature numerical derivation of functions is often mentioned to be a computationally expensive step. For example Quasi-Newton methods are presented as a method to avoid the computation of first and/or second derivatives when these are "too expensive" to compute.
What are the state of the a... |
In Lambda Calculus, the distinction between data and code doesn't seem to exist. Is there something fundamental about this, or purely Lambda Calculus's thing?
Some context: as a software developer, I got used to the concept of data so much that I never considered its true nature. I'd very much appreciate any references... |
I have a table like this:
PostId | Body | AuthorId
2 b F
2 b E
2 b C
4 d A
4 d E
8 h F
So what I want is to get all the rows that have mo... |
Suppose that $L$ is some language over the alphabet $\Sigma$. I was asked to show that the following languages is decidable:
$$L' = \{w \in \Sigma^* | \text{ there exists a word } w'\in L \text{ such that } |w'| \leq |w| \}$$
I.e., $w \in L'$ if $L$ has some word with length smaller than $|w|$.
The way I was thinking... |
I want to solve a linear programming problem in the $2n$ variables $x_1, \ldots, x_n$ and $y_1, \ldots, y_n$ where the cost is of the form $x_1/y_1 + \cdots + x_n/y_n$. Specifically, I want to solve
\begin{align*} & {\rm minimize}~ \sum_{i=1}^n x_i/y_i \\
&\mbox{ subject to } Ax + B y \leq c \\
& x>0, y>0,
\end{align... |
I observed that all the interval tree implementations I am able to come up with are required to utilize a stack (or a-like) to answer queries (report any overlapping interval with a key).
In general when visiting a node in an (common) interval tree you are required to visit multiple child nodes and check for results th... |
let's say $f(n) = O(g(n))$ and $l(n) = O(m(n))$
is it always true that $f(n) \cdot l(n) = O(g(n)) \cdot O(m(n))$ ?
|
If we have a Turing machine in a model with a tape that is infinite only to the right and assume at some point the head tries to move left from the leftmost position.
How should we define the behavior in such a case? Is a machine doing so for some input not a valid Turing machine? And if so, how can we make sure when w... |
I have a bunch of objects that I am not sure on how to represent in order to maximize memory occupancy and possibly avoiding large CPU overhead. The most natural way to see the whole data structure is as a tree. A picture is worth a thousand words
Each tree node contains an object that I simply represented as an integ... |
In general for the (two-party) set disjointness problem for inputs of length n, we know that the parties need to communicate $\Omega(n)$. Surprisingly, today I discovered (if I understood correctly) that this is not true for product distributions, i.e. when Alice's and Bob's inputs are chosen independently from arbitra... |
I've been looking at the following combination sum problem:
Given a set of candidate numbers (candidates) (without duplicates) and a target number
(target), find all unique combinations in candidates where the candidate numbers sums to
target.
The same repeated number may be chosen from candidates unlimited number o... |
Function Problem: Given $N$ find a $2$_$sum$ that uses at least $ONE$ prime.
Fact: Prime Gaps grow logarithmically on average. And, in worst case if memory serves correct it grows with a bounded constant.
Take notice that $count$ (defined below) will only equal to $s$, if the $AKS$ primality statement executes $s$ tim... |
Here is a picture from Andrew S. Tanenbaum, Computer Networks, 5th edition, Chapter 3 (The data link layer), Page 207(English Version)/Page 206(Japanese Version):
I want to verify whether my interpretation is correct or not. My interpretation is in the picture that has red arrows.
From the picture, I made a table to... |
I'm trying to implement a decision procedure for finding solutions to a scheduling problem; this involves computing the point in time which is under the most contention. Each task to be scheduled has a continuous compactly supported piecewise linear distribution of possible time allocations; the total contention at any... |
Given n numbers, design an algorithm to find the smallest $n^{\frac{2}{3}}$numbers, in sorted order. (Assume $n^{\frac{2}{3}}$ is an integer.)
I don't understand this question. Can I simply $x = n^{\frac{2}{3}}$ and fetch the $A[x]$?
|
I am designing a feature recommendation system and I have encountered an algorithmic problem and I am wondering if any of you know if there are known algorithms to solve this type of issue. In our recommendation system the content recommended can have in its metadata information at what range it should be put. To demon... |
I have a language:
$$ \{a^jb^k \mid j \neq k \text{ and } j \equiv k \pmod 3 \}$$
I want to prove that this language is regular. My first thought was to create a regular expression that accounts for all three of the cases of modulo 3 like such:
$$(aaa)^*(bbb)^* | a(aaa)^*b(bbb)^* | aa(aaa)^*bb(bbb)^*$$
However, this do... |
For double hashing, we have some constraints on $h'(k)$
(1) It should never evaluate to 0
(2) It should be relatively prime to m
How to show that all slots in an open addressing table will be included in a probe sequence.
|
Given a CFG in Chomsky Normal Form and a sentence s.
I want to count the number of different parsing trees that parses s.
assuming I know how to change the CYK algorithm so it would count the number of parsing trees, how can I determine if one tree X is different then tree Y? obviously it can be done in a naive way tha... |
I would like to know if someone can give me an example of how a prefix sum which contains 8 elements can be computed with just three processors.
Prefix sum
|
I'm currently working on a personal software project (as a hobby) and would like to know which kind of approach I should follow according to you.
My application scans some websites (like Amazon or eBay) to check items of a specific category and show them all together ordered, for instance, by price.
Currently I use Pyt... |
I am learning about block ciphers and while I understand the concept of Electronic Codeblock mode and cipher block chaining, I could not find any relevant practical examples online. Can someone provide a short example of a scenario where we convert plain text into cipher text using ecb and cbc (with initialization vect... |
I have the following function.
int fun(int n)
{
int count = 0;
for (int i = n; i > 0; i /= 2)
for (int j = 0; j < i; j++)
count += 1;
return count;
}
It has O(N) time complexity. I thought it's O(N LogN)(i.e. If we remove the inner loop we get)
for (int i = n; i > 0; i /= 2){
...
}
This is... |
Let
$T(n):=\begin{cases} \frac{2+\log n}{1+\text{log}n}t(\lfloor\frac{n}{2}\rfloor) + \log ((n!)^{\log n}) & \text{if }n>1 \\
1 & \text{if }n=1
\end{cases}$
I need to prove that $t(n) \in O(n²)$, thus $t(n) \leq c\cdot n²$
I asked the question here and I got really great help last time, the thing is after I was shown l... |
So what confuses me is that let's consider a function f. According to a definition from a text book it asserts that f is called recursive, if there is a Turing machine that computes it (for all input strings output of the machine should be equal to output of the function given the same input).
But in general, we say th... |
Assuming we have two programs $p_1$ and $p_2$ and two line numbers $n_1$ and $n_2$. Does $p_1$ reach $n_1$ in less computational steps than $p_2$ reaches $n_2$? By reduction from Halting, this is clearly not decidable, but I think it is semi decidable.
To do so, I would build an interpreter, that executes $p_1$ and $p_... |
I'm trying to understand splay tree performance compared to a standard balanced tree like AVL/red-black. In practice, I am pretty skeptical of the amortized bounds Tarjan and Sleator proves in their paper. Maybe because I am not that smart to actually understand these proofs, but I am still curious of one certain patho... |
For many years now, I have heard about "AI" and "neural networks" and all these buzzwords, and it is regularly claimed on Slashdot that this or that open source program is able to "do AI". But then I go to its website and I have no idea what I'm even looking at, let alone how to actually use it. I give up and forget ab... |
I am given two functions:
$ fl(fl(x+y)+z) $ and $ fl(x+fl(y+z)) $ and asked to derive their relative error. Then, given a set of conditions:
a) $ x < y < x $
b) $ x > 0, y < 0, z > 0 $
c) $ x < 0, y > 0, z < 0 $
determine which parenthesization has less relative error.
After some algebra I determined the following rela... |
A friend in industry proposed a problem to me. If you have a supply warehouse, you can treat each station with products as a node. Each node has a probability it will be visited by an employee working on an order. Is there a way to decide what product goes at each fixed node to minimize total travel time, by all employ... |
Ternary heap is like a binary tree, just every node can have up to $3$ sons and not $2$.
I try to bound the number of nodes in the heap, $n$, using the height of the heap $h$.
The solutions get to:
$$
3^h < n < 3^{h+1}
$$
Yet, I get to:
$$
\frac{3^h}{2} < n < \frac{3^{h+1}}{2}
$$
In short, what I do is:
$$
\sum_{i =... |
I want to solve Problem 4.10 from Randomness by Salil Vadhan. https://people.seas.harvard.edu/~salil/cs225/spring15/PS3.pdf
Consider a bipartite expander $G$ with left degree $D$ so that every subset $S$ of the left vertices with at most $K$ vertices has at least $(1-\epsilon)D|S|$ neighbors. Then $G$ also has the prop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.