instruction stringlengths 0 29.8k ⌀ |
|---|
Taking the square root of $n$ halves the number of bits, so you indeed halve that number $\lg n$ times before the iterated square root falls below some predefined constant (say $4$).
Now we can write
$$n+\sqrt n+\sqrt[4]n+\sqrt[8]n+\cdots<n+\sqrt n+\sqrt n+\sqrt n+\cdots=n+\sqrt n\lg n,$$ which is $O(n)$.
--... |
$$\frac{n^n}{n!}=\frac{n\cdot n\cdot n\cdots n\cdot n}{n(n-1)(n-2)\cdots 2\cdot 1}=\frac nn\frac{n}{n-1}\frac{n}{n-1}\cdots\frac n2\frac n1>1\cdot1\cdot1\cdots1\cdot n$$ is sufficient.
(In fact, by the same argument the ratio is $\Omega(n^k)$ for all $k$, and $n^n\notin O(n^kn!)$.) |
null |
Consider this situation. A few clients are connected to a server over the internet.
I define network latency as the time between request leaving the client and reaching the server.
What distributions (i.e. gaussian, uniform, exponential) do network latencies ***typically*** follow? |
distribution choice for network latency |
|probability-theory|computer-networks| |
Exact estimation, from both sides, can be obtain from
$$\left(\frac{n}{e} \right)^n< n! < e\left(\frac{n}{2} \right)^n$$ |
Thanks for the question. The model construction for the separation logic heap in cvc5 was wrong in this case. This will be fixed by https://github.com/cvc5/cvc5/pull/9574. |
$n! = 1 \cdot 2 \cdot 3 ... \cdot n ≤ 1 \cdot n \cdot n ... \cdot n = n^{n-1} = n^n / n$. Or $n^n ≥ n \cdot n!$. So clearly not O (n!). |
null |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
I am working on a Genetic (or rather Memetic) Algorithm for optimizing a scheduling problem.
I have *n* orders to schedule and the solution representation is an array of *n* integers that specify when an order takes place.
Mutation probabilities are typically given as that, probabilities. This however leads to weir... |
Mutation probability on strongly varying chromosome length |
|genetic-algorithms| |
I'm trying to find a problem description that is roughly akin to a budgeted min-cost max-weight bipartite matching where the capacities are greater than 1. Imagine a max-flow problem where we have a bipartite graph where the nodes on the left are connected to many nodes on the right, but any "cluster" of nodes on the r... |
Budgeted min cost max flow in bipartite where the flows must also be a matching set |
|graphs|optimization|network-flow|matching|bipartite-matching| |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
null |
I am trying to detect forbidden moves for black in a game called Renju. First, here is an explanation of how Renju works.
Renju is a board game played on a 15x15 Go board. There are two players in the game, which we will call black and white, and they place stones of their color on the board turn by turn. Black star... |
Checking forbidden moves in Renju |
|algorithms|dynamic-programming|board-games| |
Exact estimation, from both sides, can be obtain from
$$\left(\frac{n}{e} \right)^n< n! < e\left(\frac{n}{2} \right)^n$$
i.e.
$$\frac {2^n}{e} \cdot n!<n^n<e^n \cdot n!$$ |
I don't know if a solution to this problem is too complicated to figure out, but I've been banging my head on it for a couple weeks, so I'm hoping for an outside point of view.
I have a list of 88 files today from different sources:
Alpha sent 9 files.
Beta sent 7 files.
Gamma sent 19 files.
Delta sent 1... |
Dividing a list of files with constraints |
|algorithms| |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
I learned years ago that $IP \subseteq PSPACE$ since you could simulate all sets of messages and then determine the probability of success. But lately I’ve been looking at [the standard proof of this][1] and I'm having trouble with it.
I get that we can build a tree and look at the proportion of transcripts that cau... |
How does the standard proof that IP is in PSPACE apply in a zero-knowledge setting? |
|graph-isomorphism|interactive-proof-systems| |
Consider these 2 questions where recurrence relations can be applied:
Q1) Given an (nxm) where n denotes rows and m denotes columns of a grid, find the number of unique paths ($a_{n,m}$) that goes from the top left corner of the grid to the bottom right corner of the (nxm) grid. Rule: Can only move downwards or righ... |
Does a bijective function exists behind every recurrence relation? |
|recurrence-relation|recursion|towers-of-hanoi| |
This is usually shown by an application of Statistical No Free Lunch.
But I am wondering if it follows directly from the definition of PAC learnability and the sample complexity VC bound.
In particular if it's PAC learnable we know that for any $\epsilon$ and $\delta$ we have a sample complexity lower bound $m(\e... |
Infinite VC Dim not PAC learnable |
|learning-theory|vc-dimension| |
Recently, I’ve been interested in the console of the Source game engine, more specifically, its `alias` command, which allows one command to invoke others. It may allow recursion (i.e. running `alias freeze freeze` will cause inputting `freeze` to freeze the engine), but does not allow parameters (i.e. running "`alias ... |
The rules are recursive in some sense, but note that the recursive parts depend on collections of one stone larger. Since 5 is the largest number of stones to check for, the depth of the recursion is constant, so you only need to test a constant number of board positions to check if a move is valid.
In particular, t... |
null |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empirically) up to a thresh... |
Benchmark of SAT solvers on random k-SAT instances close at satisfiability threshold |
|satisfiability|sat-solvers|benchmarking| |
Benchmark of SAT solvers on random k-SAT instances close to satisfiability threshold |
Benchmark of SAT solvers on random k-SAT instances at satisfiability threshold |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT ($4 \leq k \leq 8$) operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empiric... |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT ($4 \leq k \leq 8$) operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empiric... |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT ($4 \leq k \leq 8$) operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empiric... |
I am looking for a solid reference (peer-reviewed publication) on the design and/or benchmarking of SAT solvers for random k-SAT ($4 \leq k \leq 8$) operating at satisfiability threshold.
The majority of published algorithmic works I know on SAT solving focuses on solvers running in polynomial time (at least empiric... |
null |
null |
null |
No, it is impossible. The base64 encoding of any (non-zero-length) string is always longer than the string itself.
The base64 encoding of the empty string is the empty string, so arguably the empty string could be considered an example of the sort you are looking for. But there are no other examples. |
null |
<sub>**Note:** I first encountered this question at work. Since I do **not** want to leak any information pertaining to my employment, I shall present a *toy project* instead.</sub>
---
The motivation for this question is as follows. Suppose that I have a list of fruit that I want to buy at a farmers' market, e... |
What is the type of a type signature? |
|reference-request|type-theory|haskell| |
<sub>**Note:** I first encountered this question at work. Since I do **not** want to leak any information pertaining to my employment, I shall present a *toy project* instead.</sub>
---
The motivation for this question is as follows. Suppose that I have a list of fruit that I want to buy at a farmers' market, e... |
<sub>**Note:** I first encountered this question at work. Since I do **not** want to leak any information pertaining to my employment, I shall present a *toy project* instead.</sub>
---
The motivation for this question is as follows. Suppose that I have a list of fruits that I want to buy at a farmers' market, e... |
For example, using [GHCi][1],
ghci> f x = x + 1
ghci> :t f
f :: Num a => a -> a
What is the type of the [type signature][2] `f :: Num a => a -> a`?
---
**Motivation**
I first encountered this question at work. Since I do **not** want to leak any information pertaining to my employment, I sh... |
Question is to construct a regex where all strings containing an even number of 0's:
By constructing DFA graphically, it is
$$(1^*+01^*0)^* $$
But it is also
$$1^* + (01^*01^*)^*$$
Can we prove that they are equal algebraically?
|
Regex where all strings containing an even number of 0's: |
|automata|finite-automata|regular-expressions| |
null |
Dropping the factor $5$ by $T:=5S$, and with $S(10)=0$ (arbitrarily):
$$S(100)=S(10)+100=100$$
$$S(10000)=S(100)+10000=10100$$
$$S(100000000)=S(10000)+100000000=100010100$$
$$S(10000000000000000)=S(100000000)+10000000000000000=10000000100010100$$
It is clear that $S(n)$ gets closer and closer to $n$ in terms o... |
This is usually shown by an application of the Statistical No Free Lunch Theorem.
But is this possible to show this by working simply with the definition of PAC learnability and the sample complexity VC bound.
In particular if it's PAC learnable we know that for any $\epsilon$ and $\delta$ we have a sample comple... |
null |
I'm trying to find a problem description that is roughly akin to a budgeted min-cost max-weight bipartite matching where the capacities are greater than 1. Imagine a max-flow problem on a graph that looks like this:
[![graph][1]][1]
Each node on the left is connected to a set of nodes on the right, but the nodes ... |
Dropping the factor $5$ and reducing by $S(n):=\dfrac{T(n)}{5n}$, and with $S(10)=0$ (arbitrarily):
$$S(100)=\frac{S(10)}{10}+1=1$$
$$S(10000)=\frac{S(100)}{100}+1=1.01$$
$$S(100000000)=\frac{S(10000)}{10000}+1=1.000101$$
$$S(10000000000000000)=\frac{S(100000000)}{100000000}+1=1.00000001000101$$
It is clear th... |
Dropping the factor $5$ and reducing by $S(n):=\dfrac{T(n)}{5n}$, and with $S(10)=0$ (arbitrarily):
$$S(100)=\frac{S(10)}{10}+1=1$$
$$S(10000)=\frac{S(100)}{100}+1=1.01$$
$$S(100000000)=\frac{S(10000)}{10000}+1=1.000101$$
$$S(10000000000000000)=\frac{S(100000000)}{100000000}+1=1.00000001000101$$
It is clear th... |
Question is to construct a regex where all strings containing an even number of 0's:
By constructing DFA graphically, it is
$$(1^*+01^*0)^* $$
But it is also
$$1^*(01^*01^*)^*$$
Can we prove that they are equal algebraically?
|
Consider this :
int[][] data = {1,2,3}, {4,5,6}, {7,8,9};
for(int i = 0; i < data.length; i++){ //Rows
for(int j = 0; j < data[i].length; j++){ //Columns
int elements = data[i][j];
System.out.println(elements + " ");
}
}
In a Row-Major traversal of an array, the elements are stored ... |
We want to find, $T(n) = T(\sqrt{n}) + 5n$
Assume $T(2) = c > 1$.
So $T(2^k) = 5 c + 5 c^2 + 5 c^4 + \cdots + 5 c^k.$
Now $ (c + c^2 + c^4 + \cdots + c^{k-1}) < kc^{k-1} = o(c^k).$
Thus $T(n) = T(2^k) = 5( c^k + o(c^k) ) = O(5n).$
|
We want to find, $T(n) = T(\sqrt{n}) + n$
Assume $T(2) = c > 1$.
So $T(2^k) = c + c^2 + c^4 + \cdots + c^k.$
Now $ (c + c^2 + c^4 + \cdots + c^{k-1}) < kc^{k-1} = o(c^k).$
Thus $T(n) = T(2^k) = ( c^k + o(c^k) ) = O(n).$
|
We want to find, $T(n) = T(\sqrt{n}) + 5n$
Assume $T(\epsilon) = c > 1$, $\epsilon > 1$ .
So $T(\epsilon^k) = c + 5(c^2 + c^4 + \cdots + c^k).$
Now $ 5(c + c^2 + c^4 + \cdots + c^{k-1}) < 5 kc^{k-1} = o( c^k).$
Thus $T(n) = T(\epsilon^k) = ( 5 c^k + o(c^k) ) = O(5n).$
... |
According to the wikipedia page on [Kleene Algebra][1], we can use two properties:
- $(a^*)^*= a^*$
- $(a+b)^* = a^*(b(a^*))^*$
If you allow those it is quite straightforward:
$(1^∗+01^∗0)^∗ = (1^∗)^*\cdot (01^∗0(1^*)^* )^∗ = 1^∗(01^∗01^* )^∗$.
[1]: https://en.wikipedia.org/wiki/Kleene_algebra |
We want to find, $T(n) = T(\sqrt{n}) + 5n$
Assume $T(\epsilon) = c > 1$, $\epsilon > 1$ .
So $T(n) = T(\epsilon^{2k}) \\
= c + 5(\epsilon^2 + \epsilon^4 + \cdots + \epsilon^{2k}) \\
< c + 5((k-1)\epsilon^{2(k-1)} + \epsilon^{2k})\\ = c + 5 (o(\epsilon^{2k}) + \epsilon^{2k}) = O(5n)$
|
How to generate all possible color vectors that could be generated via greedy coloring. |
How to generate all possible colour vectors generated by greedy colouring on a graph? |
|algorithms|graphs|discrete-mathematics|greedy-algorithms|colorings| |
null |
Your number is in $(0,1)$, and you want $b$ bit precision after the faction point. black_box return $1$ if $x \geq a$ else $0$.
The following code will provide your answer.
function precise_float(black_box, b):
x = 0
for i = 1 to b:
x = 2*x + black_box(x)
return x
... |
No it is not.
MT is based on a twisted generalized feedback shift register. It is defined on vector spaces over finite fields, specifically [$GF(2)$](https://en.wikipedia.org/wiki/GF(2)).
The LCG is based on integer arithmetic over the integers modulo $n,$ say $\mathbb{Z}_n.$
The two algebraic structures ar... |
null |
null |
null |
null |
The base64 encoding of the empty string is the empty string, so arguably the empty string could be considered an example of the sort you are looking for. But there are no other examples. The base64 encoding of any (non-zero-length) string is always longer than the string itself. |
null |
null |
null |
Have seen [library code][1] for finding square-root, using the Newton Raphson method.
It uses a table of 256 entries, whose significance is unclear, as the initial guess should be dependent on the quantity (x), whose square-root need be found.
So, request if some details could be given.
It states about it, that :... |
Details of sqrt.c library source code |
|algorithms|c| |
|algorithms|approximation|numerical-algorithms| |
You are in fact asked to find $b$ independent bits of information (such that $2^{-b}\sim10^{-k}$)*, using queries that return a single bit of information each. So you can't get an answer in less than $b$ queries in the worst case, and this is achieved by binary search.
----------
*Justification: the problem is eq... |
This is by far not an answer, but a first hint. Below, a plot of the content of the lookup-table, which shows a square-root-like behavior, with a jump of $2^{16}$ in the middle. This table is addressed with the eight first bits of the mantissa.
[![enter image description here][1]][1]
[1]: https://i.stack.imgu... |
This is by far not an answer, but a first hint. Below, a plot of the content of the lookup-table, which is addressed with the eight first bits of the mantissa.
The values in the table are in fact two bytes packed together but later processed independently. The blue byte is for $g$ and the orange for $y$. We have shi... |
I expected CVC5 to produce a proof given the following problem in TPTP format.
Why does CVC5 give up on the TPTP problem, but works just fine on the same problem given in SMT-LIB2?
In human words, the problem says that all values `X` of type `tA` are in the unary relation `rel`. And given some arbitrary value `a`... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.