instruction stringlengths 0 29.8k ⌀ |
|---|
What are the 175 billion parameters used in the GPT-3 language model? |
|machine-learning|neural-networks|natural-language-processing| |
null |
Thanks to D.W., I searched for sources, and started to find plenty of references (many on comments on stackexchange, some papers), but eventually came to
https://math.stackexchange.com/questions/1609858/how-are-weakly-universal-turing-machines-actually-defined
This answers my question inasmuch as it directly disc... |
null |
null |
Gaussian kernel is [separable][1], which means you can do 1D-convolutions on every row, and then on every column. This already gives you $O(N^3)$ almost for free. If you do 1D-convolutions using FFT, then it'll be just $O(N^2 \log N)$.
[1]: https://en.wikipedia.org/wiki/Separable_filter |
The language is: `L1 = {w | n0(w) or n1(w) is prime}`
n0 means number of 0s and n1 means number of 1s I can show a^n (n is prime) is not context-free. But I can't find any solution for this one. |
How do I show language consisting prime number of 0s or prime number of 1s is not context-free? |
|context-free|pumping-lemma| |
You've actually missed an important prerequisite in your argument that $\emptyset \leq_m^p B$: You need that $B \neq \Sigma^*$ (the "tautology" problem $C$ you introduce later, where every instance is a "yes"-instance). But we do get that $\emptyset \leq_m^p B$ iff $B \neq \Sigma^*$, and with a very similar argument, t... |
Suppose it is context-free and let $n$ be the pumping length.
Consider $u = 0^p$, where $p$ is any prime number greater than $n$. It is clear that $u \in L$. The pumping lemma for context-free languages states that there exists a decomposition $u = vwxyz$ such that:
1. $|wxy| \leqslant n$;
2. $|wy| > 0$;
3.... |
I have simple polylines as sequences of points. I need a triangulation with a configurable width. The goal is to get a 2D 'band' from the input polyline without self-intersections.
So far I only found [this][1] approach, it suffers from self-intersections depending on the corners and the selected band width.
Is t... |
Triangulation of (2D) Polyline |
|triangulation| |
I have simple polylines as sequences of points. I need a triangulation with a configurable width. The goal is to get a 2D 'band' from the input polyline without self-intersections.
So far I only found [this][1] approach, it suffers from self-intersections depending on the corners and the selected band width:
[![e... |
null |
I am trying to create a circuit based on this truth table below:
can you describe how to make the circuit using only logic gates
In_1 In_2 In_3 Out
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 ... |
How do I create a circuit based on this truth table? The solution I implemented is not working as expected |
|algorithms|formal-languages|circuits| |
I don't know this software but as you have a fan-in of at least three, a simple OR gate should suffice as your function is 1 if at least one input is set to 1.
The input $(1, 0, 0)$ is evaluated to $0$ as your and gate will return $0$ and use this result together with the $0$s from $x_2, x_3$ in the OR gate but I do... |
I don't know this software but as you have a fan-in of at least three, a simple OR gate should suffice as your function is 1 if at least one input is set to 1.
The input $(1, 0, 0)$ is evaluated to $0$ as your AND gate will return $0$ and use this result together with the $0$s from $x_2, x_3$ in the OR gate but I do... |
I have simple polylines as sequences of points. I need a triangulation with a configurable width. The goal is to get a 2D 'band' from the input polyline without self-intersections.
Input is a 2D point sequence (Polyline) and a target width of the triangulated band. Output is the triangulation without self intersecti... |
The inner loop always executes `sum++` $j$ times. The middle loop lets $j$ vary from $0$ to $i^2-1$, so the count equals $\dfrac{(i^2-1)\,i^2}2$. The outer loop runs for $i$ from $0$ to $n-1$ hence
$$\sum_{i=0}^{n-1}\dfrac{(i^2-1)\,i^2}2\sim\frac{n^5}{10}.$$
----------
There is no real need to give a more accu... |
null |
Suppose that I have a self-balancing height-balanced binary search tree of size $N$ filled with random numbers.
If a node has a non-empty right subtree then I can find the next node by descending to the first node of the subtree.
1. What is the probability $p$ of a random node from the tree to have a non-empty ri... |
Wthat is the probability of a heigh-balanced BST node having the right subtree? |
|binary-search-trees| |
I have found two ways of applying dynamic programming to the coin change problem (finding the minimum number of coins from a set to make a sum), I wanted to know if one is better than the other:
```python
def money_dyn1(m, coins):
a = [[float("+inf") for j in range(m + 1)] for i in range(len(coins) + 1)]
... |
What is the best way to solve the coin change problem using dynamic programming? |
|algorithms|dynamic-programming|coin-change| |
Wthat is the probability of a height-balanced BST node having the right subtree? |
How can a 4-bit two's complement operation be implemented using boolean NOR gate?
I search lots of 4-bit two's complement videos and articals, but most of them are using XOR gate. |
Two's complement using logic gates |
|boolean-algebra| |
Boolean NOR is universal, so you can [construct an XOR gate or any other gate from NOR gates](https://en.wikipedia.org/wiki/NOR_logic), and then use the methods you've read about. |
{"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
I have a binary search tree of size $N$.
The tree is height balanced: difference of heights of a node's subtrees is no more than 1 (true for RB or AVL trees).
$p(N)$ is the probability that a node has a non-empty right subtree.
If the tree is intentionally created to minimize $p(N)$, then what is $min(p(N))$... |
What is the minimal probability of a height-balanced BST node having the right subtree? |
How can a 7 segment decoder operation be implemented using boolean NOR gate ONLY?
Question:[![enter image description here][1]][1]
Here's my truth table and k-map:
[![enter image desc... |
7 segment decoder Combinational Logic Circuits using Logic Gates |
|boolean-algebra| |
It's a fundamental property of any algorithm that it halts after some finite number of steps. Indeed, for many problems, it can be shown that such an algorithm does indeed exist, i.e., that no matter what (valid) input you give, it will always halt. That's a very desirable property just because such procedures are much... |
{"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
I have a binary search tree of size $N$.
The tree is height balanced: difference of heights of a node's subtrees is no more than 1 (true for RB or AVL trees).
$p(N)$ is the probability that a node has a non-empty right subtree.
If the tree is intentionally created to minimize $p(N)$, then what is $\min(p(N))... |
null |
A NOR can serve as an inverter, so 1's complement is easy. Now you need to implement two-bit adders to increment the result. A sum is a XOR ($a\oplus b=\overline{\overline{(\overline{(a+b)}+\overline{(\overline a+\overline b)})}}$, and the carry out an AND ($a\cdot b=\overline{\overline a+\overline b}$). |
A lot of information processing problems can be modelled as search problems: find a solution within a set. For example, find a number with certain properties (e.g. in numerical analysis or cryptography), or find a point in space with certain properties (e.g. in image processing or robotics), or find a string with certa... |
Universality of Turing machines and Turing completeness of arbitrary computational systems are two different things. There is a concept of a weakly universal Turing machine, but no analogous concept of weak Turing completeness.
[The question that you linked in your answer](//math.stackexchange.com/questions/1609858/... |
First, the halting problem is the fundamental building block that enables us to prove that many, many problems we care about are [undecidable](https://en.wikipedia.org/wiki/Undecidable_problem). See https://en.wikipedia.org/wiki/List_of_undecidable_problems.
Second, in some contexts, it is important to know that a ... |
I have a binary search tree of size $N$.
The tree is height balanced: difference of heights of a node's subtrees is no more than 1 (true for RB or AVL trees).
$K$ is the number of nodes that have a non-empty right subtree.
If the tree is intentionally created to minimize $K$, then what is $\min(K)$?
|
What is the minimal number of nodes with the right subtree in a height-balanced BST? |
null |
Given your requirement to minimize $K$, the number nodes with right subtree, while maintaining subtree height difference of at most 1,you should start with the AVL tree $T_h$ of height $h$, with minimum number of nodes. It is known that such tree has $F_{h+2} - 1$ nodes, where $F_i$ is the $i$<sup>th</sup> Fibonacci nu... |
null |
Given your requirement to minimize $K$, the number nodes with right subtree, while maintaining subtree height difference of at most 1,you should start with the AVL tree $T_h$ of height $h$, with minimum number of nodes. It is known that such tree has $F_{h+2} - 1$ nodes, where $F_i$ is the $i$<sup>th</sup> Fibonacci nu... |
Let $M$ be a $m\times n$, which rows and columns of $M$ are sorted in increasing.
**Problem.**
Find $k^{th}$ smallest number in $O(m\log(mn))$.
**My attempts.**
I merge all rows in a single sorted array in time $O(mn\log(mn))$ but this idea isn't efficient and I think there is a solution with running time $... |
Finding $k^{th}$ smallest in row and column-wise sorted matrix $m\times n$ |
|algorithms| |
null |
Let $M$ be a $m\times n$, in which rows and columns of $M$ are sorted in increasing.
**Problem.**
Find $k^{th}$ smallest number in $O(m\log(mn))$.
**My attempts.**
I merge all rows in a single sorted array in time $O(mn\log(mn))$ but this idea isn't efficient and I think there is a solution with running tim... |
Yes. You can set P to be false. However, the resulting statement won't be very useful.
Let's back up, and consider how to interpret a statement like `P {x=2} x==2`. This is saying that for every state of the program that satisfies `P`, if you execute `x=2` in that state, then the state of the program afterwards w... |
null |
Yes. You can set P to be false. However, the resulting statement won't be very useful.
Let's back up, and consider how to interpret a statement like `P {x=2} x==2`. This is saying that for every state of the program that satisfies `P`, if you execute `x=2` in that state, then the state of the program afterwards w... |
I came up with a thought experiment on the limits of artificial intelligence that I was hoping to get advice on how to solve as well as any recommendations for further reading that explain relevant concepts for solving/dissolving the thought experiment.
Suppose some superpowerful artificial intelligence A1 attempts... |
Thought experiment about two AIs involved in an infinite game |
|reference-request|artificial-intelligence| |
This problem can be solved in $O(n\log n)$ time.
As an example, consider the square matrix $M = \begin{bmatrix}a & b & c \\ d & e & f \\ g & h & i\end{bmatrix}$ where $M_{i,j} \leq M_{i+1,j}$ and $M_{i,j} \leq M_{i,j+1}$.
To visualise the solution, organise the matrix into a lattice.
[![Depiction of the matrix... |
null |
The premise that A2 can watch A1's simulation seems poorly motivated. As we all know, if we want to predict someone's actions, we shouldn't tell them our prediction, otherwise they might behave contrarily just to spite us. In practice, most settings that I can imagine where I would want to simulate another agent, not... |
null |
Data structure that can be used for the aforementioned situation :
**AVL tree :** The self-balancing feature of AVL tree guarantees the performance of O(logN) in the worst case for all operations, including insertion, deletion, and searching.
**Disadvantage of AVL tree :** It's a complex data structure. if th... |
null |
null |
null |
null |
Let $M$ be a $m\times n$, in which rows and columns of $M$ are sorted in increasing.
**Problem.**
Find $k^{th}$ smallest number in $O(m\log(mn))$.
**My attempts.**
I merge all rows in a single sorted array in time $O(mn\log(mn))$ but this idea isn't efficient and I think there is a solution with running tim... |
You can use the following systematic transformation
$$\bigvee_{i=1}^{m}\left(\bigwedge_{j=1}^{n_i} v_{i,j}\right)
=\overline{\left(\overline{\bigvee_{i=1}^{m}\left(\bigwedge_{j=1}^{n_i} v_{i,j}\right)}\right)}
=\overline{\left(\overline{\bigvee_{i=1}^{m}\left(\overline{\bigvee_{j=1}^{n_i}\overline{v_{i,j}}}\right)... |
null |
The interesting question is how to prove the equivalence (and what that equivalence actually means) under some required restrictions.
The required restrictions are that your function's code must be "fully parametric": no specific types, no run-time identification of type parameters, no reflection, and of course no s... |
The interesting question is how to prove the equivalence (and what that equivalence actually means) under some required restrictions.
The required restrictions are that your function's code must be "fully parametric": no specific types, no run-time identification of type parameters, no reflection, and of course no s... |
The interesting question is how to prove the equivalence (and what that equivalence actually means) under some required restrictions.
The required restrictions are that your function's code must be "fully parametric": use only type parameters and never any specific types; no run-time identification of type parameter... |
null |
The 175 billion parameters in the GPT-3 language model are values that are used by the model to make predictions about the next word or words in a sentence or piece of text. These parameters are essentially the weights that are applied to the input data in order to make the model's predictions. In a neural network, the... |
I have simple polylines as sequences of points. I need a triangulation with a configurable width. The goal is to get a 2D 'band' from the input polyline without self-intersections.
**Description:**
Input is a 2D point sequence {P1, ..., Pn} (Polyline) and a target width of the triangulated band. Output is the tri... |
While working on a job distribution problem, I ended up hitting a graph problem that I can't seem to get a foothold on.
Consider a not-necessarily connected graph, like one shown below. Each step, we can delete up to N vertices from the graph, but can't delete two nodes if they are connected, only one or neither of... |
Vertex deletion algorithm with connected constraint |
|graphs| |
null |
If a graph has $n$ vertices then there is the obvious upper bound of $n$ steps where one vertex is removed in each step.
If a disconnected graph $G$ is composed of several connected components, the total number of steps required to remove all the vertices from $G$ is equal to the number of steps required to remove ... |
If a graph has $n$ vertices then there is the obvious upper bound of $n$ steps where one vertex is removed in each step.
If a disconnected graph $G$ is composed of several connected components, the total number of steps required to remove all the vertices from $G$ is equal to the number of steps required to remove ... |
This problem is known as *mutual exclusion scheduling*. This problem is NP-hard for all $N \geq 3$ [1].
When $N = 2$, this is equivalent to the [minimum edge cover problem](https://en.wikipedia.org/wiki/Edge_cover) on the complement graph. It is solvable in polynomial time by a graph matching algorithm.
This prob... |
[There is an $O(n)$ solution](http://www.cse.yorku.ca/~andy/pubs/X+Y.pdf). See discussion [here](https://softwareengineering.stackexchange.com/questions/233031/given-two-sorted-array-in-ascending-order-with-same-length-n-calculate-the-kth).
\[1\]: http://www.cse.yorku.ca/~andy/pubs/X+Y.pdf
\[2\]: https://software... |
null |
Nice question!
##### We are computing entries in a matrix.
We are computing the minimum number $a[i][m]$ of coins to yield value $m$ using the first $i$ coins for all valid $i$'s and $m$'s using the recurrence relation
$$a[i][m]=\begin{cases}a[i-1][m]&\text{if }m<coins[i]\\\min(a[i-1][m], a[i-1][m-coins[i]+1)&\text{... |
I have found two ways of applying dynamic programming to the coin change problem of finding the minimum number of coins from a given set of denominations to make a given sum. I wanted to know if one is better than the other:
```python
def money_dyn1(m, coins):
a = [[float("+inf") for j in range(m + 1)] for i i... |
[There is a $O(n)$ time solution](http://www.cse.yorku.ca/~andy/pubs/X+Y.pdf). See discussion [here](https://softwareengineering.stackexchange.com/questions/233031/given-two-sorted-array-in-ascending-order-with-same-length-n-calculate-the-kth).
\[1\]: [Selection in X+Y and Matrices with Sorted Rows and Columns](http... |
null |
How to solve this recurrence relation:
T(n) = R(n-1) + n log n
R(n) = T(n-1) + n2 |
How to solve this recurrence relation: T(n) = R(n-1) + n log n R(n) = T(n-1) + n2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.