instruction
stringlengths
0
29.8k
⌀
null
null
Induction often yields great wrong proofs because there are many things which can fail: - The induction base $P(0)$ can be false, or it may be missing at all and hence the rest of the induction is based on a false assumption. If the induction base is false, everything else is an *ex falso quodlibet*. - The inductio...
I believe a general or pure definition of a “graph” in mathematics can be from algebraic topology, where a graph can be more abstractly seen as a simplicial complex, or a cell complex, or with scheme theory. I am interesting in how many different “ways” a person could denote the structure of a given graph, in some n...
Is there a mathematical classification of formal languages for denoting graphs as a sequence of finite symbols?
|graphs|information-theory|
I Let $G$ be the set of simple graphs on $n$ nodes. Given a $g \in G$, we denote the number of triangles in $g$ with $n(g)$. Given some positive real-valued parameter $w$, we define the partition function $Z(w)$ as follows: $$Z(w)= \sum_{g}\exp(w\cdot n(g))$$ I think its an intractable problem, but I don't know abo...
Is there a known FPRAS for this simple partition function?
|counting|applied-theory|
I'm considering a binary error-correction scheme, but I'm missing the correct terms to dig further into it. The idea is to decide the code-rate during encoding, but for the decoder to decide how that's used, depending on its resources (and estimate of the actual transmission error rate). For example, let's say ou...
Name for class of error-correction codes
|error-correcting-codes|hamming-distance|
The problem is in **P** for any fixed $k$. The clauses shouldn't need to be all positive, either. For the positive example, let's say we choose from sets $A$, $B$ and $C$ (it doesn't really matter). For each of the 8 (or generally, $2^k$) possible truth assignments to $a$, $b$ and $c$ (which I will call the *main va...
I Let $G$ be the set of simple graphs on $n$ nodes. Given a $g \in G$, we denote the number of triangles in $g$ with $n(g)$. Given some positive real-valued parameter $w$, we define the the function $Z(w)$ as follows: $$Z(w)= \sum_{g}\exp(w\cdot n(g))$$ I think its an intractable problem to compute $Z(w)$, but I do...
null
I stumbled upon this question looking for a more practical answer, so here is a more hands-on solution using Java code and 32-bit integers as example. The basic idea is to take an array $\left[0, 1, ... m-1\right]$, shuffle it, and return the first $n$ entries. The go-to shuffling algorithm is [Fisher-Yates](https:/...
i'm need to create the following algorithms and detemine some data given an undirected, simple and connected graph G=(V,E) and some positive weight function the algorithm needs to scan the edges from the heavier edge to the liter, in each phase we remove the edge only if it is not detaching the graph how to impl...
Find Spanning Tree by removing hevieast weight
|spanning-trees|
null
From what I understand for Neural networks depending on the optimization method used Stochastic gradient Descent or Nesterov Acelerated Descent the convergence is bounded by $O (1/k)$ and $O(1/k^2)$ respectively. This is expressed in terms of loss reduction e.g. how quickly can the algorithm reduce error, where k is t...
null
I need to design the following algorithm: Given an undirected, simple, and connected graph $G=(V,E)$ and some positive weight function $w$. The algorithm needs to scan the edges from the heavier edge to the lightest; in each phase the algorithm removes the edge only if the graph remains connected after removal of th...
Find spanning tree by removing heaviest weight
From what I understand for Neural networks depending on the optimization method used Stochastic gradient Descent or Nesterov Acelerated Descent the convergence is bounded by $O (1/k)$ and $O(1/k^2)$ respectively. This is expressed in terms of loss reduction e.g. how quickly can the algorithm reduce error, where k is t...
null
null
I'm trying to modify [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) to perform a copy-on-write mapping when executing `fork()`. Most sources I can find online suggest to keep track of how many processes currently are able to read from a given copy-on-write page in the PTE. Once that number reaches 0 (either by `...
How does the OS track Reference Counters in Copy-on-Write forks?
|operating-systems|virtual-memory|
I'm trying to modify [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) to perform a copy-on-write mapping when executing `fork()`. Most sources I can find online suggest to keep reference counter of how many processes currently are able to read from a given copy-on-write page, storing the counter in the PTE. Only p...
I have to agree with both the suggestions by [Yves Daoust](https://cs.stackexchange.com/a/157050/161407) and [Ashish gupta](https://cs.stackexchange.com/a/147999/161407). The following observations should hold: * A $1 \times S$ block can only be a subset of a $T \times 1$ block if $ S = 1 $. * An $S \times 1$ bl...
I have to agree with both the suggestions by [Yves Daoust](https://cs.stackexchange.com/a/157050/161407) and [Ashish gupta](https://cs.stackexchange.com/a/147999/161407). The following observations should hold: * A $1 \times S$ block can only be a subset of a $T \times 1$ block if $ S = 1 $. * An $S \times 1$ bl...
null
I'm trying to modify [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) to perform a copy-on-write mapping when executing `fork()`, but I'm struggling to determine a concise way to manage the copy-on-write pages. Most sources I can find online suggest to keep reference counter of how many processes currently are abl...
null
I'm trying to modify [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) to perform a copy-on-write mapping when executing `fork()`, but I'm struggling to determine a concise way to manage the copy-on-write pages. Most sources I can find online suggest to keep reference counter of how many processes currently are abl...
null
Not necessarily, being polynomial-time solvable for graphs with bounded clique-width means that on graphs of clique-width less than $k$ an algorithm solves the problem in $O(n^{f(k)})$ time for some function $f$, so it only implies that the problem is XP (slice wise polynomial) with respect to clique-width. On the o...
null
In a typical modern operating system, there are three data structures which represent the state of memory. Also note I'm going to use Unix-ish terms for these; Windows has much the same concepts but may use different terms. 1. The *page tables* are the CPU's view of *virtual* memory. There is usually no "room" in a...
If a polygon is represented by its vertices(latitudes, longitudes), is it possible to find all the possible points or nodes(latitudes, longitudes). If so, what kind of algorithm is used. The polygon does not intersect itself and it does not have any holes.
How to generate all the possible nodes inside a polygon, if the polygon is represented by its vertices
|algorithms|complexity-theory|graphs|data-structures|
I wrote you a pseudocode of the algorithm, I don't think it's perfect, but you can take the idea. Take the vertices of the polygon as an array of pairs of latitude and longitude lines. GSize determines the number of matches in each dimension of the grid. For each point inside the polygon. // Determine the bo...
I wrote you a pseudocode of the algorithm, I don't think it's perfect, but you can take the idea. Take the vertices of the polygon as an array of pairs of latitude and longitude lines. GSize determines the number of matches in each dimension of the grid. For each point inside the polygon. // Determine the bo...
Thanks @Highheath in the comments, you are right. At first I found it hard to believe that I should be the first one to have found such an error in the 36+ years since this - apparently very popular - book is out. It is in its second edition since 2008, but I would have expected this part to have been in the first e...
null
null
null
***#Positive-2SAT*** is the problem of counting the number of satisfying assignments to a given Positive 2-CNF formula i.e 2-CNF formulas in which each literal is a positive occurrence of a variable. The following variant of *#Positive 2-SAT* is defined as follows : For example ,We are given a set of variables : ...
|complexity-theory|satisfiability|complexity-classes|counting|
This may be a simple problem ultimately. I am picturing a “rule” of “relative enumeration”. Let’s say you start with “19”. This means, there was another choice you missed - implying that you will input “1” and “9” in some order, you could also have done “91” - so now you do it, to balance it out. Now you have:...
Analysis of this (palindrome) sequence
|subsequences|
A weak entity type is an entity type identified by some attribute/s together some related object (https://en.m.wikipedia.org/wiki/Weak_entity) For instance, the room of a hotel might be seen as a weak entity type since it is identified by the hotel, and a number. A number itself cannot identify a room because there ...
It's in $\mathsf{P}$. Form an undirected graph with one vertex per variable and one edge per clause. This graph splits into a disjoint set of components, where each component is a simple cycle, a simple path, or an isolated vertice. For each component, you can count the number of satisfying assignments for that co...
The question is ambiguous, as [Steven has indicated](https://cs.stackexchange.com/questions/160621/complexity-of-a-variant-of-positive-2-sat/160824?noredirect=1#comment336533_160621). One possible interpretation is that there is one set per variable, or in other words, each variable can occur in only two clauses. T...
null
I'm looking for more examples of the following model of state machines: in [David Spivak's book on category theory](https://math.mit.edu/~dspivak/CT4S.pdf), he gives in section 3.1.2.10 and in application 4.3.1.9, a description of a finite state machine in terms of category theory. The basic definition is that you f...
State Machines as Functors
|computability|automata|simulation|category-theory|
null
Suppose we have a program like this: def feedback(number): final(number) def final(number): if number=2 or number=4: print(number) else: feedback(number/2) Which is self referential in a way how can we model such a program?
Programs with feedback?
|algorithms|computability|dynamic-programming|recursion|
Suppose we have a program like this: def feedback(number): final(number) def final(number): if number=2 or number=4: print(number) else: feedback(number/2) which is self referential in a way how can we predict the output of such functions? Do we have ...
Suppose we have a program like this: def feedback(number): final(number) def final(number): if number=2 or number=4: print(number) else: feedback(number/2) which is self referential in a way how can we predict the output of such programs? Do we have t...
null
The program you show has no output. It defined two functions called `feedback` and `final`, and does nothing after that. You probably meant to ask what happens if we *call* `final` with a given number? This can be analyzed quite easily, I suggest you do it as a useful exercise. Draw a table for values $n = \ldots, -...
***#Positive-2SAT*** is the problem of counting the number of satisfying assignments to a given Positive 2-CNF formula i.e 2-CNF formulas in which each literal is a positive occurrence of a variable. The following variant of *#Positive 2-SAT* is defined as follows : For example ,We are given a set of variables : ...
null
What is an algorithm that, given an input set of sequences S and size parameter K, returns a "codebook" data structure that has size no greater than K and can guarantee the shortest average encoding length at size K and below. $$ codebook = MysteryAlgorithm(S, K) $$ $$ T_i = encode(S_i, codebook) $$ Where th...
What algorithm constructs the optimal prefix tree of size K?
|information-theory|data-compression|
What is an algorithm that, given an input set of sequences S and size parameter K, returns a "codebook" data structure C that has size no greater than K and can guarantee the shortest average encoding length at size K and below. $$ C = MysteryAlgorithm(S, K) $$ $$ T_i = encode(S_i, C) $$ Where the encoded se...
What algorithm constructs the optimal codebook of size K?
What is an algorithm that, given an input set of sequences S and size parameter K, returns a "codebook" data structure C that has at most K codes and can guarantee the shortest average encoding length for codebooks with at most K codes. $$ C = MysteryAlgorithm(S, K) $$ $$ T_i = encode(S_i, C) $$ Where the en...
I'm looking at [Shannon's source coding theorem for symbol codes](https://en.wikipedia.org/wiki/Shannon%27s_source_coding_theorem#Source_coding_theorem_for_symbol_codes). It provides a very nice bound on codeword length $S = |f(X)|$: $$ \frac{H(X)}{log_2(a)} \le \mathbb{E}[S] \lt \frac{H(X)}{log_2(a)} + 1 $$ It...
What algorithm constructs the optimal code $f$ of size $a$?
I'm looking at [Shannon's source coding theorem for symbol codes](https://en.wikipedia.org/wiki/Shannon%27s_source_coding_theorem#Source_coding_theorem_for_symbol_codes). It provides a very nice bound on the expectation of codeword length, where codeword length is given by $S = |f(X)|$: $$ \frac{H(X)}{log_2(a)} \le...
I'm looking at [Shannon's source coding theorem for symbol codes](https://en.wikipedia.org/wiki/Shannon%27s_source_coding_theorem#Source_coding_theorem_for_symbol_codes). It provides a very nice bound on the expectation of codeword length, where codeword length is given by $S = |f(X)|$: $$ \frac{H(X)}{log_2(a)} \le...
I'm looking at [Shannon's source coding theorem for symbol codes](https://en.wikipedia.org/wiki/Shannon%27s_source_coding_theorem#Source_coding_theorem_for_symbol_codes). It provides a very nice bound on the expected code length $S=|f(X)|$ of an optimal code $f$ over the sequence variable $X$: $$ \frac{H(X)}{log_2(...
null
[Arithmetic codes](https://en.wikipedia.org/wiki/Arithmetic_coding) can get arbitrarily close to the Shannon limit, assuming your model of probabilities is correct. It it typically shown in the context of a binary alphabet, but there's nothing fundamental about that. It can work in any radix, as well as mixed-radix sys...
null
null
I was reading: https://stackoverflow.com/questions/34724201/whats-the-time-complexity-of-monte-carlo-tree-search Where it says: > The runtime of the algorithm can be simply be computed as O(mkI/C) > where m and k are the same as before, and I is the number of > iterations and C is the number of cores available....
How branching factor affects complexity of Monte Carlo Tree Search?
|algorithms|time-complexity|algorithm-analysis|runtime-analysis|monte-carlo|
null
null
The IR given in Appel's book ([Compiling with Continuations](https://www.cambridge.org/core/books/compiling-with-continuations/7CA9C36DCE78AD82218E745F43A4E740)) is certainly well explored and battle-tested in production compilers. I have been able to find several works based on or inspired by it (either by Appel himse...
Is there a proof of correctness for CPS translations into Appel's IR?
|reference-request|continuations|
null
null
Assuming that you intend to only count the total functions for $\mathsf{BigInt}$, then yes, equality should be decidable. Here's a sketch for how to do it for $i$ and $j$: 1. First test $i$ and $j$ on $\infty$. If they differ, then they are unequal. If they both yield $1$, then run the subsequent tests with $-i$ an...
Somehow turn the opaque lambdas <!-- language-all: ml --> ```python current_cont = lambda result: current_cont(current_value * result) ``` into transparent data ``` current_cont = Compose( current_cont, Mult(current_value)) ``` then use the fact that ``` Compose( Compose(a_cont, Mult(val)), Mult(current_...
null