instruction stringlengths 35 29.1k |
|---|
While computers are very reliable, they can also do errors because of noise. I would like to have an idea of the rough order of magnitude of error per floating point operation in a computer, in a typical environment (in a typical office, like not deep underground for instance), with a reference to a good paper.
I am no... |
There is a famous equivalence between types of grammars and automatons. However when discussing recursive functions, we only consider equivalence of General Recursive functions with Turing machines. However primitive recursive functions are considered separately and I don't know any equivalence of that computational mo... |
Given any connected undirected graph, we can convert it into a tree by "detaching" some edges from one of their endpoints. For example, consider the graph with the following edges:
$$
(1) ~~~~~~~~~~~~~ a-b, b-c, c-a, c-d, d-e
$$
We can detach the edge b-c from the vertex c (adding a new vertex c' of degree 1), and get ... |
I'm curious about whether there exists a hierarchical or layered concept within the broad categories of algorithms, where they can be further divided into subcategories based on their characteristics and problem-solving approaches. Is there a clear association or inheritance relationship between different algorithm cat... |
In the untyped lambda calculus (with variables, abstraction and application as the only constructors), we have a "pair" construct, given by $(a, b) = \lambda x, x a b$. The projections are then $\pi_i = \lambda x_1 x_2, x_i$ and there is a product function $ \langle f, g \rangle = \lambda x, (f x, g x)$.
TL; DR; Do we ... |
Instance: An undirected graph $G$ and a positive integer $k$
Question: Does $G$ contain a vertex cover of size $\leq k$ or a clique of size $\geq k$?
Obviously, this problem is solved by polynomial reduction, but is it from Clique or Vertex Cover? And how?
I've tried to reduce from both problems, but seem to get stuck.... |
I have the following Regular Expression (classic Computer Science definition of Regular Expression, not PCRE or modern computer language RegEx):
{(ΣΣ)*00(ΣΣ)*}Σ ∪ Σ{(ΣΣ)*00(ΣΣ)*}
It "feels" like it should be reducible to me but I can't see how. Is it reducible or am I just asking for trouble trying? The term in {} just... |
Can every problem with a greedy solution be solved using dynamic programming? Why or why not?
I'm not completely sure how to formally reason about this, my understanding about the structure of problems with a greedy/dp solution is quite handwavy.
I found conflicting answers for this online, so I'm not sure what to trus... |
I am looking to implement a general base conversion algorithm. I was wondering if there already exists such a thing, since I couldn't find one.
Currently, I am able to go from int to int, but I also want support for negative, rational and, in principle, all complex numbers as both bases and the value to convert.
Does t... |
Is there a text that goes through some explicit examples of converting tree automata to tree regular expressions?
I'm working through Comon's "Tree Automata Techniques and Applications", and I'm trying to work out some examples of regular expressions from tree automata. I'm convinced that the procedure given in the tex... |
I heard hypervisors try to make this undetectable to the client .A good hypervisor will have zero latency and be transparent.
Can a program detect whether it's running in a virtual machine by trying to create a VM underneath it (and failing)?
Or is a VM more like a subroutine call, where the context is passed to it and... |
Linear programming is the very common problem of computing
$$\min_{Ax\leq b}c^\top x,$$
where $A\in\mathbb{R}^{n\times m}$, $b\in\mathbb{R}^n$, and $c\in\mathbb{R}^m$. This is an optimization problem, but it can be turned into a decision problem with an additional parameter $s$, by asking: Does a vector $x$ exist such ... |
I'm looking for algorithms for stacking gage blocks.
For those unaware, gage blocks are used in machine shops for measuring with high precision and come in sets something like this...
Mitutoyo's 56 block metric set
1 0.5mm block
9 blocks from 1.001mm to 1.009mm in steps of 0.001mm
9 blocks from 1.01mm to 1.09... |
I believe that I have a misunderstanding in the P=NP problem while I was thinking of how can it be proved in a non-constructive manner.
We know that we can build an infinitely large text file with solutions for each of the solutions for every possible combination for that problem (in a similar manner of building a dete... |
I encountered this problem here: https://theory.stanford.edu/~trevisan/cs172/ps05.pdf
Consider the language
$$PFTM := \{\langle M \rangle : \text{$M$ is a Turing machine and $L(M)$ is prefix free} \}$$
where L(M) is the set of strings accepted by M.
(a) Prove that PFTM is undecidable.
(b) Is PFTM recognizable?
(c) Is t... |
Consider two binary strings of two alphabets of length $l$, to find the hamming distance each corresponding bit needs to be compared. The runtime will be $O(l)$ or simply $l$ many comparisons are required. The goal is to reduce the number of comparisons with error less than $t$.
My idea is to divide input strings into... |
I am going through the fourth edition of Algorithms by Sedgewick & Wayne. On page 190 there is a discussion of lower bounds for the 2-sum problem, where the 2-sum problem is stated as: find all pairs of integers in an input array that sum to zero where each integer is distinct.
In the lower bounds discussion it says: C... |
I can't import datasets on RStudio on either my computer or Posit Cloud. I think it's because my laptop is too old to install packages necessary to import datasets on it, and not sure for Posit Cloud. Someone else imported it for me in a lab so I know it's possible, but when I try myself it seems like it only let me im... |
Can someone explain for me how to build a XOR gate using 5 NOR gates? The thing I'm looking for is a proof similar to this:
$A^B\ =\ (!A)B\ +\ A(!B)$
$=\ !!((!A)B)\ +\ !!(A(!B))$
$=\ !(!!A\ +\ !B)\ +\ !(!A\ +\ !!B)$
$=\ !(A\ +\ !B)\ +\ !(!A\ +\ B)$
$=\ !((A\ +\ !B)(!A\ +\ B))$
$=\ !(A(!A)\ +\ AB\ +\ (!A)(!B)\ +\ B(!B))... |
I've started learning automata recently, and am struggling to figure out how to find a finite automaton that satisfies the following:
Given DFA $A_1 = (Q, \Sigma, \delta, q_0, F)$, find a finite automaton $A_2$ such that $$L(A_2) = \{s \mid (s\cdot s) \in L(A_1)\}$$
Where $s\cdot s$ is the concatenation of $s$ onto its... |
Given a composite number $P$ and two integers $x$ and $y$ such that: $x^2 = y^2 \pmod P$ we can factor $P$ using factor = $\mathrm{gcd}(P, x-y)$ or $\mathrm{gcd}(P, x+y)$.
Now are there a similar relation where we are given multiple $(x_i, y_i)$ pairs such that:
$(x_i^2 - y_i^2) \pmod P = r_i$ (where $r_i \neq 0$)
We ... |
Given two regular languages L1 and L2 over alphabet Σ, we define the operator RQ(L1, L2) = {w | there exists a word v in L2 such that wv is in L1}. The task is to determine the smallest language class among Regular, LL, CFG, and DCFG that certainly contains RQ(L1, L2).
So, I started with the most restricted of the lang... |
The question mathematically has been answered here: https://math.stackexchange.com/questions/4886084/guaranteed-graph-labyrinth-solving-sequence/4887473#4887473
To summarize, in an unknown strongly connected, directed graph in which all vertices have out-degree 2 (so from a vertex, we either go $a$ or $b$), we are plac... |
Let A and B be NP-complete problems. Suppose I have established reductions from problem A to problem B and vice versa. Now, considering a specific instance (or set of instances) of problem A that can be solved efficiently in polynomial time, does this imply that the instances reduced to problem B can also be solved in ... |
I am going through various virtualization concepts, and am trying to understand their benefits.
Based on what I have read, Amazon EC2 is an example of server/hardware virtualization, and it helps us achieve high utlization of hardware. In the absence of hypervisor, we would have low utlization rate of hardware. Also, s... |
Given :
Profit[n]: a n item array indicating the profit on a day (may be positive or negative)
Cost[n]: a n item array indicating the cost of holding a stock on a day (always positive)
Task:
Find $1 \leq i \leq j \leq n$ that maximize Total Profit divided by $\sqrt{\text{Total Cost}}$ from day $i$ to day $j$.
Exten... |
When extending the simply typed $\lambda$-calculus with products, we extend $\beta$-reduction with the rules $\pi_i \langle M_1, M_2 \rangle \to_\beta M_i$, which makes sense (cf. Sørensen, Urzyczyn, Lectures on the Curry-Howard Isomorphism, p. 87). But in some cases we also have the equation $\langle \pi_1 M, \pi_2 M ... |
Are there ASICs (application-specific integrated circuits) optimized to solve the SAT problem, such as by the DPLL algorithm?
|
Let's say I have a group of people that meets every week. I would like to assign them to groups of 4. How can I assign these people such that, week after week, collectively, every group consists largely of "strangers"?
For example, John, Paul, George, and Ringo being assigned together means John has been grouped with P... |
Anyone please answer the question:
Prove that in a complete binary tree with $L$ levels, the total number of nodes $N \leq 2^{(L+1)} - 1$.
|
Or take Russel's paradox. Either the barber does or doesn't shave himself -- that's all there is. How you describe it is an artificial construct.
Godel's theorem is like dividing by zero and declaring arithmetic incomplete.
It seems to me that all it means is, humans can construct artificial incomplete formal systems. ... |
Executable: Sat prog
Definition: The exit status of "Sat prog" is 1 iff there exists an instance
prog arg which runs in P-time and the exit status is 1.
From the definition, Sat computes a ℕℙ problem.
If ℕℙ=ℙ, then, an executable f exists that "Sat f" should run in P-time:
// C source of executable f
#include <... |
I am reading the book "Automata, Formal Languages, and Automata" written by Dr. Emre Sermutlu and in page 153, it is stated that the following grammars are not in Chomsky Normal Definition (CNF):
$G_1$ : $S\rightarrow TT\mid a$ $T\rightarrow ST \mid b$
$G_2$ : $S \rightarrow TT \mid a$ $T \rightarrow a \mid b \mi... |
For what example would Maekawa's algorithm allow out of timestamp order access to the critical section. It is mentioned that ordering is not satisfied in Maekawa's algorithm. But in what scenario would this be true?
From my understanding, we will always have the queue at each process that follows FIFO and will ensure t... |
I'm trying to prove that $f \in \mathcal{O}(\lfloor f \rfloor)$ given that $\forall m \in \mathbb{N}, f(m) \geq 1$
Here's what I've thought of so far,
we can set C = 10 and k = 1 and somehow prove that this would eventually dominate the function?
Not sure how I can prove this without a concrete function defined for $f$... |
I trying to learn about virtual memory at the moment and one of the explanations I've look at has a diagram like below. You can see that 32 bit virtual addresses are used so the virtual address space is 2^32 addresses and the computer must have RAM of a capacity 4GiB or smaller. You can see the physical addresses in th... |
Given $A$ a countable set of numbers and $\min$ the function returning the minimum of a set (if exists).
Is $\min(A)$ computable? My first try is thinking $A$ as infinite list $A = [a_0, a_1, a_2,...]$ such that $a_i < a_j$ for every $i < j$ and write a simple while program $P$ such that $P(A) = a_0$. Is that correct? ... |
I try to wrap my head around the Floyd-Warshall algorithm, and I don't understand why the shortest path is guaranteed to be found since we check only the alternative connections up to one hop deep.
For example, let's consider the following graph with four vertices:
A B C D
A 0 5 -1 x
B x x x x
C x x... |
How can we design a data structure (storing ordered data) that gives the best worst-case lookup complexity possible, under the constraint that we require the worst-case insertion complexity to be at most $\mathcal O(\log\log n)$? (For clarity, I am considering equality == and inequality < tests to be the only "costly" ... |
I am currently reading nearest Neighbour search problem where given a set of points, preprocess it so that given a query point one can find a nearest neighbor.
There are two phases, preprocessing phase and query phase.
I am trying to design a parallel algorithm for nearest neighbor search problem, but I am confused bet... |
L1, L2, and L are not finite. We're given that L and L2 are regular. However, L1 ∩ L2 is empty, since L2 is the complement of L1.
Is L1 regular under the property that regular languages are closed under union? I have been going back and forth about this for a while and any help would be appreciated. Thank you!
|
Given a sparse undirected graph $G=(V,E)$ where $|E|=O(|V|)$, a one-hop path between a pair of vertices $(u,v)$ is a path in $G$ connecting $(u,v)$ where there is exactly one intermediate vertex between the vertices i.e. $u \leftrightarrow t \leftrightarrow v$ where $t$ is the intermediate vertex, $(u,t,v)$ are distinc... |
How would someone create a Turing machine that computes ceil(sqrt(n))?
n = 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
=> f(n) = 1, 2, 2, 2, 3, 3, 3, 3, 3 ....
And that I want the input tape to have n 1's in it to represent the number
i.e. 5 would be #11111
How would the turning machine with transition table for this be created?
|
I'm struggling in finding a correct way to approach this, I'm aware that this problem is solvable using dynamic programming, and this problem somehow relates to the "max non-contiguous subarray" problem, yet I cannot make the connection.
Given an array of integers, $A=(a_1,\ldots , a_n)$ for which $\sum_{i=1}^{n}a_i<0$... |
Given a set of points, and a convex d-dimensional polytope represented only by a set of its' vertices, I need to query in order to check for each point if it's inside the polytope. I know of the O(log(n)) solution in 2D (like the answer to https://stackoverflow.com/questions/36135978/show-that-given-a-query-point-q-it-... |
How do I show the correctness proof of Dijkstra’s algorithm for negative edge weight
$\textbf{indicating the point in the proof where it breaks or does not hold}?$
I tried proving it like this, but i know that i'm not correct.
Set $d[s] = 0$ (where $s$ is our source).
Set $d[v] = \infty$ for all $v \ne s$,$v \in V$.
R... |
Given a permutation on the array of integers 1 through n, I want to find the index of the permutation in a list of all possible permutations of those integers, sorted in lexicographic order.
For example, given the permutation {1, 3, 2} with n=3, I want the program to return 1, because
the array has 6 permutations ({{1,... |
Merge sort and FFT are both divide and conquer algorithms that split the input in two repeatedly. While merge sort can be applied to any $n$, the FFT algorithm given in CLRS (section 30.2, third edition) only applies when $n$ is a power of $2$. How come we can forge ahead with any $n$ for merge sort, but not quite for ... |
If javascript's object is just associative array, what makes it non-primitive as they have labeled it? It is certainly already built in. Its not like I'm creating my own concrete implementation of associative array before i begin coding on it.
According to wiki's quote:
Primitive data types or built-in data types are ... |
From tutorials point:
Subtract micro-operation are using minus operator we create 1's complement and add 1 to the register which obtains subtracted, i.e R1 - R2 is similar to R3 → R1 + R2' + 1
$$
R2'= 0011
$$
$$
R3=R1+R2'+1
\\\Rightarrow R3 = 1011+0011+1
\\\Rightarrow R3 = 1111
$$
This is obviously not the right ans... |
I have a group with n members. These are distributed members. It is basically a group chat. A new member is added to the group and the existing members are informed about this.
Now I want the new member to obtain some information about the group that the existing members all know. This could be the name of the group.
T... |
Let $L=\{<M> | M$ is a TM, $L(M)\ne \emptyset$ and $\forall x\in L(M), \overline{x} \notin L(M) \}$
While $\overline{x}$ is the bit flip of $x$.
I want to show a mapping reduction to prove that this language is either in R / RE / coRE or none of them.
My intuition is that this language does not belong to any of the cla... |
I need a perfect hash function that maps 2 integers into one integer twice the size (i.e. $(Int64, Int64) \rightarrow Int128$).
The function preserves sum of leading zero bits:
$(0, 0) \rightarrow 0$ - good mapping, as each argument has $64$ leading zeros and that transformed into $128$ leading zeros of the output
$(0... |
There are a ton of resources on the web devoted to proving some esoteric language is Turing complete by simulating arbitrary turing machines. I have an esoteric language I want to prove is complete, but I'm pretty sure the easier way to do it would be to prove that you can express any untyped lambda calculus term in i... |
In mathematics and philosophy there are some unsolvable problems like Russell's paradox or the liar's paradox that are usually said to be undecidable... There are also other "impossibilities" such as finding positive integers to divide a prime number other than the number itself and 1.
However, could we use some kind o... |
There's a famous classical circuit complexity result by Shannon that says almost all languages require exponential circuits [[1]], proven by comparing the number of distinct circuits of $n$ variables versus the number of boolean functions of $n$ variables.
Similarly, there's a result that "almost all" languages are und... |
Is there any dynamic way of solving this problem? I would thank any help, I know the Subset sum Problem, but for solving it dynamically u have to create a matrix but here is not posible as the colums may not to be integers.
|
The Brouwer fixpoint theorem states that any continuous mapping $f$, from a convex, compact set to itself will contain a fixpoint.
The Brouwer algorithm finds these (approximate) fixpoints. But how is a continuous function inputted into this algorithm?
Is it as a black box? If so, would changing this to a discrete set ... |
During diverse double-compiling, they say that it is proof that either all the compilers are subverted, or none of them, but they cannot say which one is subverted. In my studies of the technique I tried to draw a figure how we can compile three rounds and after that, knowing exactly which one is compromised. But do yo... |
As the title hints, I'm looking for a dynamic programming/greedy approach to find the diameter of a N-ary tree graph.
This must be done in linear time.
The problem states that the graph is undirected when passed to the algorithm, yet there is a way to transform it into a rooted directed tree graph in linear time.
All t... |
Upfront, I'm not a computer science or mathematics graduate. I am a dabbler/recreational programmer and I find some problem/solution scenarios intellectually stimulating to attempt. Sometimes (frequently, actually), this lack of formal training limits my ability to formulate a good solution to a problem. I can pretty... |
Good Evening,
So I am trying to solve this exercise which is a paticular case of maximum flow algorithm. Here the graph must have all even edges and 1 odd edge and it must have a maximum flow that is odd.
Now I need to prove the following two points which state that the single odd edge must have a flow $>1$ and/or that... |
Most of the proofs of such properties that I see involve informally using algorithms or invoking Turing machines as needed. But it's not clear to me how are we using set operations on instances of decision problems? Moreover, it is not intuitively clear to me how we can use different instances of decision problems for ... |
I am trying to build the logic behind a divide and conquer algorithm that will find the majority element in a matrix $A$ with $n$ elements in $\mathcal{O}(nlogn)$ time.
I thought that in order to make it divide and conquer, I'd need to split the array in two parts. By definition the majority element would be the one th... |
I faced the following claim on wikiepdia about interval graphs (https://en.wikipedia.org/wiki/Interval_graph):
The pathwidth of an interval graph is one less than the size of its maximum clique.
I have thought a while about it, but don't come up with any argument/proof why the pathwidth is bounded by the size of the ... |
In computational creativity, how do you measure how creative something is?
Let's say you have to compare a piece of music written by Bach and then compare it to Chopin, how would you evaluate how creative they are and compare them both by giving them scores? How would the model work, are there existing models, and how ... |
I've wondered this for some years now. As near as I can figure, if individual files were tagged with each of the components in a typical path (e.g. each of ['C:', 'Program Files', 'Mathematica'], or ['var', 'log'], etc.), you would be able to uniquely refer to files if desired, while gaining a lot of flexibility in org... |
For amortized analysis (aggregate method), dynamic table insertion cost can be divided into:
if no expansion, then cost = 1
if we expand the table, then cost = i (if i-1 is an exact power of 2)
then the total cost is
I don't understand how to get 2n from the part that I circle below
|
Suppose you have a dependency graph of "packages" registered in the ecosystem of a given programming language. We can model each package as a tuple (name, version) where name is the package name (like Plots) and version is a semantic version number (like 1.2.3).
Each package has a set of dependencies, which may include... |
I'm preparing for my exam and I got stuck on the following problem:
The gardening problem:
We have access to a set of different types of seeds and a number of plant pots.For each plant pot, there is a limit to how many seeds can be planted in that particular pot.
In addition, there are seeds that cannot be planted in ... |
Recently I came across with a question about Von Newman architecture (which is usually used) and whether the following statement is true or not?
In Von Neumann architecture data are stored in disk and instructions are stored in state registers. Answer to this is false. Why?
Now my questions is: -> What are state regist... |
The last times i was searching a lot to understanding Big O notation or in general asymptotic notations concepts because i didnt hear about it or them before starting studying in computer science.
(In computer science) Since to get asymptotic notation of a function we must get firstly the function itself. And because... |
I want to write a regular grammar that follows the C language. I almost wrote the grammar, but was not able to resolve how to define a variable.
Def: A variable can be any combination of characters, but it should not be an existing keyword.
I tried writing something like this but not sure how to write it:
<Var> -> {a-z... |
Consider any computational problem in which the inputs are integers.
As far as I understand, if the problem has a strongly-polynomial time algorithm, it means that the algorithm uses a polynomial number of arithmetic operations in integers, and polynomial space.
Now, suppose we want to solve the same problem but the in... |
I know that the optimization version of NP-complete problems belong in NPO. What about co-NP-complete problems? Is there a co-NPO class, or is it just NPO?
I've also never seen the name for the complexity class of optimization problems whose decision version is NExpTime-complete. Is it called NExpTimeO? Is there a co-N... |
Given an integer $n$ and a tree set $S$, I would like to find the approximate median $x$ of the integer set $T := \{i \in \mathbb N : i < n \wedge i \notin S\}$. There are no constraints to the distribution of $S$, so it is not possible to assume that $S$ is uniformly distributed over $(0,n)$. This problem can be found... |
Prove the following problem is NP-Complete:
The problem gave a directed graph G, and several subsets of vertices of such graph are being specified as T1,T2,....Tn, and the subsects could intersect, does there exist a path in G where it doesn't contain any cycle and for every subsect Ti, the path consist of exactly 3 ve... |
The problem is to count number of unique binary search trees with keys $a_1,a_2,...,a_n$, given that some of the keys are not unique. For example, $a$ could be 2, 1, 1, 4, 3, 4.
We could try an approach that is similar to the case when keys are unique - choose some root node from $a$ and then solve two subproblems - on... |
I found following statements in 6.4.16. Arbitrary-rank polymorphism of ghc document.
GHC uses an algorithm proposed by Odersky and Laufer (“Putting type annotations to work”, POPL‘96) to get a decidable algorithm by requiring some help from the programmer. We do not yet have a formal specification of “some help”
I kn... |
Let $P$ be a non-empty, finite set of points in $\mathbb{R}^n$. I want to know if there is an algorithm that can find the most optimal set of $n$-spheres $S$ that follows these properties:
Each $n$-sphere in $S$ overlaps with at least one of the other $n$-spheres in $S$,
For all $p \in P$, there exists $s \in S$ with ... |
With the decision problem Clique, I mean:
Given a graph $G$, does $G$ admit a clique of size at least $k$?
From Wikipedia, one finds that the brute force algorithm of testing all possible subsets of size $k$ results in a complexity of $O(n^kk^2)$. On the other hand, Wikipedia also states that a maximum size clique can ... |
In Introduction to Algorithms, when talking about prefix code for Huffman encoding, it says that:
Although we won’t prove it here, a prefix code can always achieve the optimal data compression among any character code...
How can we prove such a claim? My first thought was in the direction of representing the encoded ... |
I have a problem set about NP Completeness proofs and I'm struggling to approach this problem:
An organizer would like to arrange all the participants in a
circle where neighboring two students must have taken the same class last semester.
How to prove that this is an NP complete problem?
Any hints/tip would be very he... |
Given a Directed Graph G, and some subsets of vertices T1,T2,..Tn(These subset can intersect) , is there a path in this graph such that it is acyclic and contains exactly 3 vertices from each Ti. I'm not sure , but I have an intuition that this is a problem that can be reduced from hamiltonian path problem , just can't... |
Is there any instance where a problem $A$ can be reduced to a problem $B$ where $B$ is easier to solve than $A$?
I've been learning about NP-Hardness recently and seems that the answer is no. Whenever we show $ A \leq_p B$ its also said that $B$ must therefore be at least as hard as $A$. If this is always the case then... |
Let $E_1, E_2, \ldots, E_n$ be boolean-valued expressions, each with an associated evaluation cost and probability of returning true. For simplicity, assume these probabilities are independent, so that $\mathbb{P}(E_i \cap E_j) = \mathbb{P}(E_i) \, \mathbb{P}(E_j)$ for $i \ne j$.
Suppose we want to compute the express... |
Assuming I have two relations:
Supplier [ID (PK), Name, City, Country] and
Item [ID (PK), Name, Department, Price, Stock, Supplier_ID (FK)]
What would be the easiest way to determine the following statement both in domain and tuple relational calculus: "List the IDs and names of those suppliers, who have delivered at l... |
I am stuck on an exercise that ask the approximation factor of a MAX-SAT approximated algorithm generalized from a MAX-3SAT algorithm
MAX-3SAT:
set every variable with a random value ($0$ or $1$ each with probability $\frac12$)
check how many clauses are satisfied
This algorithm has a $\frac78$-approximation factor... |
From abstract data types in wiki, I'm reading about two types: collection and container. Can anyone supply a better detailed difference between the difference between the two?
https://en.wikipedia.org/wiki/Container_(abstract_data_type)
https://en.wikipedia.org/wiki/Collection_(abstract_data_type)
As I understand...
Co... |
Given something similar to this.
Where you have blocks (the squares) and entries (the circles). Each block has a rating (the number inside the blocks) and is connected to other blocks. This topology is always fixed and cannot change, the ratings neither.
An entry can ask for a given rating. The algorithm then should t... |
About the language $L=\{<M>|M~is~a~TM~and~L(M)=\{0^n1^n|n\ge0\}\}$
I want to determine if it is in RE / coRE or neither.
I think that I found a mapping reduction from $\overline{A_{TM}}$ to $L$, where
$\overline{A_{TM}}=\{<M,w>|M~is~a~TM~and~M~does~not~accept~w\}$:
Define $f(<M>)=<N_{M,w}>$ as follows:
$N_{M,w}=$ "On i... |
Is it always the case that ${n \choose k} = O(n^k)$?
If it is, then why does the comment from Clement C. in this post state it is only the case when $k$ is a constant?
If it is not, then why is the asymptotic time complexity of the brute force algorithm for the Clique decision problem denoted as ${n \choose k}O(k^2)O(1... |
I'm trying to come up with a performant layout algorithm for web resources timings. For now, all that is relevant is that resource timings include a startTime timestamp and a duration and the goal of this layout algorithm is to assign each resource timing to a lane. A resource timing cannot be assigned to a lane if it ... |
I have designed an algorithm (up to making a pseudocode) that accepts a sorted array as input and finds in $O(n)$ time if there's a pair of elements (integers) in the array that have a sum zero.
What my algorithm basically does is:
set index $i$ = 0
set index $j$ = length(array) - 1
while $i<j$ : if $a[i]+a[j]=0$ then... |
Let $S$ be language $$\{\langle M\rangle \mid(\forall x \in \Sigma^*)[x \in L(M) \iff x^R \in L(M)]\}.$$
How can I show that $L_U \le_m S$ and $L_U \le_m \bar S$ where $L_U$ is universal language and $\le_m$ means it is m-reducible (or simply reducible)? Can it be done via Rice's theorem?
|
So I found another discussion regarding this, but the answers did not fully separate the differenced between SID and ML. Hopefully a discussion here can shed some light on some larger differences both in design and use case situations between the two.
SID and ML seem very similar. They both use known input and output d... |
How do I prove the runtime of an algorithm with Big O notation? I don't know much about O notation, I just I know how to compare sets of functions with each other and I'm also familiar with the master theorem.
But how do I do this? Is it just $O(n^2)$ because there are $2$ loops? That doesn't sound right. The loop in C... |
I've been studying closely about the List abstract data type - As I understand it can be implemented with linked-list and/or arrays, and really maybe with any other data types as well.
But to satisfy a list, it means to have methods:
that allow for insertion at desire 'position'.
removal at desired 'position'.
access ... |
I am recently studying the operating system, and I found the paging system a little bit confusing, for example, what will happen when there is a 52-bit virtual address and a 40-bit physical address, with 4KiB page size, so there are 2^40 pages and 2^28 frames, how pages are mapped in this case (the pages are more than ... |
Looking online I found two different definitions for euler trail. I am wondering if one of them just implicitly assumed what the other definition explicitly stated or whether one is not generally accepted and if so which the general accepted one is:
All edges exactly once, all vertices at least once
Source: https://www... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.