instruction
stringlengths
0
29.8k
⌀
Why round robin favours the process with large burst time?
|process-scheduling|
null
By the time hierarchy theorem, if $f$ and $g$ are time-constructible functions and $f(n) \log f(n) = o(g(n))$ then $\mathsf{DTIME}( f(n) ) \subsetneq \mathsf{DTIME}(g(n))$. From your question you seem to be using the following weaker for of the theorem: if $f$ and $h$ are time-constructible and $f(n) = o(h(n))$ t...
I had an exam question which says how many segments the user accessible part of the 8086 memory contains? I have count it using this: Since from $00000$ to $0007F$ and $FFFE0$ to $FFFFF$ are made for a reserved and dedicated parts of the memmory we will take it out from the actual size of the memory which is $1MB$....
8086 number of memory segments in the user's accessible memory
|computer-architecture|
To avoid syntax errors which might bring confusion to you,fistly I would like to clarify that I am just a first-year student from China who is struggling to find a solution and therefore seeking assistance here.(also please considering requester's limited programming knowledge).I have designed a simple C++ program to r...
Question about the accuracy of the matchtemplate function
|c++|
null
null
The assumption is that the algorithm must read in data (given that the full sample is received) thus it is $\Omega(m)$. So, if $m$ is not polynomial, there is no way for the algorithm to be polytime as well.
I agree with D.W.'s comment; please include more information! I believe the algorithm you're referring to outputs $A(S)$ as a membership indicator of the smallest rectangle containing all positive samples. This would not be an arbitrary rectangle; it would always output 0 as $A(S)(x) = 1 (x \in \emptyset) = 0$ where $\...
I am working on parts of my master-thesis and got to a problem which I would like to solve and develop some algorithm for. Basically I am dealing with 2d-geometry which I would like to represent using a 2d grid. # Task My grid represents a density of my structure which should eventually converge to my final result...
ensure connectivity in geometric optimization
|optimization|computational-geometry|topology|
null
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct
Double Dominating Set NP-Complete
|np-complete|
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct Input is an undirected graph and a target . The question is whether it is possible to find a subset with a maximum vertices that doubly dominate all ...
Given a graph $G = (V,E)$ with $V = \{v_1, \dots, v_n\}$, define $G' = (V', E')$ as the graph obtained by adding $n$ new vertices $v'_1, \dots, v'_n$ along with all edges $(v_i, v'_i)$ for $i=1,\dots,n$. **$G$ has a dominating set of size at most $k$ if and only if $G'$ has a double dominating set of size $k+n$.** ...
The problem is clearly in $\mathsf{NP}$ (you can use the double dominating set as a yes certificate), and the following reduction shows that it is also $\mathsf{NP}$-Hard. Given a graph $G = (V,E)$ with $V = \{v_1, \dots, v_n\}$, define $G' = (V', E')$ as the graph obtained by adding $n$ new vertices $v'_1, \dots, v...
Your sources are right, and I am afraid there is only little to add, except formalism. Indeed it is enough to reverse all productions to reverse the language. I denote the reverse (mirror) of string $w$ by $w^R$. If $G$ is a grammar, let $H$ be its reverse, so for production $A\to w$ in $G$ we have $A\to w^R$ in $H$...
null
I'm curious about the viability of creating memory isolated processes on a processor without an MMU. While it would be inefficient I'm wondering if it's possible to basically create a virtual machine with an MMU and process each instruction on the emulator. In essence the VM would keep track of the current processes...
Can a MMU be emulated entirely in software?
|operating-systems|virtual-memory|
I agree with D.W.'s comment; please include more information! I believe the algorithm you're referring to outputs $A(S)$ as a membership indicator of the smallest rectangle containing all positive samples. This would not be an arbitrary rectangle in the case of only negative rectangles, rather $\emptyset$. So, it would...
Consider block size as 20B and integer array of 5Elements each of 4B, we know array is stored in contiguous memory locations, consider the base address of Array as 0x0000, the moment you access the very first element it will be miss, because the block you are referring haven't refered before, so for the first element i...
S->Bb|a B->SdB'|eB' B'->cB'|ε
```none S->Bb|a B->SdB'|eB' B'->cB'|ε ```
null
I have seen research papers studying approaches to this, for use on low-end embedded microprocessors. One approach I have seen is to use SFI (or other techniques, like dynamic instrumentation) to provide memory isolation and also patch the code so that, on each backward branch, you check whether the process has run lo...
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct Input is an undirected graph and a target. The question is whether it is possible to find a subset with a maximum vertices that doubly dominate all vertices in the...
I have designed a C++ program to recognize the digits on an ID card based on OpenCV. First I preprocess the ID card image and then segment it based on contours. The segmentation results are as expected. Then I use the matchTemplate function with templates stored in the template path. However the recognition is inaccura...
Accuracy of Digit Recognition with Template Matching
|computer-vision|image-processing|c++|
null
Don't use template matching; use a classifier to classify each digit.
{"Voters":[{"Id":755,"DisplayName":"D.W."}]}
I have seen research papers studying approaches to this, for use on low-end embedded microprocessors. One approach I have seen is to use SFI (Software Fault Isolation) (or other techniques, like dynamic instrumentation) to provide memory isolation and also patch the code so that, on each backward branch, you check whe...
null
null
In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would this situation lead to a penalty or delay in data retrieval? So far all question's I've solved involve a data or instr...
Cache Miss in First Private Cache but Hit in Shared LEvel 2 Cache: Does it Result in a Penalty?
|memory-management|cpu|cpu-cache|memory-hardware|virtual-memory|
null
I was trying to understand the fundamentals of polyhedral optimization from [this article][1]. I've also provided the English-translated [link][2] In the article, I encountered a piece of code that initializes an array within a loop. The code snippet indicates that statement 'S' runs from `0 to 2*N`, inclusive, as f...
Loop Bounds vs. Iteration Domain in Polyhedral optimization: Clarifying the Range: N or 2N?
|optimization|arrays|loops|upper-bound|iteration|
How can i show that Dominating Set is NP complete by reduce vertex cover to it
Dominating Set is NP-Complete
Precedence graph of 6 processes and each number of resources they need to be fully executed is as follows: |Process|Resource A|Resource B| |-------|----------|----------| P1|4|2 P2|2|3 P3|3|2 P4|4|1 P5|3|2 P6|2|1 [![Precedence Graph][1]][1] [1]: https://i.stack.imgur.com/ElD9e.png What is the least...
Least amount of resources required in order to prevent deadlock?
|deadlocks|
I was reading an article on polyhedral optimization and got confused while understanding **how we will denote iteration domain from loop bounds with set builder notation**. *A code snippet from the article*; for (int i = 0; i <= 2*N; ++i) S: Z[i] = 0.; From the article; The iteration domain for t...
Loop Bounds vs. Iteration Domain in Polyhedral optimization
I don't understand why you used $1$ as the non-amortized cost of a resizing. Define $\Phi_i$ as $\frac{q^2}{q-1}$ times the number of elements inserted in the table since the last resizing. In formulas let $\Phi_i = \frac{q^2}{q-1} \cdot ( i - \frac{N_i}{q} ) = \frac{q^2}{q-1} i - \frac{q}{q-1} N_i$. If the $i$-t...
null
**Context:** I was reading a tutorial on [polyhedral optimization][1]. But got confused **while trying to translate the iteration domain (i.e. loop bound) to set builder notation.** **Problem Description:** *A code snippet from the article*; for (int i = 0; i <= 2*N; ++i) S: Z[i] = 0.; The i...
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct Input is an undirected graph and a target. The question is whether it is possible to find a subset with a maximum vertices that doubly dominate all vertices in the...
Double Dominating Set NP-Complete
Let $L \subseteq \{ a, b\}^*$ be a language with one Myhill-Nerode equivalence class. You can show that $L$ must be trivial, that is $L\in \{\emptyset, \{a, b\}^*\}$, either by using the Myhill-Nerode theorem as Yuval did. Or you can show that directly as for $L$ to have a single Myhill-Nerode equivalence class, it mea...
- Let $\mathbb{F}=\mathbb{Z}/p\mathbb{Z}$ a cyclic field. Where $p$ is fixed - Let $(H)_{n\in\mathbb{N}} \in \mathbb{Z}[x_1,\dots]^{\mathbb{N}}$ a family of polynomials with $H_n\in \mathbb{Z}[x_1,\dots,x_n]$ - Let $\varphi : \mathbb{Z}\rightarrow \mathbb{F}$ the ring isomorphism defined by $\varphi(x)=x\bmod p$ - L...
Distinction between square roots in cyclic fields
|complexity-theory|polynomials|
Consider the language ${C_k}$, and let $\sim_{C_k}\subseteq \Sigma\times \Sigma$ denote the Myhill-Nerode equivalence relation w.r.t to $C_k$. As the number of Myhill-Nerode equivalence classes bounds from below the size of the minimal DFA that recognizes $C_k$, it is sufficient to bound the number of Myhill-Nerode equ...
Consider the language ${C_k}$, and let $\sim_{C_k}\subseteq \Sigma\times \Sigma$ denote the Myhill-Nerode equivalence relation w.r.t to $C_k$. As the number of Myhill-Nerode equivalence classes bounds from below the size of the minimal DFA that recognizes $C_k$, it is sufficient to bound the number of Myhill-Nerode equ...
Let $L \subseteq \{ a, b\}^*$ be a language with one Myhill-Nerode equivalence class. You can show that $L$ must be trivial, that is $L\in \{\emptyset, \{a, b\}^*\}$, either by using the Myhill-Nerode theorem as Yuval did, or by showing that directly. Indeed, as for $L$ to have a single Myhill-Nerode equivalence class,...
I'm working on a problem where I need to find specific order statistics in a set of numbers. Given `n` numbers, I want to determine the `k-th` smallest, the `2k-th` smallest, and so on, up to the `⌊n/k⌋-th` smallest element. I'm looking for a method to accomplish this with a time complexity of `O(n log(n/k))`. **My ...
Finding Specific Order Statistics with O(n log(n/k)) Complexity
|algorithms|sorting|
A question I am to answer wants me to find the big O of a recurrence, I am doing it with iteration method. For the base case, which we get after applying the recurrence i times, can we make this any number as long as we assume it will be in constant time? Such as $T(5)$, $T(100)$ etc. I can't give anymore info to the q...
Solving recurrence by iteration, choosing base case
|asymptotics|recurrence-relation|
Find `n/2k-th` in $O(n)$ time. There is a standard algorithm for finding any `p-th` smallest element in array in $O(n)$ time. Partition the array in almost equal halves about this `n/2k-th` smallest element. Run the algorithm recursively on the two halves. Once the algorithm finds all the required $n/k$ elements; r...
Find `n/2k-th` in $O(n)$ time. There are standard algorithms for finding any `p-th` smallest element in array in $O(n)$ time. Partition the array in almost equal halves about this `n/2k-th` smallest element. Run the algorithm recursively on the two halves. Once the algorithm finds all the required $n/k$ elements; r...
A CNF formula is Horn-renamable if you can invert variables in such a way that each clause has at most one positive literal. There is an algorithm based on a reduction to 2-SAT given in [Renaming a Set of Clauses as a Horn Set][1]. It seems, however, that by applying the standard reduction from CNF to 3-CNF, one cou...
CNF Horn-renamability to 3-CNF Horn-renamability reduction?
|reductions|reference-request|satisfiability|boolean-algebra|
In most descriptions of monte-carlo tree search, I see the simulation step described as: > Play out a game from the leaf node until a terminal node is reached and get the result. And the backpropagation step is described as: > Use the result of the simulation to update information in > the nodes on the path f...
In monte-carlo tree search, do you propagate the result from the terminal or just the leaf?
|algorithms|trees|monte-carlo|
Well, obviously $T(1),T(2),\dots,T(100)$ are all integers. So, let $c=\max(T(1),T(2),\dots,T(100))$. $c$ is obviously some integer, so it is a constant. So yes, all of those base cases are at most a constant. In practice, we often assume that $T(1)=1$, as usually multiplying it by a small constant doesn't change ...
|regular-languages|finite-automata|
null
I don't believe you can compute $\varphi(H_n)(u_1,\dots,u_n)$ from $\varphi(H_n^2)(u_1,\dots,u_n)$ in a black-box manner, because there are two possibilities for the square root, exactly as you wrote. Whether you can compute $\varphi(H_n)(u_1,\dots,u_n)$ efficiently depends on $H_n$. I don't know whether you can ...
null
null
null
Under mod 2 arithmetic ($\mathbb{Z}$={0,1}), given a set $V$ of $n$x$1$ linearly independent vectors $\{x_1,...,x_n\}$ I'd like to find a $n^2$ binary matrix $M$ such that $Mv=v$ where $v \in V$ and $M\bar{v}\neq \bar{v}$ for $\bar{v}\not \in V$. I supposed it would also be helpful to know the technical term for a ...
Finding solution to Mv=v over $\mathbb{Z}$={0,1} for matrix M given a set linearly independent v
|arithmetic|linear-algebra|modular-arithmetic|
null
It is not possible. Such matrices don't exist. We always have $Mv=v$ whenever $v=0$ (the all-zeros vector), and no set that contains the all-zeros vector is linearly independent. Another proof of impossibility: suppose $u,v \in V$; if $Mu=u$ and $Mv=v$, then by linearity $M(u+v)=(u+v)$, but by linear independence,...
So I have a bunch of strings that represent routes in a HTTP web framework. Each string has a leading `/`, some `/`-separated path segments which can either be a string, a single-segment wildcard `?`, or a trailing multi-segment wildcard `*`. (For this problem, we can assume that `*` can only be in a trailing position,...
null
I know an unlabeled unrooted tree normalization algorithm that uses parentheses: - label each vertex with () - while there are more than two leaves repeat: - remove each leaf placing its label within the ( and ) of the parent so that within the ( ) of the parent, the strings representing the children are sorted;...