instruction
stringlengths
0
29.8k
⌀
How can I solve the error "Kernel Power EventID 41"?
|operating-systems|
null
null
One big difference is hamming codes can only correct 1-bit errors and detect 2-bit errors with an additional parity bit. CRCs on the other hand can detect an arbitary number of bit errors with high reliability even with a relatively short code. Hamming codes require a minimum number of parity bits based on the data ...
null
Consider a raster image representing a elevation map $$ z = f(x, y) $$ An "extended lake" $L$ is the largest domain such that the elevation of every point $\partial L$ is greater than the elevation of any point within $L$. The outflow $P$ is the point on $\partial L$ with the lowest elevation. I came up with th...
Efficient algorithm to find the outflow of a lake
|optimization|
null
null
**Problem:** There are L lists of positive integers, say L_0, L_1, L_2 ... L_|L|-1. There is a target number T. Find what is the combination of elements, one element from each list, whose average is the closest to T. **Example:** L_0 = [10, 20, 15] L_1 = [9000, 400, 550] L_2 = [1, 2, 3] ...
Find combination of elements, one element from each list, whose average is the closest to a target number
|algorithms|
I read that in dynamic linking we store the references to the the methods of the library , but a library is essentially a collection of files , and every file will have some code in it , so the reference is stored of which file?
What exactly is stored in dynamic linking
|operating-systems|
I have multiple (possibly concave) simple polygons, and need to compute the union and difference of them, some polygons have to be added, some subtracted from the final shape. I have found algorithms that can compute the intersection andthe difference of 2 polygons, but because they can produce multiple polygons simply...
Compute the intersection and difference of multiple polygons
|computational-geometry|polygons|
The problem is NP-Hard by a reduction from subset sum. Let $X = \{x_1, x_2, \dots, x_n\}$ be a set of integers and let $t$ be an integer. The subset-sum problem asks whether there is a subset $S \subseteq X$ such that $\sum_{x \in S} x = t$. To reduce to your problem pick $L=n$, $L_i = [0, x_i]$, and $T = \frac{T}{...
The problem is NP-Hard by a reduction from subset sum. Let $X = \{x_1, x_2, \dots, x_n\}$ be a set of integers and let $t$ be an integer. The subset-sum problem asks whether there is a subset $S \subseteq X$ such that $\sum_{x \in S} x = t$. To reduce to your problem pick $L=n$, $L_i = [0, x_i]$, and $T = \frac{T}{...
$L = \{ a^{2n} b^{n+k+1} a^k \mid n,k \ge 0\}$ is not a regular language. Suppose towards a contradiction that $L$ is regular and let $p$ be its pumping length. Consider the word $b^{p} a^{p-1} \in L$. By the pumping lemma there is some positive integer $i \le p$ such that, for every $h \ge 0$: $$b^{p-i} b^{hi} a^{...
${a^{2n}b^{n+k+1}a^k ∈ {a, b}∗ | n ≥ 0, k ≥ 0}$
null
$\{a^{2n}b^{n+k+1}a^k ∈ \{a, b\}^∗ \mid n \ge 0, k \ge 0\}$
`SELECT(A,p,r,i)` is an algorithm that 1. partitions $A[p:r]$ around the $i$ th order statistic ie. in the output, we have $l\in A[p:p+i-2]<A[p+i-1]< h\in A[p+i:r]$. Where $A[p+i-1]$ is the $i\in \{1,...,r-p+1\}$ order statistic (basically the $i$ th smallest element). 2. returns the $i$ th order statistic ...
Faster selection algorithm for small order statistics
|algorithms|time-complexity|search-algorithms|algorithm-design|selection-problem|
|algorithms|complexity-theory|search-algorithms|algorithm-design|selection-problem|
null
I'm late for the party, but anyway... Let $p$ and $q$ be two points, such that the distance $d$ between them is maximum over all the pairs of points in the given point set. All the *other* points must be inside the **intersection of two disks** with radius $d$ - one disk with center in the point $p$ and another disk wi...
null
[Heap's Algorithm][1] enumerates the permutations of a set of N objects. How can Heap's Algorithm be used to generate the *k-permutations* of N objects? That is, given a set of N objects, enumerate the ordered selection of k items from the N objects. [1]: https://en.wikipedia.org/wiki/Heap%27s_algorithm
Heap's Algorithm for k-permutations?
|permutations|
if we change the halts to do_not_halt() function, it works, so how can this be a proof? def g(): if halts(g): loop_forever() if we change the halts to do_not_halt() function, it works, so how can this be a proof?
Proof of halting problem
|halting-problem|
[Heap's Algorithm][1] enumerates the permutations of a set of N objects. It's described as: * Permute the elements in positions 1 to n−1 by applying this algorithm to those elements. * Apply the following steps n−1 times. Increment counter i=1 after each iteration. * Swap element in position n with one of the ot...
[Heap's Algorithm][1] enumerates the permutations of a set of N objects. It's described as: * Permute the elements in positions 1 to n−1 by applying this algorithm to those elements. * Apply the following steps n−1 times. Increment counter i=1 after each iteration. * Swap element in position n with one of the ot...
Yes, and the modification is fairly straightforward. Using a C-like notation, this is Heap's algorithm: void generate(int k) { if (k == 1) { output(A[0..N-1]); return; } generate(k-1); for (int i = 0; i < k-1; ++i) { if...
null
I think you misunderstood the proof strategy for the undecidability of the halting problem. The proof goes as follows: - Suppose towards a contradiction that there is some magic computable function `halts(x)` that takes as input a (description of an) algorithm $x$ and returns true if $x()$ halts and false otherwise...
null
I could not find a good source on the Stockham FFT either. So here is my attempt of a comprehensive answer. Disclaimer: I did not track down the original source of the Stockham FFT. Most of my information comes from the following **non-encrypted** japanese website, *so make sure You at least **use a script blocker** if...
I could not find a good source on the Stockham FFT either. So here is my attempt of a comprehensive answer. Disclaimer: I did not track down the original source of the Stockham FFT. Most of my information comes from the following **non-encrypted** japanese website, *so make sure You at least **use a script blocker** if...
I could not find a good source on the Stockham FFT either. So here is my attempt of a comprehensive answer. Disclaimer: I did not track down the original source of the Stockham FFT. Most of my information comes from the following **non-encrypted** japanese website, *so make sure You at least **use a script blocker** if...
I could not find a good source on the Stockham FFT either. So here is my attempt of a comprehensive answer. Disclaimer: I did not track down the original source of the Stockham FFT. Most of my information comes from the following **non-encrypted** japanese website, *so make sure You at least **use a script blocker** if...
The division step involves no computation, it is a mere permutation of the elements. It can indeed be described as a recursive process, top down (consider two halves of the input array and rearrange them, then two halves of each half and son on). In the diagram, this step is only represented by its final result (elemen...
You can find Johnathan Shewchuck's UC Berkely website [here](https://people.eecs.berkeley.edu/~jrs/), which contains: * Excellent [lecture notes](https://people.eecs.berkeley.edu/~jrs/meshpapers/delnotes.pdf) on Delaunay Mesh Generation * [sample chapters](https://people.eecs.berkeley.edu/~jrs/meshbook.html) fr...
def g(): if does_not_halt(g): loop_forever() defines a function `g` that halts if `g` is proven to halt and does not halt if `g` is proven not to halt. This says nothing about the existence of `g` and does not help us. The original `g`, on the opposite def g(): if halts(g...
def g(): if does_not_halt(g): loop_forever() defines a function `g` that halts if `g` is proven to halt and does not halt if `g` is proven not to halt. This says nothing about the existence of `g` and does not help us. The original `g`, on the opposite def g(): if halts(g...
null
A library is a single file, containing compiled code. It needn't be structured as the original files. The references are to all functions that were defined.
A library is a single file, containing compiled code. It needn't be structured as the original files. The references are to all functions that were defined (and explicitly exported).
There is no particular relation between the elevations of the points of $\partial L$, so you can't avoid an exhaustive traversal of $\partial L$. Make sure that the boundary is 4-connected, otherwise looking only at the four neighbors may fail. To find an initial point on $\partial L$, just walk straight from $O$.
Suppose I write an algorithm to perform a computation but I get the intuition that my algorithm is a bit too long, however, it is not immediately obvious to me what a shorter algorithm might be. Is there a way for me to prove the (non-)existence of a shorter algorithm that performs that task - *without* necessarily hav...
Shortest algorithm
|algorithms|
Quines are programs which when executed, print their own code.
Consider a raster image representing a elevation map $$ z = f(x, y) $$ An "extended lake" $L$ is the largest domain such that the elevation of every point $\partial L$ is greater than the elevation of any point within $L$. The outflow $P$ is the point on $\partial L$ with the lowest elevation. I came up with th...
I am looking for an algorithm that allows me to roughly balance items that are grouped into groups with random sizes between `n` elements in a consistent manner. Consider the following example: There are `n` persons. There are `x` hosts. There are `y` customers. A random amount `z` of hosts belong to each ...
consistently balance items with restrains
|algorithms|
I made this problem up in my head, and I'm looking for a solution. I realized that it's a very interesting problem, and I'm way too dumb to solve it, so I'm asking for help. # The problem Given a 'desired canvas', which is a grid of colors (let's say an 8 by 8, because it's easy to work with). And given a list of u...
Finding the smallest possible pattern order to recreate a canvas
|algorithms|graphs|
null
You provided a grammar of the shape: - $E \rightarrow E - E$ - $E \rightarrow E * E$ - $E \rightarrow F$ - $F \rightarrow a | b | c$ The second last production has $E$ on its LHS; it is a unit production that can be removed to produce the grammar: - $E \rightarrow E - E$ - $E \rightarrow E * E$ - $E \r...
null
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
Hoare's partition original method
|sorting|partitions|quicksort|hoare-logic|
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
So I was reading the Hoare's partition part of the Quicksort [wiki][1] and it says: **"With respect to this original description, implementations often make minor but important variations. Notably, the scheme as presented below includes elements equal to the pivot among the candidates for an inversion (so "greater t...
The question leaves some room for interpretation, so I apologize in advance if my answer misses the mark. You can in fact merge (sort) $m \le n$ sorted "runs" in at most $\mathcal{O}(n\log n)$ time. This is one of the many great ideas that went into the [TimSort algorithm](https://en.wikipedia.org/wiki/Timsort). You...
I need a semi-complete list of weakly NP-HARD problems. I already know the Knapsack problem, partition problem and subset sum problem. Please introduce other weakly NP-hard problems to me.
List of weakly NP-HARD problems
|complexity-theory|np-hard|knapsack-problems|partitions|subset-sum|
Suppose that you are running MAX-HEAPIFY on some vertex $v$ of a heap $H$. Then the subtree $H_v$ rooted at $v$ is also a heap. Let $n$ be the number of vertices of $H_v$. Clearly if $v$ has no children or only one (left) children then $T(n) = O(1)$ so let's focus on the case in which $v$ has two children $u$ and $w...
null
I need a list of at least 10 weakly NP-HARD problems. I already know the Knapsack problem, partition problem and subset sum problem. Please introduce other weakly NP-hard problems to me.
## What is a fixed point? A fixed point of a function is a value unchanged by that function. For example $0^2=0$ and $1^2=1$, so $0$ and $1$ are fixed points of the squaring function. Similarly “ASDF” is a fixed point of the function converting text into upper case. ## What is Kleene’s recursion theorem? There are a...
I want to efficiently generate [partial permutations][1]. That is, I want to generate the set of ordered arrangements of K distinct elements selected from a set from N items. For example, with the set ABCDE where N=5, if K=2, then the partial permutation set is AB, AC, AD, AE, BA, BC, BD, BE, CA, CB, CD, CE, DA, DB,...
Efficient algorithms to generate partial permutations?
|permutations|
null
Yes, and the idea behind the modification is fairly straightforward. Using a C-like notation, this is Heap's algorithm: void generate(int k) { if (k == 1) { output(A[0..N-1]); return; } generate(k-1); for (int i = 0; i < k-1; ++i) {...
null
Yes, and the idea behind the modification is fairly straightforward. Using a C-like notation, this is Heap's algorithm: void generate(int k) { if (k == 1) { output(A[0..N-1]); return; } generate(k-1); for (int i = 0; i < k-1; ++i) {...
The "Magic Cookie" was a plot device, symbolizing hallucinogenic drugs, in the comic strip "Odds Bodkins" tha ran kin the San Francisco Chronicle from 1969 to 1970 (https://en.wikipedia.org/wiki/The_Collective_Unconscience_of_Odd_Bodkins).
Page 7 of "[FAST ALGORITHM FOR GENERATING CONSTRAINED DELAUNAY TRIANGULATIONS][1]" (a publication on a CDT algorithm) explains the process very clearly and the figures are extremely useful. [1]: https://www.newcastle.edu.au/__data/assets/pdf_file/0019/22519/23_A-fast-algortithm-for-generating-constrained-Delauna...
The "Magic Cookie" was a plot device, symbolizing hallucinogenic drugs, in the comic strip "Odds Bodkins" that ran in the San Francisco Chronicle from 1969 to 1970 (https://en.wikipedia.org/wiki/The_Collective_Unconscience_of_Odd_Bodkins).
I have computed a constrained triangulation of a set of points. The constraint happens to be a closed polygon. The objective is to detect all edges which are inside the polygon, that is, an edge where both endpoints are points in the polygon and for which all interior points are inside the area of the polygon. A ...
Detecting if an edge is "inside" a polygon?
|graphs|computational-geometry|discrete-mathematics|graphics|