instruction stringlengths 35 29.1k |
|---|
The Hardy-Ramanujan integers, A025487 - OEIS, are integers which when factorized, have their exponents for all the primes starting from 2, in decreasing (not strictly) order. The first few terms are:
$$
\begin{array}{lll}
1 & = & 1\\
2^1 & = & 2\\
2^2 & = & 4\\
2^1 \times 3^1 & = & 6\\
2^3 & = & 8\\
2^2 \ti... |
Given a machine that can compute the kth smallest item of an Array A in $O(\sqrt n)$ time. Find a recursive function that can sort A in linear time corresponding to $n$ which is the length of A.
First I tried to optimize some of the sorting algorithms I knew using this new property but the best I could do was $O(n^{3/2... |
I'm working on my research and I found that for directed graphs, there are many algorithms trying to solve shortest path problem(like Dijkstra, Bellman‐Ford algorithm), but few is to get all paths(including circles) in the result. Is it because the complexity is way too expensive? Thanks in advance for your help!
|
I am learning about NP problems and found this problem in my textbook that I was not sure how to answer, and was looking for some help on how to start the question.
Show the following language is in NP:
Not-Prime = {n ∈ N: n is not a prime number}
So far, I have created an efficient decider for the language with a cert... |
I'm trying to reason about the time complexity of removing a vertex from a graph represented as an adjacency list, which has $n$ vertices and $e$ edges. It is a directed graph, and the list associated to any particular vertex $v_i$ contains the vertices directly reachable from $v_i$ (i.e. the edges with origin $v_i$).
... |
Do they contain instructions for both CPUs or do the CPUs have the same instruction set?
Assuming they weren't compiled to an intermediate language (although even then, I think the intermediate language compiler has one version for both CPUs).
|
Let $V$ be a set of nodes, $c : V \times V \rightarrow \mathbb{R} \cup \{\infty\}$ be an edge cost function, and $h : V \times V \rightarrow \mathbb{R}$ be an admissible heuristic. Suppose we want to solve multiple independent least-cost path problems: from $a_1$ to $b_1$, from $a_2$ to $b_2$, and so on.
One approach i... |
I have an array $A$ of length $n$, containing integers between $0$ and $n-1$ inclusively. I would like to convert this to an array of frequencies $F$, that is, $F[i]$ should be the number of times $i$ appears in the array $A$. For example, $A=[1,3,1,1,0]$ would be mapped to $F=[1,3,0,1,0]$. There is an easy algorithm f... |
From my limited knowledge, they both are related to solving recurrence relation.
Solving recurrence relation using backward substitution
Solving recurrence relation using backtracking
Can the terms be used interchangeably?
In terms of algorithm, I found the following:
Backtracking is a general algorithm for finding ... |
In class, we discussed two problems: constrained subset-sum and unconstrained subset-sum. Let me define the question specifically and then I will mention what I am confused by.
Question 1: Given an unconstrained set of numbers, find whether or not a certain subset of them adds up to a target value.
Question 2: Given a... |
In Introduction to Algorithms by CLRS, it's said
For any quadratic function $f(n)=an^2+bn+c$, where $a$, $b$ and $c$ are constants and $a>0$, $f(n)=\Theta (n^2).$ Formally, to show the same thing, we take constants $c_1=a/4, c_2=7a/4$ and $n_0 = 2 \cdot max(|b|/a, \sqrt{|c|/a}).$ You may verify that $0\leq c_1n^2\leq ... |
Imagine a jackpot where users can bet as much as they want, and each bet increases their winning chance. Given a roll [0-100], how would you calculate the winner?
My solution and the pitfall
To determine winning users, you could check if a drawn roll [0-100] falls between a stack of users' winning probabilities.
Winnin... |
I have a matrix of zeros and ones, i.e., $\mathbf{X}=[x_{ij}]$ with $x_{ij}\in\{0,1\}$ for all $i=1,2,\ldots,m$ and $j=1,2,\ldots,n$. Associated with each row $i$ of the matrix $\mathbf{X}$ a set of the consecutive number of zeros $S_i$. Row $i$ has a value $v_i=\sum_{k\in S_i}\lfloor k/2\rfloor$.
I would like to modi... |
Example: Deleting from a B-Tree (not to be confused with binary tree) has Big-O complexity of $ O(\log_t n) $ (where $t \in \mathbb{N}$ is the order of the tree).
There was one true/false question on exam which asks if the Big-O complexity of the operation mentioned in the example above is $ O(\log_2 n) $.
I am beginne... |
A "universal source" in a directed graph is a vertex v for which out-deg(v)=n-1 and in-deg(v)=0.
I know that any DAG has at least one source but can it have more than one for a universal?
I know there can be none, and there can be one (binary tree for example, root is universal source) but can there be two?
|
Given:
:P rdfs:subClassOf :Q
Can you infer the following?:
:P rdf:type :Q
I do not think you can, but I am not fully sure. Whatever the answer is, could you briefly explain why?
(I am not sure if I should be asking this question here as there are no rdf or rdfs tags, but it is to do with my CompSci course :})
|
I think I figured out some things about $\Sigma^0_1$ and $\Pi^0_1$ in the arithmetical hierarchy, for sets of infinite sequences, and I'm hoping I can get confirmation that I'm right, or can understand the ways in which my thinking is incorrect.
What I think I have figured out is that every set of infinite sequences in... |
LeetCode Task Scheduler problem is the following:
Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be id... |
In Strassen's algorithm, why does padding the matrices with zeros, in order to multiply matrices that are not powers of 2, not affect the asymptopic complexity?
Hi, I was reading this question but I do not follow Yuval Filmus's answer completely.
He offers two ways of padding the matrix with zeroes, I am interested in ... |
We can find the maximum number of vertex disjoint paths in a directed graph using maximum flow algorithm keeping the node capacity and edge capacity to one. I could not find the reference paper for this technique. Please let me know the citation for this technique.
|
in one of my college assignments i came up with the following recursive function which I'm ask to solve:
$T(n) = T(\sqrt{n}) + T(n - \sqrt{n}) + \theta(n)$
I could not use master method on it and it is not an LHR either.
I assume this must have something to do with recursion tree but i cant figure the relation if so.
|
Define a universe $U$ containing $N$ elements. We are given $N$ sets, each of which is a set.
For example, $U = \{1, 2, 3, 4\}$ and
sets
\begin{align}
S_1 &= \{\{1\}, \{2, 4\}\}, \\
S_2 &= \{\{2\}, \{1, 3\}\}, \\
S_3 &= \{\{3\}, \{2, 4\}\}, \\
S_4 &= \{\{4\}, \{1, 3\}\}
\end{align}
The goal is to find the smallest subs... |
So, I was reading this article by Scott Aaronson on big numbers, and he mentioned that the Busy Beaver sequence increases faster than all sequences computable by Turing Machines. Faster than exponentials, faster than the Aaronson sequence, and faster than a recursive use of Knuth's up-arrow notation.
This led me to a t... |
This is the CSRankings output for logic and formal verification for the last 10 years, worldwide:
http://csrankings.org/#/index?log&world
For the International Conference on Computer Aided Verification (CAV), the results are more of a mixed bag, with 4 out of the top 10 highest impact universities (including the top sp... |
I have a sequential program that has a cost of
$(\sum_{n=1}^{N} Ti )$ Where Ti is the load time of the i-th element, so if consider $Tm = max({Ti}) $ i can approximate the sequential cost as $N*Tm$ that has a linear cost.
Let's suppose that i have c cores and i decide to parallelize this program, i can divide the load... |
I am given the following grammar:
$$S ::= aBS| abT |a$$ $$T::= d | dT$$$$B ::= da | ϵ | S$$
I need to decide whether $aBaabda$ can be produced in the given grammar.
I am unsure how the grammar can actually be read. For example, under what circumstances can you read $abT$ in $S$? Can you skip past $aBS$ and go to $abT$ ... |
In one of my college assignments, I came up with the following recursive function which I'm asked to solve:
$T(n) = T(n/3) + T(n/6) + n^{\sqrt{\log{n}}}$
I tried a change of the variable or the recursion tree but I couldn't figure out its solution. I'll be highly grateful if I get some hint about how I can go about thi... |
Let $A$ be a nondeterministic PDA (with empty stack acceptance). I am looking for a reference for a statement of the following form.
There exists a constant $c$, computable from $A$, such that:
if $w$ is accepted by $A$ then there is an accepting computation of $w$ on $A$ with stack height at most $c|w|$.
From this i... |
I am a programmer by hobby. I stumbled upon lambda calculus from Kevlin Henney's talk lambdas to the slaughter and I was sold! It was an interesting new way of thinking that's entirely different than the way most of us program. But if I want to push someone to learn lambda calculus, what concrete benefits can I state.
... |
I've come across the concepts of colored graphs (register allocation) and red-black trees. They both seem to have this notion of "coloring", but I've never seen them being connected conceptually.
Do they have anything to do with each other?
|
In Lamport's paper, Time, Clocks, and the ordering of Events in a Distributed System he says that the converse of the clock condition does not hold and if it did, we could expect concurrent events to occur at the same time. I am not sure how he arrives at this conclusion.
The Clock Condition is:
For any events a, b in ... |
For the floating-point number, we have the form
$\pm d_0.d_1d_2···d_{P-1}\times\beta^E$
$\pm$ --------------------------- sign
$d_0.d_1d_2···d_{p-1}$ --------- significant
$\beta$ ---------------------------- base (int)
$0\le d_i\lt \beta$ are the significant digits
$P$ ---------------------------- precision (int)
spe... |
In the generalised Josephus problem, n people stand in a circle and every kth person is eliminated until only one person is left. The last person left standing can be found using dynamic programming (like here).
I want to find out the number of times the circle will be traversed completely (ie the number of times the y... |
I have a question from Introduction to Algorithms by CLRS,
When we say "the running time is $O(n^2),$" we mean that there is a function $f(n)$ that is $O(n^2)$ such that for any values of $n$, no matter what particular input of size $n$ is chosen, the running time on the input is bounded from above by the value of $f(... |
Is there a Turing machine that halts iff P = NP? There are Turing machines that halt iff the Goldbach conjecture is false, or the Riemann hypothesis is false. How about the P vs. NP question? This is an expressiveness question, but I have not seen such a construction before.
Update: There are competitions to construct ... |
Lamport's paper: Time, Clocks, and the ordering of Events in a Distributed System
Anomalous behavior occurs because Lamport's logical clocks are not enough to guarantee that the total ordering of events derived from the unique partial ordering and a non-unique total ordering is not enough to guarantee that the ordering... |
In the book on algorithms by Cormen et.al, the problem 26-2 describes how to obtain a min-path cover for a DAG via max-flow. I have a question about the notation. First, let me quote the problem here:
A path cover of a directed graph $G = (V, E)$ is a set $P$ of vertex-disjoint paths such that every vertex in $V$ is i... |
For Dekker's algorithm given below (from Wikipedia), why is it that we wait for the turn to change, instead of waiting for p1 to set it's flag to false? It seems to me that it would be safer (or more efficient?) to wait for p1 to complete its exit routine before p0 sets its intent again. It seems like a livelock isn't ... |
Suppose we have a BPP algorithm $A$ s.t. its running time is random and is $O(n^2)$ in expectation. How do we create a new BPP algorithm $B$ to solve the same problem s.t. it has deterministic running time $O(n^2)$?
My effort:
Denote the running time of $A$ as $T$. Suppose $E(T)\leq T(n)=O(n^2)$.
Run $A$ at most $kT(n... |
I was having a discussion in another forum on this topic, and I couldn’t get a satisfactory answer. Originally, a statement was made that a redis data store couldn’t be considered a database because it’s not persisted to disk. I queried that, because I didn’t see why persistence is a required property of a database. I ... |
Galvin offers the following definitions of starvation:
Indefinite blocking, or starvation, a situation in which processes wait indefinitely within the semaphore.
A major problem with priority scheduling algorithms is indefinite block-ing, or starvation.A process that is ready to run but waiting for the CPU can be con... |
Let $G=(V,\Sigma,R,S)$ be the grammar given by the following rules:
\begin{align}
&S \to aS \mid B \\
&B \to abBc \mid \epsilon
\end{align}
Please provide a formal proof for the following claim:
$$
L(G) = \{ a^i (ab)^j c^j : i,j \in \mathbb{N} \}.
$$
|
The problem is that if an algorithm is $O(n^2)$ then it is also $O(n^3)$ and $O(n^4), O(n^n), \ldots$ and the phrase 'at most' does not make sense in this situation.
For this reason, I am not sure whether this statement is correct or not.
|
I wasn't sure how to word it correctly, hence the 'two way street' in the title. My question is:
The intersection of a context-free language and a regular language always results in a context free language, but does this also mean that if I have a language L1 and a regular language L2 that when L1 intersected with L2 i... |
What's the (asymptotic) solution of the following recurrence?
$$ T(n) = \frac{T(n-1) + T(n-3)} {T(n-2)}. $$
I tried to solve this with generating functions to find an accurate bound.
|
Imagine a 2D array of size n x m, where every column is a stack of positive values. I am trying to figure out a recursive pseudo code algorithm, where I have a number k, that is the maximum number of elements to pick from the array, which would find the indices in every column, that would maximise the sum of all the va... |
I am attempting a textbook question about asymptotic analysis. The question goes:
**
The number of operations executed by algorithms A and B is 8nlogn and
2n^2, respectively. Determine n0 such that A is better than B for n ≥ n0.
**
So far my approach has been to draw a log-log graph with both lines and find the meeting... |
From a stock of various computer accessories of different brands, the optimization problem requires deciding to keep or discard products. The decision should be made maintaining the following if-then condition: If one product of a certain brand is eliminated than all the products of that brand should be eliminated. So,... |
When researching how to optimize recursion into loops, I came upon (on Wikipedia) a general rule about this: Whenever a function is in form:
fn F(x):
if p(x):
return F(a(x))
else:
return b(x)
Then it may be written as:
fn F(x):
while p(x):
x = a(x)
return b(x)
However, I was wondering about how to... |
Hello Community,
Given an undirected graph G = (V,E) where E has 2 weight functions w1(e) --> {1,2,..9} and w2(e) --> {1,2...9} with given a source vertex s and destination vertex t. we can measure
the weight of this path with respect to w1 and with respect to w2 separately.The two weights
are denoted, respectively, by... |
i want to prove upper bound of the following recurrence $ T(n) =T(n-\sqrt{n})+1 $ is $ O(\sqrt{n})$.
|
By that, I don't mean what is needed to make an operating system. I know that OSes are built on top of kernels and whatnot. But what I mean is, it wasn't like anyone could just "program" the OS like any other software, right? Was an assembler first built? and then a C compiler on top of that? It's a chicken-egg problem... |
If $a_n = O(n^\alpha)$ and $b_n = o(n^\beta)$, prove that $a_nb_n = o(n^{(\alpha + \beta)})$ and $a_n+b_n = O(\max(n^\alpha, n^\beta))$.
For the part about $a_nb_n = o(n^{(\alpha + \beta)})$, I get that I am supposed to set it up so that
$|a_n| < Mn^\alpha$ for some positive real M for $n \geq n'$
$|b_n| < \epsilon n^\... |
I have the intuitition that, if we implement a (space-efficient) boolean first-order query solver, the amount of consumed memory should depend on the data size (i.e., it should not be constant).
However, in the very specific case of word-structures, I have read that regular expressions captures Monadic Second Order Log... |
An idle game (Cookie Clicker is a well-known example) is a game where you set up automatic resource production, and most of reasonable human play is then waiting as resources accumulate. Typical implementation is in the form of a "tick loop", where resources update say once per second, generally increasing.
But many ga... |
Consider keys $[ 1 \ldots n]$. We want to calculate probability that BST tree has height = $h$.
(We assume that distribution is uniform over all $C_{n}$ trees, where $C_n$ - n-th Catalan number).
First of all of course we can calculate it via $dp[i][j]$ - number of tree with height $i$ and $j$ vertices, then we divide ... |
I have found this answer that finds the center of an input string in nlog(n) complexity. I have tried to use it as a starting point to find an algorithm that finds the character(s) that separate the string in two parts (1/3 + 2/3) by changing some elements of the initial algorithm but I can't find the right modificatio... |
I'm working on an AI for a game where I'd like the game where each player has hundreds of moves to select from and so the game matrix has 10s of thousands of entries. The game is however zero sum. Given that I have 10s of thousands of entries I can't apply even an $O(n^2)$ algorithm or the result will take too long so ... |
I have a question about concept of monad used in Haskell programming
and category theory in math.
Recall in Haskell a monad consists of following components:
A type constructor that defines for each underlying type how the
corresponding monad type is to be obtained. The name of this type
constructor is often used syno... |
My intuition is that it is not generally possible, but I cannot think of a proof.
|
We take decreasing order of finishing times in $G^t$ (transpose of Graph G) to know whther the path exists in other direction as shown below. But why can'nt WE take increasing order of discovery time in $G^t$ as i feel it forces to take the path in other direction.
In below figure, in G we took path x and in $G^t$ we s... |
The question is about how to schedule the pairwise SIMD instruction to move the data in proper position.
Say I n SIMD registers, each SIMD register contains n elements.
If each column represent a SIMD register.
They forms a matrix:
\begin{pmatrix}
a_0 & a_1 & a_2 & a_3 \\
b_0 & b_1 & b_2 & b_3 \\
c_0 & c_1 & c_2 & c_3 ... |
I don't quite understand why the resolution algorithm completes in polynomial time for 2SAT but not 3SAT.
I'm looking at slide 42 of these slides for reference. It is clear that given two clauses of length at most 2, their resolvent has length at most 2. From $k$ propositional variables $x_1,\dots,x_k$, I see that ther... |
There is a compression function takes any sample $S$, for which there exists a function $h ∈ H$ with $L_S(h)$, and compresses it to a subset of $k$ sample points. Similarly, there is a decompression function $\rho$ which maps this compressed set back to a classifier $h'$ (not necessarily in $H$), such that $h'$ makes n... |
Topics
Pipelining: Basic concepts, instruction and arithmetic pipeline, data hazards, control
hazards, and structural hazards, techniques for handling hazards. Exception handling.
Pipeline optimization techniques. Compiler techniques for improving performance.
Hierarchical memory technology: Inclusion, Locality proper... |
On the german Wikipedia, I read that:
Der Bulgare Georgi Georgiev veröffentlichte 2003 eine Untersuchung, in
der er fleißige Biber daraufhin analysierte, ob sie anhalten würden
oder nicht.[2] Für {\displaystyle n=5}n = 5 entzogen sich lediglich
knapp über 40 fleißige Biber einem gesicherten Ergebnis, da sie
aufgrund b... |
I just started learning context free grammar and Pushdown Automata, I tried implementing this particular language via a PDA, despite being told this language is context sensitive.
How I attempted it is by popping every 2 'a' for 1 'b' and then popping 1 'b' for 2 'c'. I don't understand why is this wrong.
I feel I am b... |
Given function $\max\colon \{0, 1\}^{n} \times \{0, 1\}^{n} \rightarrow \{0, 1\}^{n}$ that returns the maximum of two binary $n$-vectors (interpreted as encoding numbers in the range $0,\ldots,2^n-1$), find a communication protocol for two parties having vectors $x$ and $y$ such that both parties will get the vector $\... |
This is a homework question, which I am able to do, except my teacher failed to mention what to do when the very first node has a 1 output. I've looked through online examples, and I'm sure this has a very simple answer, but I cannot figure out what the convention would be.
On the left, we have a Moore Machine. It's fi... |
I cannot figure out how to go about proving this statement in regular expression.
$$ L(R_1) \subseteq L(R_2) \subseteq L(R_3) \implies L(R_1^*+R_3)^* \subseteq L(R_2^*+R_3^*) $$
Here's what I have so far:
Since $L_1 \subseteq L_2 \implies L_1^* \subseteq L_2^*$ then $L(R_1) \subseteq L(R_2) \subseteq L(R_3) \implies ... |
I have a system of linear equations over a finite field $\mathbb F_p \cong \mathbb Z_p$, and I'm interested in the decision problem of whether there exists a solution where all of the variables $x_i$ are in the set $\{0, 1\} \subset \mathbb F$. In particular, I'm trying to determine whether this problem is $\mathcal{NP... |
There are many excellent step-by-step courses (free and paid) teaching you how a specific programming language works and how to use it to create applications. I've benefited a lot from these courses.
Now, I'm looking to go a layer deep and learn how to create a programming language from scratch (such as javascript or p... |
I have read Why is the dynamic programming algorithm of the knapsack problem not polynomial? and other related questions, so this is not a duplicate but just a related pair of questions to clear some doubts.
A question that frequently arises when discussing the complexity of the dynamic programming solution for the KS ... |
Is there a reduction from SUBSET-SUM to SAT?
Just general SAT, not 3-SAT.
Also the given multiset S only has positive integers.
SUBSET-SUM is defined as follows:
Input: a multiset S = { x1 , ... , xn } of positive integers and a positive integer t
Output:
accept if there exists a sub-multiset { y1, …, ym } ⊆ S such tha... |
Consider a graph $G$ with minimum degree $d$, we know through sets cover, it's possible to find the one dominating set $S$ that covers $G$ such that $$S\leq O(\log n)\frac{n}{d}
$$ with high probability, But is it possible to find a deterministic algorithm that achieves this bound in polynomial time?
|
I am trying to prove Theorem 6.2 on page 127 of the book Real-Time Systems by Jane W. S. Liu: http://www.cse.hcmut.edu.vn/~thai/books/2000%20_%20Liu-%20Real%20Time%20Systems.pdf
It is based on Early Deadline First(EDF) scheduling.
It says the proof is similar to the proof for Theorem 6.1 on page 124-126. However, I am ... |
I would to optimally assign objects into slots. There are 2 lists of 2 different elements that have to be assigned. An element from list 1 must be grouped with an element from list 2 into one slot.
The slots are linked (they have 1 or 2 adjacent slots).
There are some constraints on an exact number of slots that an ele... |
I want to visualize or calculate the compression bounds for hypothesis classes. I learnt how to figure out the VC dimension. Let's say I define two hypothesis class. For example:
$$
H_k = \{h ∈ (0,1)_X \mid |h^{−1}(1)| ≤ k\}
$$
and
$$
H_{decst} = \{h^i_a \mid a ∈ R, i ∈ (1,2)\}, \text{ where } h^i_a((x1,x2)) = 1[x_i ≤ ... |
I have a Context-Free Grammar (CFG) G which has a S for generating a language L. Now to produce a grammar for L*, another variable T (which is not present in the variable set of G) is taken and the grammar is produced in the following way:
G' = (V, A, T, P)
where,
G'.V = G.V U {T} ... |
What is the currently know fastest algorithms to convert each individual Java primitive and Number types to a Char Array/String number representation while considering their range, endianess and layout, sign and JVM specifics? The algorithm used for say byte may differ from int due to the range. char would be a special... |
I am looking for a family of pairwise independent hash functions $\mathcal{H} = \{h \mid h:[n]\rightarrow [m]\}$ that is easily computable.
As an example that doesn't seem to work, choose a prime $p > n$ and $a,b \in \{0,\dots, p-1\}$ independently and uniformly at random. Now let $h_{a,b}(x) = ax+b \bmod p \bmod m$. ... |
I am working on a personal project and I am having some conceptual level questions on arithmetic encoding.
Let's take a scenario where I have an array of sensors and the data collected is transmitted over the internet to Alice. Naturally to decrease transmission cost I would want to transmit data in compressed form. B... |
1-OR-3-SAT:
Input: 3-CNF formula $\varphi$
Question: whether there is an assignment $x$ such that in each clause there are one or three true literals.
I need to show that this problem is in $P$. I tried to construct a reduction from this problem to 2-SAT that is in $P$. What can I try here?
|
Is there a name for the relationship between two DAGs A,B where B is one of the transitive reductions of the transitive closure C of A?
For example the connectivity of nodes in both graphs would still be the same.
For example, we can connect all nodes in A to their minimal elements (smallest subsets) in A and remove al... |
I have the following the statement and I have to prove whether it is true or not.
Given a planar and Hamiltonian graph $\mathbb{G} = (V, E)$, show that we can partition $E = E_1 \cup E_2 = E$ so that $G_1 = (V, E_1)$ and $G_2 = (V, E_2)$ are both connected and outerplanar graphs.
I have tested the statement for few g... |
I need ’n’ random numbers that:
each one is bigger than ‘a’
their sum is smaller than ‘b’
How can I have that in Matlab?
|
I came across the algorithm question of detecting a cycle in a linked list, but the solution has to be constant space O(1).
I have looked through various proofs proving that:
If there is a cycle, at some point the tortoise and the hare will meet. I understand that at some point, both will be within the cycle, but how ... |
Wikipedia:
In computing, a compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language).
This implies that the compiler can also convert from a low-level language to a high-level language. But this has also got a spe... |
The well-known Church encoding of natural numbers can be generalized to use an arbitrary (covariant) functor F. The result is the type, call it C, defined by
data C = Cfix { run :: forall r. (F r -> r) -> r }
Here and below, for simplicity, we will assume that F is a fixed, already defined functor.
It is widely know... |
I am learning distributed systems ( although I am an Electrical engineer ) using the book distributed systems concepts and design. The author says that "A web server is often a client of a local file server that manages the files in which the web pages are stored." I cant understand in the first place what is the relat... |
I find very interesting the problem of existence of a machine $H$ which given as input any algorithm $P$ outputs whether $P$ halts or not. Alan Turing disproved the existence of such an $H$ machine in the following way:
"Assume $H$ exists. The input of $H$ is any algorithm $P$. The output of $H$ is $YES$ if $P$ halts a... |
In the context of variational autoencoders, we want to maximize the evidence lower bound and this is typically done using Stochastic Gradient Variational Bayes (SGVB). I was curious if there is any work out there or ways to determine the time complexity of SGVB.
|
An almost complete graph of n vertices is obtained from the removal of two edges of the complete graph
of n vertices. For which values of n are there almost complete graphs that admit Eulerian paths?
I'm having difficulty with this issue that I saw on an internet site, please help me.
|
I was wondering if there are any resources for a study/ranking of the most frequently used statements (by statements I mean assigning, invoking, instantiating etc, like in C#) in programming overall (or at least for one modern language).
This is for a private research project where I am writing my own bytecode assemble... |
It is known that there does not exists an oracle $H$ which given any pair $(M,I)$ where $M$ is a machine and $I$ is an input (possibly still a machine) to have $H(M(I)) = YES$ if $M(I)$ halts and $H(M(I)) = NO$ if $M(I)$ does not halt. This was proven by Turing. However, this can be shortly written as
$$ \not\exists H ... |
Let us consider the set of machines/algorithms with constant inputs (I would have preferred to say no inputs but I was told that every algorithm/machine has to have an input). We call $\mathcal{M}$ the set of all machines and define $C \in \mathcal{M}$ as follows:
$$ C(I) = \begin{cases} LOOP, \hspace{0.5cm} I \neq C\\... |
Prove that the following problem is undecidable using a reduction: Given a Turing machine $S$, does $S$ accept a word $w$ iff it accepts its reverse $w^R$?
There is a solution here, which I don't understand. We reduce from the halting problem. Given a Turing machine $M$ and a word $w$, we construct a Turing machine $... |
I am trying to apply the minimax algorithm to a game of Pokemon. This is a problem where the search tree is usually around 20 levels deep (number of turns) and each level has 9 or less branches (number of choices per turn).
What I am wondering is if this is a computationally feasible problem using parallel computing? M... |
How to show that for $\epsilon>0$, there exists a function $G:\{0,1\}^n->\{0,1\}^{2^{\epsilon n}}$ that is a $2^{\epsilon n}$-prg, without the condition that is is computable in $2^{O(n)}$ time. What I am trying to show is with high probability, if we take $\epsilon=1/10$, a random $G$ satisfies this condition. But in ... |
Suppose I want to find a number that is divisible by all 3 digit numbers (100-999), how do I write a code for that. I know only "1" can divide all 3 digit numbers, but I just want to know the logic.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.