instruction stringlengths 0 29.8k ⌀ |
|---|
Fast way to know if deleting an edge will disconnect a fully connected undirected graph |
|graphs| |
No, because in the worst case you have to examine every edge (at least, under standard graph representations).
If you can preprocess the graph ($O(|V|+|E|)$ time), you can decompose it into strongly connected components and build a data structure that lets you answer this question in $O(1)$ time.
If you are repea... |
I agree. I believe you are correct. As far as I can see, $y$ does not need to be random. |
In multithreading models, we have a two-level model in which we multiplexes many user-level threads to a smaller or equal number of kernel threads but also allows a user-level thread to be bound to a kernel thread.
[![enter image description here][1]][1]
Why we need such a model ? Can someone give an example wher... |
Two-Level Threading Model |
|operating-systems|threads| |
null |
I've read [this][1] scribe that provides a public coin interactive proof for graph non-isomorphism.
In the proof, the verifier samples both a pairwise-independent hash function **and a target $y$**.
In all calculations carried out in page 5, I couldn't find a single instance that used the fact that $y$ is rando... |
I implemented a conforming (i.e. it creates Steiner points using Ruppert's algorithm) delaunay triangulator, which is working, but there is one step I am doing that I straight up don't understand and suggests something is broken.
After introducing a circumcenter of a triangle, I am having to check the entire mesh an... |
How to avoid global delaunay check in conforming triangulation? |
|algorithms|graphs|computational-geometry|discrete-mathematics|triangulation| |
I've read [this][1] scribe that provides a public coin interactive proof for graph non-isomorphism.
In the proof, the verifier samples both a pairwise-independent hash function **and a target $y$**. Then it continues to show bounds for the probability that there's a pre-image of $y$ w.r.t. the hash function that's ... |
I have the following recurrence relation that I am trying to solve using the telescoping approach:
() = { $T(n/4) + n^2 $ for $n ≥ 4$
1 otherwise
I have this so far:
$T(n) = T(n/4) + n^2$
$T(n/4) = T(n/16) + (n^2/16)$
$T(n/16) = T(n/64) + (n^2/64) $
... up to $T(n) = 1$
I know I am supposed to now... |
Struggling with Recurrence Relation using Telescoping Approach |
|algorithms|complexity-theory|recurrence-relation|big-o-notation|mathematical-analysis| |
I have the following recurrence relation that I am trying to solve using the telescoping approach:
$T(n) =
\begin{cases}
T(\frac{n}{4})+ n^2 & \text{for } n \geq 4
\\
1 & \text{otherwise}
\end{cases}$
I have this so far:
$T(n) = T(n/4) + n^2$
$T(n/4) = T(n/16) + (n^2/16)$
$T(n/16) = T(n/64) + (n^2/64... |
I figured it out. The implementation of lawson's algorithm I had was incorrect, this is the right one:
```rs
/// Recursively flips triangles around a determined vertex until all pass the
/// delaunay test (or are constrained).
pub fn lawsons_algorithm<F>(
source: GeomId<0>,
mesh: &HalfMesh<Vec3, (), (... |
I have the following recurrence relation that I am trying to solve using the telescoping approach:
$T(n) =
\begin{cases}
T(\frac{n}{4})+ n^2 & \text{for } n \geq 4
\\
1 & \text{otherwise}
\end{cases}$
I have this so far:
$T(n) = T(\frac{n}{4}) + n^2$
$T(\frac{n}{4}) = T(\frac{n}{16}) + (\frac{n^2}{16})$... |
null |
I am not so sure what the problem is: is it a problem on writing the formula with the sum, or finding a closed formula for the sum?
In the first case, you could write either:
$$T(n) = n^2 + \left(\frac{n}4\right)^2 + \left(\frac{n}{16}\right)^2 … + 1$$
but that hides the number of terms.
Another possibility i... |
I am going through Justin Thaler's book - https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.pdf - "Proofs, Arguments, and Zero-Knowledge"
He is describing the Sumcheck Protocol on Page 34
$H = \sum_{b_1 \in \lbrace 0,1 \rbrace} \space \sum_{b_2 \in \lbrace 0,1 \rbrace} \space ... \space \sum_{b_v \in \lbra... |
I have a sequence of points over time, and a grid of X by Y cells to which I need to calculate the cells in which the points fall, as depicted in the diagram below
[![enter image description here][1]][1]
Another point now arrives (as depicted by the red dot to the right), the grid is stretched to fit the new data... |
Calculating cells encompassing points in a grid |
|algorithms| |
This would be resolved in round one, as the paper also says "When the leader (distinguished proposer) fails to receive the expected response to its phase 2 (accept request) messages [...], it will retransmit those messages."
Unless the proposal round is abandoned and the leader sends a new (higher) proposal id.
... |
null |
Let's say I have a Monte Carlo algorithm $A$ that gives the correct answer with a probability $p$ > $1/2$. I don't have any information on if it's decisional or not.
I understand that I can make another algorithm $A'$ that runs $A$ for a number of times $k$ and returns the average (or the most repeated answer of $A$... |
Finding the error probability of a Monte Carlo algorithm |
|algorithms|probabilistic-algorithms|monte-carlo| |
Run the algorithm $A$ a total of $2k$ times and take the most popular answer. Then if this aggregate answer is wrong, this means that at least $k$ answers were wrong. This happens with probability:
$$r:=\sum_{i=k}^{2k}\binom{2k}{i}(1-p)^{i}p^{2k-1}$$.
By Hoeffding's inequality, you could also bound that by
$r\leq... |
Whether 2-bracket Dyck is equivalent to $n$-bracket Dyck ($n\ge2$)? Short answer: that depends which operations one allows.
The [Chomsky–Schützenberger Theorem][1] states that every context-free language $L\subseteq \Sigma^*$ can be written as
$L=h(D_{T}\cap R)$, where $D_T$ is the Dyck language over the bracket p... |
Given a parsing expression grammar for a language, is there a way to make a parsing expression grammar for a new language that consists of the valid strings from the original language, plus the strings obtained by adding or removing a single character from an original language string?
|
Parsing expression grammar for a language consisting of sentences with one character added or removed anywhere |
|formal-grammars|parsers| |
Most OSes use the message passing system to let 2 processes communicated with each other.This works by a shared mailbox between the OS and each process loaded in the RAM however are there processes which have their own shared mailbox and can communicate without the OS acting as a middleman? |
Processes with communication exclusive from the OS |
|operating-systems|applications|message-passing| |
In 8086, as i know we need those segementation register to segment our memory because the address bus is 20 bit and register size is 16. So, If the register size and the address bus are equal and we can store all possible physical addresses in our registers, do we need those segementation register to segment our memory... |
If the register size and the address bus are equal so do we need those segementation register to segment our memory? |
|memory-management|memory-hardware| |
In 8086, as i know we need those segementation register to segment our memory because the address bus is 20 bit and register size is 16. So, If the register size and the address bus are equal and we can store all possible physical addresses in our registers like 80386 microprocessor, do we need those segementation regi... |
In 8086, as i know we need those segementation register to segment our memory because the address bus is 20 bit and register size is 16. So, If the register size and the address bus are equal and we can store all possible physical addresses in our registers like 80386 microprocessor, do we need those segementation regi... |
In 8086, as i know we need those segementation register to segment our memory because the address bus is 20 bit and register size is 16. So, If the register size and the address bus are equal and we can store all possible physical addresses in our registers like 80386 microprocessor, do we need those segementation regi... |
Let's say I have a Monte Carlo algorithm $A$ that gives the correct answer with a probability $p$ > $1/2$. I don't have any information on if it's decisional or not.
I understand that I can make another algorithm $A'$ that runs $A$ for a number of times $k$ and returns the average (or the most repeated answer of $A$... |
According to [javatpoint](https://www.javatpoint.com/os-process-queues), ready and wait queue are different. But according to [wikipedia](https://en.wikipedia.org/wiki/Process_state#Ready) they are synonymous, in this context. Now I am more confused.
What I want to know is, when the parent process executes `wait(NU... |
Which queue does `wait()` suspended process goes into? |
|operating-systems|process-scheduling| |
If you use an under-/overflow-safe euclidean norm implementation along the lines of LAPACK's [dnrm2](https://netlib.org/lapack/explore-html/df/d28/group__single__blas__level1_gab5393665c8f0e7d5de9bd1dd2ff0d9d0.html), your line-to-point distance function will look something like the following Scala code:
```scala
de... |
If syscalls are meant to transition into kernel mode from user mode, what is the point of calling syscalls in the kernel?
Reference: https://stackoverflow.com/questions/15841327/can-we-call-system-call-in-kernel-space |
What is point of calling syscalls in the kernel? |
|operating-systems| |
Most modern operating systems have threads that run in kernel mode. Some typical examples include:
- Device drivers. Some operating systems even go to the trouble of implementing interrupt handlers as very-high-priority tasks.
- Determining page frames that haven't been used recently so they can be dealt with (e.... |
null |
null |
Run the algorithm $A$ a total of $2k$ times and take the most popular answer. Then if this aggregate answer is wrong, this means that at least $k$ answers were wrong. This happens with probability:
$$r:=\sum_{i=k}^{2k}\binom{2k}{i}(1-p)^{i}p^{2k-1}$$.
You could also bound that by
$r\leq e^{-k(2p-1)^2}$, for exa... |
null |
Two isolated processes need some OS support for passing messages between each other, but there need not be a system call for every message.
One simple way is to use virtual memory. You could, for example, use [shared memory][1] or a [memory-mapped file][2] to share a piece of memory between two processes, and commun... |
null |
I found several mentions of complete problems for the classes of the polynomial hierarchy, but could not find if the completeness was taken with respect to polytime or logspace reductions. |
Is $\Sigma_n^p$-SAT a complete problem for the $\Sigma_n^p$ with polytime or with logspace reductions? |
|complexity-theory|reductions| |
null |
Here I define $\Sigma_n^p$-SAT to be the problem of decided if a boolean formula in prenex normal form with $n$ alterning quantifiers, starting with $\exists$, is satisfiable.
I found several mentions of complete problems for the classes of the polynomial hierarchy, but could not find if the completeness was taken w... |
Is $\Sigma_n^p$-SAT a complete problem for the $\Sigma_n^p$ class with polytime or with logspace reductions? |
if you write a DFA that generates lets say sigma star it wont be possible on an NFA some languages can not be converted efficiently or youll be just adding epsilons everywhere |
It is a classical fact that if two states are distinguishable, then they are distinguished by a string of length at most $n-1$. This follows from an analysis of [Hopcroft's algorithm](https://en.wikipedia.org/wiki/DFA_minimization#Nondistinguishable_states). See also [lecture notes](https://lucatrevisan.github.io/teach... |
The length of the walk is the number of edges in the walk. Suppose $p$ is a walk labeled $w$. We can decompose $p$ into $p_1 e_1 p_2 e_2 \cdots p_{|w|} e_{|w|} p_{|w|+1}$, where each $p_i$ consists only of $\lambda$-transitions, and $e_i$ is a transition labeled $w_i$. There is always an equivalent walk in which no tra... |
Here is how to implement your solution. Let $A = \langle Q, q_0, F, \delta \rangle$ be a DFA for $L$. We will construct an NFA $A' = \langle Q', q'_0, F', \delta' \rangle$ as follows:
- $Q' = \{q'_0\} \cup Q^3$. The state $(q_1,q_2,q_3)$ means that we have guessed that when $A$ finishes reading the first copy of $w$... |
There is a simple $O(n^4)$-time algorithm which I will let you discover yourself. A better algorithm follows from the following formula for the number of squares:
$$
\frac{1}{8} \left( \operatorname{Tr} (A^4) - 2\sum_i d_i^2 + \sum_i d_i \right),
$$
where $A$ is the adjacency matrix and $d_i$ is the degree of the $... |
null |
Given an undirected graph $G=(V,E)$ I would like to check whether it contains a cross/parallel (unrelated) edge pair. These are $2$ edges $\left(v_1, v_2\right)$ and $\left(v_3, v_4\right)$ such that for any $i<j$ (excluding $i=1,j=2$ and $i=3,j=4$) there is no edge $\left( v_i , v_j \right)$. In other words, the only ... |
null |
I would like to model linked lists using set theory similar to that in Scheme and LISP.
There is a set theoretic [definition][1] of the ordered pair:
$p = \{\{a, 1\}, \{b, 2\}\}$
My question is how does one distinguish a value from a pointer to another list? Should I just use more types like $3$ for value and... |
Linked Lists, Ordered Pairs? |
|graphs|data-structures|sets|linked-lists| |
null |
null |
Now that you have defined ordered pairs, you can do what LISP do : $\operatorname{NIL}$ is a list and if you have a list $l = (a, b)$ then $a$ is a value and $b$ is a list. Of course, lists can be used as value themselves.
For example, the list $(a.b.c)$ is defined to be the ordered pair $(a, (b, (c, \operatorname{N... |
Given an undirected graph $G=(V,E)$ I would like to check whether it contains a cross/parallel (unrelated) edge pair. These are $2$ edges $\left(v_1, v_2\right)$ and $\left(v_3, v_4\right)$ such that for any $i<j$ (excluding $i=1,j=2$ and $i=3,j=4$) there is no edge $\left( v_i , v_j \right)$. In other words, the only ... |
If I understand your question correctly, the features in your case are exclusively categorical. Support Vector Machines might work, but they would not be my model of choice for such data. SVMs try to separate the classes by a plane¹ with maximum distance to the closest samples in feature space. That distance, however, ... |
If I understand your question correctly, the features in your case are exclusively categorical. Support Vector Machines might work, but they would not be my model of choice for such data. SVMs try to separate the classes by a plane¹ with maximum distance to the closest samples in (transformed) feature space. That dista... |
I'm trying to prove the following scheduling problem is NP-complete.
We are given a directed, acyclic graph where the vertices represent jobs, and the edges represent precedence constraints between pairs of jobs, that is to be scheduled non-preemptively upon an multiprocessor platform consisting of a specified numb... |
Showing this scheduling problem is NP-hard |
|complexity-theory|np-complete|reductions|scheduling| |
The problem is strongly NP-Hard as it can be seen by reducing from the [$3$-partition][1] problem:
given a set $X = \{ x_1,\dots,x_{3n} \}$ of $3n$ positive integers, is there a partition of $X$ into $n$ sets $X_1, X_2, \dots, X_n$ such that (i) the sum of the elements in each set $X_i$ is exactly $T=\frac{1}{n} \sum_... |
Here I define $\Sigma_n^p$-SAT to be the problem of deciding if a boolean formula in prenex normal form with $n$ alternating quantifiers, starting with $\exists$, is satisfiable.
I found several mentions of complete problems for the classes of the polynomial hierarchy, but could not find if the completeness was take... |
In modern systems, we typically don't need this, because OS kernels provide adequate support for threads so that there can be a one-to-one mapping between user threads and kernel threads.
In some past systems, OS kernels didn't have support for creating multiple threads in a single process, or creating a new kernel ... |
Cort Ammon's answer says
>multi-level page tables [let] us be a bit more efficient, keeping pages only for regions of the address space that we are actually using.
and gnasher729's answer says
>1 GB of page table could handle 512 GB of address space.
I think they both overlooked, or at least didn't make cle... |
null |
null |
null |
Now that you have defined ordered pairs, you can do what LISP does: $\operatorname{NIL}$ is a list and if you have a list $l = (a, b)$ then $a$ is a value and $b$ is a list. Of course, lists can be used as value themselves.
For example, the list $(a.b.c)$ is defined to be the ordered pair $(a, (b, (c, \operatorname{... |
System F define the data type pair as:
$$X\times Y := \Pi Z. (X\to Y \to Z)\to Z$$
with:
$$\langle x,y \rangle := \Lambda Z. \lambda p^{X\to Y\to Z}.p\\ x\\ y$$
Projections are defined:
$$\pi^1 p := pX(\lambda x^X.\lambda y^Y.x)$$
$$\pi^2 p := pY(\lambda x^X.\lambda y^Y.y)$$
It is easy to prove that:
$$\pi^... |
Representation of pairs in System F |
|lambda-calculus|functional-programming|haskell|polymorphisms| |
System F define the data type pair as:
$$X\times Y := \Pi Z. (X\to Y \to Z)\to Z$$
with:
$$\langle x,y \rangle := \Lambda Z. \lambda p^{X\to Y\to Z}.p \text{ }x\text{ } y$$
Projections are defined:
$$\pi^1 p := pX(\lambda x^X.\lambda y^Y.x)$$
$$\pi^2 p := pY(\lambda x^X.\lambda y^Y.y)$$
It is easy to prove t... |
System F define the data type pair as:
$$X\times Y := \Pi Z. (X\to Y \to Z)\to Z$$
with:
$$\langle x,y \rangle := \Lambda Z. \lambda p^{X\to Y\to Z}.p \text{ }x\text{ } y$$
Projections are defined:
$$\pi^1 p := pX(\lambda x^X.\lambda y^Y.x)$$
$$\pi^2 p := pY(\lambda x^X.\lambda y^Y.y)$$
It is easy to prove t... |
Your initial solution sounds correct to me.
The problem with your second idea of switching between RAM sticks, using a "select RAM stick" instruction, is that it technically is not random-access anymore:
* Reading data from only one DIMM requires 1 op per access (switch address)
* Switching between DIMMs requi... |
System F defines the data type pair as:
$$X\times Y := \Pi Z. (X\to Y \to Z)\to Z$$
with:
$$\langle x,y \rangle := \Lambda Z. \lambda p^{X\to Y\to Z}.p \text{ }x\text{ } y$$
Projections are defined:
$$\pi^1 p := pX(\lambda x^X.\lambda y^Y.x)$$
$$\pi^2 p := pY(\lambda x^X.\lambda y^Y.y)$$
It is easy to prove ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.