instruction stringlengths 35 29.1k |
|---|
I'm studying Turing machines and I came across the following definitions:
NP is the set of problems that can be solved in polynomial time by a non-deterministic Turing machine.
and
Let t(n) be a function, where t(n) ≥ n. Then
every t(n) time non-deterministic single-tape Turing
machine has an equivalent 2^O(t(n)) ti... |
So I'm doing an AI course that is talking about time complexities of different tree search algorithms. On this slide it talks about the time complexity of the algorithm, and I'm confused as to why we ignore the $d$ multipliers in the series for the Big-O time complexity of the algorithm
My initial thought is that the ... |
I've been learning about data speed and width and the rate of the bus where information is transmitted between components. But I can't see or understand how fast is the transmission.
For example, in theory, I've read about how PCI operates at 133MBps and 266mbps and such, however, I can't seem to comprehend how fast th... |
Nondeterminstic RAM is like deterministic RAM with extra instruction “JMAYBE” which nondeterministically jump or continue when executed.
According to this paper:
An $O(T \log T)$ reduction from RAM computations to satisfiability
I guess that we can simulate nondeterministic RAM on nondeterministic TM , with only logari... |
Cloudflare famously uses a wall of lava lamps (https://en.wikipedia.org/wiki/Lavarand) to seed random number generators. But if you're going into the real world to seed your rng, why lava lamps? Why not roll 1000 D20's (say dice with 20 different colored faces) and call it a day? Is it just to look cool, or does the di... |
I understand that caches are the smallest and fastest memory that is integrated into the CPU. However, what I am confused about is the information that it holds. From what I know, the capabilities of cache are:
L1 cache - 64KB
L2 cache - 256KB
L3 cache - 4-12 MB
Ram - 4-74 GB
For example: If I open up a page on the bro... |
this is my First post,I apologize for my ignorance.
The question is:
Could a programmer (human or Ai) with all the computing power and infinite time create a simulation of a world with our same laws of physics without errors of any kind (both software and hardware errors)?
Clarification:1) the simulation shouldn't simu... |
I am currently stuck on this problem, it is from a very highly competitive contest and so it is highly difficult as well. Below is the statement:
There are 2 lists of integers with the same length.
Pick an integer from each list and
calculate the absolute value of their sum.
Return the minimum value for the value.
E... |
I found the following proof for the theorem that states "A light edge that crosses a cut that respects A is safe for A":
See: https://www2.hawaii.edu/~janst/311_f19/Notes/Topic-17.html where also all the necessary definitions are given.
What I do not understand in this proof is that we have here T that is a MST and th... |
I have a list of apps the user has installed, a history of all previously opened apps, and a series of characters that the user has input.
The user is shown a list of apps filtered taking into account the input, the specific function should be given, but the app the user wants must never be filtered out. The list of ap... |
I am trying to find the asymptotic run time complexity of the following function which will return a list of all permutations of nums.
def permute(nums):
res = []
dfs(nums, [], res)
return res
def dfs(nums, curr, res):
if not nums:
res.append(curr)
return... |
Arrays are generally presented as data structures with $\Theta(N)$ traversal and $\Theta(1)$ random element access. However, this seems inconsistent:
if array access is really $\Theta(1)$, this means that the size of an element index is bounded by a constant (e.g., int64), since it can be processed in $\Theta(1)$. How... |
I found the following proof concerning the correctness of a breadth-first traversal resulting in shortest path:
source: https://people.eecs.berkeley.edu/~daw/teaching/cs170-s03/Notes/lecture6.pdf
The key is that if we assume that we have a shorter path, we get a contradicition. I however do not fully understand with w... |
When solving numerical problems with circles, one often has to sample these at numerous points, not necessarily in a uniform way. Evaluating the $(\cos\theta,\sin\theta)$ values can represent a significant fraction of the cost, as they are transcendental functions.
We can get rid of these functions by rational substitu... |
I am wondering if it is known whether probabilistic Turing machines are more powerful than deterministic ones, in the sense that they can solve problems faster on average, or can solve problems that deterministic Turing machines cannot? That is, if a Turing machine can "flip coins", does this allow it to do things it ... |
I have a question regarding oracles.
If I have the complexity class $P^A$ (with $P \subseteq A$), what is it's relationship to the class $A$?
I mean it should be trivial that $A \subseteq P^A$ for all $A$.
But the other way is interesting.
As far as I know, there are some $A$ such that $P^A = A$ (e.g. $P$ or $BPP$) and... |
After several hours of frustration, I finally realized that the definition of two-three trees aren't standard (my lecture notes, this video, this other video, and Wikipedia) are different. My lecture notes, for example, maintains that keys are stored only in the leaves, while most other implementations store values in ... |
I was going through my Operating Systems book and in the disadvantages, they wrote that there is no user interaction between the user and computer in uni-programming and multi-programming systems and I asked why? to myself. There was no material or maybe I could not see or understand the idea that why there is no user ... |
i just want to know why the techniques we use to solve the 2-SAT problems cannot be used to solve the 3-SAT problem. So the techniques that i know that help solve 2-sat are the naive on where you just take one variable in the formula and give it a truth value and go on from there by deleting clauses where the variable ... |
Let $U$ be the universal Turing machine. Is there a Turing machine $T$ taking two inputs such that $\forall m \forall n \exists q \; T(m; n) = q \land U(q;0)=U(m;n)$?
It seems "obvious" that there is such a Turing machine, but if there is one, then the function $Q(n) = 1 + T(n;n)$ is not computable because it's the dia... |
An $\epsilon$-tester given an input and a property, is defined as follows:
If the input holds the property then the tester should accept with probability at least $\frac 2 3$. Otherwise if the input is more than $\epsilon$ far from holding the property then the tester should reject with probability at least $\frac 2 3$... |
I want to solve the problem of finding a shortest path on a directed weighted graph from a certain node to any of a specified set of destination nodes (preferably the closest one, but that's not that important). The standard (I believe) way to do this with the A* algorithm is to use a distance-to-closest-goal heuristic... |
Suppose I have the following structure definition in C:
struct node {
int value;
struct node *parent, *left, *right;
}
If I want to represent a specific node inside a tree, all I need is a pointer to such node, which allows me to traverse the tree using the parent and children's link.
Instead, if I have a simp... |
I'm reading "Program=Proof" by Samuel Mimram, and they use a notation for defining a formal language that I'm not familiar with.
Here is how "Program=Proof" defines a formal language of Propositional Logic:
Here is how "Program=Proof" defines a formal language of λ-calculus:
On the other hand, I'm more used to fo... |
If a function type is representable by exponentiation, does it follow that function application is represented by the right inverse, roots? It would seem that roots consume a function's input to return the output, and logarithms consume a function's output to return the input.
\begin{equation}
\sqrt[a] {b^a} = b
\end{e... |
I frequently have to calculate this kind of function
Those functions have constant values on arbitrary (predefined) intervals
I wonder if there is an algorithm for fast calculation of it, so I can learn about, and implement.
My solution is to store the intervals in an interval tree, so I can find the value of the func... |
Here's my problem: I have $N$ sets of integers $S_i$ where $|S_i| = n_i \forall i \in [1,N]$ each with non-uniform weights $W_i = \{w_{i,1}, ..., w_{i,n_i}\}$ such that $\sum_{j}{w_{i,j}} = 1$. I want to sample $m$ unique lists $P_{k \in [1,m]} = (p_{k,1}, ...,p_{k,i}, ...,p_{k,N})$ of $N$ integers (including duplicate... |
There are 8 (very similiar) languages I'd like to discuss here:
CNF SAT
DNF SAT
CNF No-SAT (Existence of a false assignment)
DNF No-SAT
CNF Tautology
DNF Tautology
CNF Contradiction
DNF Contradiction
While CNF SAT is known to be $NPC$, my claim is that some of these languages are actually in $P$. The easiest one is D... |
I need to compute the cheapest path between two pixels in an image. The travel cost is specified by the user, and may depend on the distance between the pixels (including pixel values, which is treated as an elevation), as well as other factors. I tried Dijkstra, by scaling coordinates by a factor so I can have more se... |
I have written a regex engine and it can match whole strings to a pattern without a problem, i.e.:
match(E, w)
and it returns true or false if the string $w$ matches the expression $E$ or not. But I was thinking of how to extend the matching function to find substrings in a string that match an expression. The obvious ... |
I have a set of positive integer numbers $A = \{a_1,...,a_N\}$ and I need to find a partition of $A$ into two sets, such that the sum of their products is minimal, i.e.,
$$
\min_{X,Y : X \cup Y = A} \prod_{x \in X} x + \prod_{y \in Y} y.
$$
Is there any good approximation/heuristic algorithm to solve this problem?
|
Similar to one of the questions that was posted here roughly 4 years ago. Lets say we have two wooden planks each 1m long. And we want to have 4 pieces, 60cm 50cm 30cm and 20cm. What kind of bottom-up implementation can be done to calculate the least waste
Formally we have N wooden planks each $L_1$,…,$L_N$ cm long. An... |
I'm trying to use the Pumping Lemma to prove that $L = \{ wsw \mid w \in \{0,1\}^*,\ s \in \{2\}^*\text{ and } |w| = 2\cdot|s| \}$ is not a CFL.
|
Why there is a sigma in the denominator of equation (8) in the picture? suppose we have n tasks and m fog nodes.
|
Let $L_1 \subseteq \{0,1\}^{*}$ be a regular language, and let $L_2 \subseteq \{0,1\}^{*}$ be some (not necessarily regular) language.
Show that
$$L=\left\{ \sigma_{1}\#\sigma_{2}\dots\#\sigma_{n}\mid\substack{n\geq1\\
\sigma_{i}\in\left\{ 0,1\right\} \\
\exists w_{1},\dots w_{n-1}\in L_{2}\quad\sigma_{1}w_{1}\sigma_{2... |
I've come across this problem when working on a personal project of mine. I need an efficient algorithm of counting the number of overlaps between all pair combinations of n sets.
Example:
Set a = [adam, ben, charlie, ...]
Set b = [adam, john, kenny, ...]
Set c = [adam, john, eve, ...]
...
Set n
The algorithm will then... |
Source: Hanoi student competition of unknown year (Kì thi học sinh giỏi thành phố)
Additional conditions:
N is a positive integer in range [1, 2^64 - 1]
K is a positive integer in range [3, 10]
Example:
N = 106, K = 3 => res = 105 (3 * 5 * 7)
|
I am preparing for my CS exam and found this question in a collection of old exams:
Find a DFA and NFA with Σ = {o,p,q} that checks if the substrings op and pq are present in the string.
I thought, I understood this topic, but I can not find a regular expression for this problem.
My initial thought was {o ∪ p ∪ q ∪ o... |
I am looking at a specific variant of subgraph isomorphism:
Instance A graph $G = (V_G, E_G)$ and a target graph $H = (V_H, E_H)$ such that $|V_G| = |V_H|$.
Question Is there a subgraph $G' = (V'_G, E'_G)$ of $G$ that is isomorphic to $H$?
(Note the condition $|V_G| = |V_H|$ above, which implies $|V_G| = |V'_G| = |V_... |
This naïve sampling algorithm I am talking about is fairly simple: create a set for storing chosen items first, randomly select an item from the array, and examminate if it is in the set. If it isn't, add it to the set, otherwise we will skip and reselect. This process will be repeated until required amount of samples ... |
I want to show that the language
$$L= \left\{ \left\langle M\right\rangle \mid\substack{\text{M is a TM and there exists a poly TM $M'$ such that}\\
\text{if M halts on input $w$, $M'$ halts on $w$ and answers the same}
}
\right\} $$
is not decideable, using Rice's theorem.
I have a hard time understanding why this pr... |
I want to create a table that has the following results:
id | field1 | field2
1 | 1 | 1
2 | 2 | 2
3 | 3 | 3
4 | 4 | 4
5 | 1 | 2
6 | 2 | 3
7 | 3 | 4
8 | 4 | 1
9 | 1 | 3
10 | 2 | 4
11 | 3 | 1
12 | 4 | 2
13 | 1 ... |
Given n points in a 2d plane I.E $ (x_1,y_1),(x_2,y_2)\dots (x_n,y_n) $.
Create a data structure that holds the points and a method closer$(a,b)$ that returns all the points in the data structure that are closer to $(0,0) $ than to $(a,b) $.
The preprocessing and creation of the data structure have no complexity limit ... |
Question: Suppose $a, b$ are sequences with $n=|a|,m=|b|$ lengths, and $ed(a,b)$ denotes edit distance between them. what is the complexity of computing $ed(a[i:j],b)$ for all values $1\le i<j\le n$?
$O(n m)$ to compute $ed(a[1:i],b)$s
Let $A$ denote the DP table with $(n+1)\times (m+1)$ size. For all $i\in\{1,\dots,n\... |
Busy Beaver is an uncomputable function that grows quicker than any computable function. That means there exist functions f such that for all computable functions g: g in O(f). There is an upper bound on the order of computable functions.
The question is whether or not there is a computable function like that. So, is t... |
Busy Beaver is an uncomputable function that grows quicker than any computable function. That means there exist functions f such that for all computable functions g: g in O(f). There is an upper bound on the order of computable functions.
Here I asked whether there is a computable function bounding all computable funct... |
I was reading about about NP-intermediate problems on Wikipedia and saw the IMSAT problem mentioned over there.
There is no Wikipedia page for that problem and they only cite this paper.
In the paper they define the MSAT problem as:
Recall that the satisfiability problem (SAT) is to decide whether a set of
proposition... |
Are there monotonically increasing uncomputable functions f that are bounded by computable functions?
$$ \exists f,g: f\ uncomputable\ \land f\ monotonically\ increasing\ \land\ g\ computable\ \land\ f \in O(g) $$
|
Assume I have a programming language $L$ with well-defined semantics.
Showing Turing-completeness is straightforward: if I write a program using $L$ simulating the universal TM, I'm done.
What I'm concerned about is another direction. How do we show that a program in $L$ can be simulated by TM when $L$ supports things ... |
Can someone provide a list of references of papers, books, etc. presenting results on the time and space complexity of the problem of isolating the roots of a univariate polynomial $P(t)$ with integer coefficients (e.g. $P(t) \in \mathbb{Z}[t]$)?
Papers like this one offer informal arguments to provide upper bounds for... |
Problem: Let $ A $ be an array of $ n $ different elements from an ordered interval.
Let $ I(A) $ be the number of inversions in array $A$, meaning, the number of pairs of indexes $ 0 \leq i < j <n $ for which it occurs that $ A[i] > A[j] $. Notice that $ 0 \leq I(A) \leq
{n \choose{} 2} $ and that $ I(A) = 0 $ if ... |
I know that parity checking is testing for accurate data transmission between nodes in a communication network.
When does this parity checking happen on a computer? Does it happen every time data is transmitted internally in a computer?
Do all computers use parity checking?
|
int[] arr = new int[10];
Would this count as a single primitive operation under the RAM model or would it be 10 operations as we are allocating 10 memory locations to this variable "arr"?
This also ties in to my other question: if there existed an array of size 1 and we were to increase the size by 1 and copy over the... |
I'm wondering if anyone can help me with this. Say I have a DAG, I understand that it has no directed cycles, but it can have loops ( "diamonds" ).
My question is, is there a known way to convert such graph to a directed tree that has no loops. I know of the junction tree/ clique tree way, but this results in an undire... |
Let $ G(V, E, w)$ be a graph with no negative weights.
Describe an algorithm that returns the shortest cycle containing a node $ v $.
I came across this algorithm https://courses.engr.illinois.edu/cs374/sp2017/labs/solutions/lab10-sol.pdf
I can't convince myself it is true, because $ d(s,v)+w(s,v)$ might not be indepen... |
Is it true that a given problem is strictly NP-complete iff it's only decidable by universal Turing Machines? Similarly, a problem is in P iff there exists a non-universal Turing machine which solves it? Is it possible to come up with an NP-complete problem which could be solved by a non-universal TM?
|
i need help proving the following :
$$\sum_{k=1}^{n}\frac{1}{(3k-1)(3k+2)}=\frac{n}{6n+4}$$ for every integer n larger or equal to 1
Can you help? Thanks
|
I am targeting a simple dictionary-coder compression algorithm that uses a static dictionary (code in an existing program, but I can supply my own dictionary). How can I write a compressor for such an algorithm? The first thought I had was to rank all strings in the data by the size reduction from making them dictionar... |
Let a,b,c be arbitrary nodes in the subtrees $\alpha$, $\beta$, $\gamma$, respectively, in the left tree of Figure 13.2 (that is given below). How do the depths of a,b,c change when a left rotation is performed on node x in the figure?
Here is a snapshot of the original question.
My answer:
Since in the left tree, l... |
Does adding an $ \epsilon $-transition to a deterministic finite automata preserve the regularity of the language?
Don't we have one chance to scan the word? If we choose one direction, don't we miss the other one?
|
I have a graph G (G=(V,E)), where each edge has a non negative weight to it.
My problem is to find a subset S (it doesn't have to exist) of nodes such the sum of all the weights of the edges that start in S and end in V\S is lower than a given positive k.
My approach was to pick a random node in the graph, run a bfs on... |
I would like to experiment with displaying the output of an analog to digital converter on computer. Samples of the ADC output would determine the intensity of one pixel.
The input to the ADC is an array of XY wires, with each XY junction representing a pixel.
I can work with such circuitry, but I don't know where to s... |
I know that XOR-SAT can be solved in polynomial time using arithmetic in $F_2$ and Gaussian elimination.
I have a set of formula that is of the form
$$
G_i := \oplus_{j=0}^{i} \left ( a_j \land b_{i-j} \right )
$$
where $a_k, b_k$ are the variables and $\oplus$ denotes XOR and $\land$ denotes logical AND.
Is there any ... |
There are clusters of LAN connected computer systems. California cluster has cached "viral video" at first stage, when client near California requested the file firstly.
Now, another client near California requests "viral video".
The benefit here is that there would be no network latency and subsequently no network tr... |
kth smallest in one sorted array, just take O(1) time
kth smallest in two sorted arrays, there is a binary search algorithm, take O(log k) time
kth smaleest in n sorted arrays, we can use min-heap, takes O(k log n). However, when n = 1 or 2, it's essential brute-force linear scan which takes O(k).
Is there more optimiz... |
I have a multidimensional time series on which I would like to perform some clustering. I have been looking at DTW as a distance metric since my series are not always aligned in time. The problem I have is that while the one to many mapping of points along two series allows for their alignment in the event they are the... |
On $n$ parallel rails there are $n$ trains with constant speeds $v_1, ..., v_n$. At time $0$ the trains are at positions $k_1, ..., k_n$. Find an $O(n \log n)$ algorithm that determines which trains are in the lead at least once.
My current approach is to create a 2-dimensional coordinate system, time as x-axis and pos... |
This might be an irritating, naive question, but please bear with me. If an algorithm/code solves the string matching problem for a binary string, does not it imply that the algo/code actually solves the string matching problem in general?
Because, in hardware everything is converted to 0 and 1 and then calculation is... |
I am looking at the state flipping algorithm, an algorithm that tries to find a stable configuration in a Hopfield network.
The algorithm simply flips the state of unsatisfied nodes as long as the the network has not reached a stable configuration.
Please check page 673, chapter "An Application of Local Search to Hopfi... |
DNA is made of a string of different proteins.There are 4 different proteins which make up the human DNA.We can represent each protein as a 2 bit sequence of '0' and '1'.However wouldnt it be much better if we had 4 available logic states('0','1','2','3') for every type of protein?How would a algebra having as a base 4... |
Let there be $N$ sequences containing at least one set each. Each set has at least one element each.
Select exactly one set from each sequence. The selection within each sequence is mutually exclusive. Once any given selection is formed, calculate a superset as the union of all selected sets. The cardinality of the sup... |
For the definition of domination [Wikipedia],
a node $d$ of a control-flow graph dominates a node $n$ if every path from the entry node to $n$ must go through $d$.
If node $n$ is not reachable from the entry node, why are all other nodes not dominators for it? There is no path from entry node that goes to $n$, and th... |
I'm trying to solve the recurrence equation from CLRS ed 2.
$$
T(n) = 2T(\sqrt{n}) + 1
$$
The question says the solution should be asymptotically tight, but at first I didn't read it and solved it with a substitution of variables and tried to find a big-O solution.
$$
m = lg(n)
\\
S(m) = T(2^m)
\\
S(m) = 2S(m/2)+1
$$
A... |
It is said that PBFT (or Practical Byzantine Fault Tolerance consensus) is Byzantine fault tolerant (unlike Paxos or Raft that are only Crash fault tolerant.)
Based on this answer : LINK , in PBFT "a new leader is elected only if there is a suspicion that the old leader is no longer available."
If it is the case, why i... |
The question is the conversion from an animation to a video file with the following attributes:
Frame rate:24 fps
Resolution:320*240 pixels
Color depth:24 bits
Length of video: 60s
Bit rate: 500kbps
I calculated that the file size should be 24603202403=316MB (frame rate* resolution* colordepth / 3 * resolution), but th... |
For example, in finite-state machines (FSM), the main difference between a deterministic (DFA) and a non-deterministic machine (NFA) is that there are possibly more branches or outputs for each input, depending on how a machine the machine was built. In terms of computational power, are these two the same?
|
While porting an algorithm, I having a bit of a problem with finding an efficient algorithm for finding a linear combination of piecewise functions. The procedure is described in the Table 3 of the appendix of the SIRUS algorithm by Bénard et al. (https://proceedings.mlr.press/v130/benard21a.html).
The problem is defin... |
Let's say we have the following Recurrence Relation:
$$ T(n) = \begin{cases}
1 & n=1 \\
3T(\frac{n}{3}) + \Theta(n) & \text{otherwise}
\end{cases}
$$
I've been taught I can study its complexity by giving into input a power of 3 to calculate its height and consequently its total cost.
I'd like a proof of... |
Prove that there does not exist a universal Turing machine that takes a pair $\langle M, w\rangle$ as input, where M is a Turing machine and w is a string, and that always halts, accepts if $M$ accepts $w$, and rejects if $M$ reject w.
I think assuming the existence of such a machine H could allow one to decide the h... |
I have two sets of points in space with known positions:
$$A = \{r_1^{\alpha}, r_2^{\alpha}, ..., r_n^{\alpha}\} \quad n \in \mathbb{N}, \quad r_i^{\alpha} \in \mathbb{R^3}$$
$$B = \{r_1^{\beta}, r_2^{\beta}, ..., r_m^{\beta}\} \quad m \in \mathbb{N}, \quad r_i^{\beta} \in \mathbb{R^3}$$
$$m < n$$
I want to pick $a$ po... |
Let's say I visit an IP Checker online, is the OP shown there my IP or the IP of my router? I can't seem to find a conclusive authoritative answer online.
|
I am a CS student. I am looking at some questions my professor made and I got stuck in this one.
"Which one of the following inclusions between complexity classes is coherent with the current knowledge? (even if not proved, yet)". The possible answers are:
P $\subseteq$ EXP (Which I know it is true)
NP $\subseteq$ E... |
I am having two algorithms, of which the second is a refinement of the first. However, I am having trouble to show that the seemingly better algorithm runs at least as fast as the first algorithm.
The algorithms aim to be FPT with respect to the parameter $k$ for the following problem:
Circle-Cover:
Input: A set of po... |
Consider two finite languages, $L_A$ and $L_B$, potentially over different alphabets. Now since these languages are finite, there exist minimal acyclic deterministic finite-state automata to decide them. We are given that $L_A$ is bigger than $L_B$: $|L_A| > |L_B|$.
We are given a function $f$ which maps elements of $L... |
As far as I understand it, computation today is largely based on Turing machines implemented in von Neuman architectures. Are there other realizations of Turing machines in use or being considered theoretically that would be advantageous in any way? Or even non-Turing ones that may somehow scale? It seems to me that co... |
In a recent presentation, I've seen the difficulty of NP-complete/NP-hard problems attributed to the fact that they often have "long range" correlations, or at least they can be interpreted that way when the problem is mapped onto a physical system. For instance, in 3SAT a variable appearing in a given clause may also ... |
I was wondering if, given an algorithm for 3SAT, testing it on Barthel instances would provide a general idea of how well it empirically performs on hard instances. What would other hard instances look like that would perhaps be more telling?
Defining Barthel instances: I have only seen them namedropped so I thought th... |
I have the following idea:
Suppose a device D performing a set of tasks T1-Tn.
Each task Ti has 3 properties: time of execution(E), amount of memory needed(M) and priority(P).
Ti: <E=1s, M=45kB, P=0>.
Each of these properties is given a grade value ranging from 0-10 based on the property's value.
e.g.,: Ti grades: <5, ... |
These are three paragraphs from the book CLRS:
The rod-cutting problem is the following. Given a rod of length $n$
inches and a table of prices $p_i$ for $i = 1, 2, ..., n$, determine
the maximum revenue $r_n$ obtainable by cutting up the rod and selling
the pieces.
In the rod-cutting problem, an optimal solution for ... |
Suppose I have a directed acyclic graph $G$. I want to find a graph $H$ containing the nodes of $G$ (and potentially more) which minimizes the number of edges in the graph, without changing the reachability between the nodes of $G$. That is, if a path from $s$ to $t$ exists in $G$ a path from $s$ to $t$ must also exist... |
Skiena's Algorithm Design Manual, 3rd Ed p.71 gives the time complexity of a dynamic array according to the number of movements, $M$, as:
$$
M = n + \sum_{i=1}^{lg(n)} 2^{i-1} = 1 +2+ 4+\ldots+\frac{n}{2} + n \stackrel{?}{=} \sum_{i=0}^{lg(n)} \frac{n}{2^i}
$$
For the life of me, I can't figure out how he's getting fro... |
For a given recursive language $L$, let $TL$ be the language of turing machines that accept $L$, for some encoding of turing machines. $TL$ is countably infinite. Does there exist a set $S = \{S_1,S_2,\cdots\}$ of computable functions that take as input a turing machine and output a turing machine, such that if $T$ is ... |
What is the best way of implementing the following function,
$$f(x) = \frac{x}{\max(1, |x|)},$$
where $x$ is complex, using a Cartesian representation of $x$ with IEEE 754 floating point representations (i.e., float or double) for the real and imaginary parts such that $|f(x)| \leq 1$ for all possible values of $x$?
Yv... |
This is an exam question I couldn't solve
If I store 2^59 as double, that would give me
1 * 2^58. Is the answer just 2? I.e. next value is 2^60??
|
Suppose that we have a problem in $NP \cap coNP$, if we find an algorithm that solves the problem in P, does this mean that $NP=P$?
|
In some works, such as the recent maxflow paper, there is reference to an "almost-linear" complexity, which typically refers to a complexity of $O(n^{1+o(1)})$.
This is similar to the notion of quaslinear complexity, which refers to a complexity of $O(n \log^{O(1)} n)$.
It is clear that quasilinear complexity is a subs... |
Consider a long-lived TCP session with an end-to-end bandwidth of 1Gbps. The session starts with a sequence number of 1234. The minimum time (in seconds, rounded to the closet integer) before this sequence number can be used again is _________.
The solution given for above question was : [(2^32)*8]/(10^9) = 34.3597 sec... |
Question: we have the following language:
$$A = \{\langle M \rangle :| L( M)| < \infty \text{ and } M\text{ is a Turing machine}\}$$
where $\langle M\rangle$ is the encoding of $M$ and $L(M)$ is the language accepted by $M$.
Prove $A$ is a decidable language or not.
My idea was to use reduction on this but I can't f... |
I am currently trying to learn some more about complexity classes. I found this exercise but I cannot find a proper solution to this exercise:
I know this is in NP, can I also say it is in P? If that's the case how could I formally prove it?
|
In coding theory we typically consider the situation where we have a
channel that connects a sender and receiver. The messages flowing from
the sender to the receiver are corrupted by an error source ES. We
have an error detection and correction mechanism that is typically
fine-tuned to ES. Wikipedia (https://en.wikipe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.