instruction stringlengths 0 29.8k ⌀ |
|---|
null |
In the context of $\mathsf{\#P}$ and $\mathsf{PP}$, we have $\mathsf{\#P}$-complete problems, for example $\mathsf{\#SAT}$, however the version that I saw proves this by showing a reduction that keeps the same amount of results but not the same probability. My question is, is it also complete under probability. What I ... |
|complexity-theory| |
The whole story of complexity evaluations is that you count the operations that execute in *bounded* time (they also say in $O(1)$). Whether you consider a high-level language or concrete machine language, the costs need not be unit nor even constant (independent of the values of the arguments), this does not matter: a... |
In the below Image, S is the starting point and E is the end point.
[Image link](https://i.stack.imgur.com/J3sS1.png)
Now, the Title of the video says that its a Greedy Best First Search.
However, while browsing stackoverflow, I came across [this answer](https://stackoverflow.com/a/2082559/19264782)
It says... |
Is this Greedy Search or Uniform Cost Search? |
|search-algorithms|artificial-intelligence|greedy-algorithms| |
The whole story of complexity evaluations is that you count the operations that execute in *bounded* time (they also say in $O(1)$). Whether you consider a high-level language or concrete machine language, the costs need not be unit nor even constant (independent of the values of the arguments), this does not matter: a... |
The whole story of complexity evaluations is that you count the operations that execute in *bounded* time (they also say in $O(1)$). Whether you consider a high-level language or concrete machine language, the costs need not be unit nor even constant (independent of the values of the arguments), this does not matter: a... |
I have formulated the below optimization problem.
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/mAWO0.jpg
Let's call the problem $(P)$. In $(P)$: $w_i$ and $p_{ij}$, and $q_i$ are decision variable. Moreover, $\alpha_i,c_{ij},\beta_{i}$ are coefficients.
For the proof of bein... |
NP-Complete Proof - Using CFLP |
|complexity-theory|optimization|np-complete|complexity-classes| |
If an optimization problem A is NP-hard and P≠NP, then does there exist an instance x of A such that no polynomial algorithm provides an optimal solution for x?
|
NP-HARD optimization problem and instance correlation |
|complexity-theory|optimization|np-hard|polynomial-time|information-theory| |
I have formulated the below optimization problem.
\begin{align}\nonumber
\hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!+\!\sum_{i}\! \beta_{i}q_{i}\\
\text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\
& \sum_{j} d_j p_{ij} \leq b_i w_{i} , \fora... |
I have formulated the below optimization problem.
\begin{align}\nonumber
\hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!+\!\sum_{i}\! \beta_{i}q_{i}\\
\text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\
& \sum_{j} d_j p_{ij} \leq b_i w_{i} , \fora... |
I have formulated the below optimization problem.
\begin{align}\nonumber
\hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!+\!\sum_{i}\! \beta_{i}q_{i}\\
\text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\
& \sum_{j} d_j p_{ij} \leq b_i w_{i} , \fora... |
null |
What I mean by this, is let $f \in GapP$, and let $k_n =min\{k|\forall x (s.t. |x|<n):2^k > |f(x)|\}$ for every $n$, can I assume there is a nondetermenistic machine $M$ that on input $x$ does at most $k_n$ coin tosses with results in $\{0, 1\}$, and that for every $x$: $f(x)=\#(M(x)=1) - \#(M(x)=0)$, where $\#(M(x)=a... |
Given a GapP function can I assume there is an "optimal" function that solves it? |
|complexity-theory| |
You could look at semantics of programming languages textbooks that rely on category theory.
For instance:
Check out the books advised [here][1].
This is part of theoretical computer science. Dana Scott's work is particularly relevant. As is Lawvvere's later work, topos theoretic applications etc.
[1]: htt... |
I assume in this answer that $A$ is NP-complete, since otherwise it is possible that $A$ is unsolvable, or that the output size is super polynomial in $n$.
Assuming $A$ is NP-complete, let $x$ be some instance, and let $s$ be the optimal output for $x$. Let $\mathcal{A}$ be an algorithm that solves $A$ in (possibly ... |
Just set $\beta_i = 0$ instead of $q_i$. |
One kind of high-level operations that may not translate to constant-time machgine code are memory management operations, such as alloc/free or new/delete.
There are allocators with constant-time operations for constrained conditions (e.g. fixed block allocators, the stack), but for a general allocator _some_ opera... |
null |
Associative memory, also known as content-addressable memory is a memory that you access by supplying the tag rather than an address (using your terminology). For efficiency, the lookup is performed by specialized hardware.
It is useful for instance in pages systems, where you give a virtual page number and the memo... |
I'm new to computing and even newer still to AI model training. However I am wondering the role of the CPU during training of LLM. I'm aware that the CPUs are good for performing strings of complicated tasks one at a time while the GPU's parallelisation means that it can perform mutiple less complicated tasks at the sa... |
What does the CPU do in AI model training? |
|artificial-intelligence|cpu| |
I think that the whole approach is flawed. Modern compilers and computers are way to complex for that.
What you should do: Implement the code, measure the speed with good benchmarking software for a large variety of input values.
Analyse the result with statistics software. You will see if the runtime is linear,... |
Labor cost. 6x is an amazingly great work!
DoD kept awarding modular cellular designs on infinitely scalable FPGA arrays for many decades, and those projects have failed inevitably due to the lack of a distributed parallel model of computation. We just bunch whole bunch of von-Neumann cores to each other, than try t... |
I have this rather weird CPU architecture for which currently only an assembler exists. I won't go into too much details about this architecture as it is not publicly available. However, some quirks of it are:
- It can only address full 32 bit words in memory
- No shift operations
- No internal registers. It fu... |
Requirements to a CPU architecture to actually allow a C compiler to be built for it |
|computer-architecture|compilers|c| |
null |
So this is actually a very difficult question. It highly depends on the specific system used.
So first we have to clarify some naming issues:
> Reading the book, I've came to understand that there are atleast 2 clocks in the whole system. One is the System Clock which makes one of the lines within the Control Bus... |
null |
I'm not 100% sure about this but here's what I think:
> Would applying DeMorgan's rule to the minimal DNF result in the minimal CNF?
If you negate the expression and then apply De Morgan's laws you get a CNF for the negation of the original expression. I think it's also minimal though I don't have a rigorous proo... |
null |
null |
"A galactic algorithm is one that outperforms any other algorithm for problems that are sufficiently large, but where "sufficiently large" is so big that the algorithm is never used in practice."
Strassen algorithm works in $O(n^{2.8074})$
There is also the Coppersmith–Winograd algorithm which runs in $O(n^{2.37188... |
What's the fastest known non-galactic algorithm for Matrix multiplciaiton of large Matrixes |
|algorithms|complexity-theory|big-o-notation|matrices|matrix-multiplication| |
"A galactic algorithm is one that outperforms any other algorithm for problems that are sufficiently large, but where "sufficiently large" is so big that the algorithm is never used in practice."
Strassen algorithm works in $O(n^{2.8074})$.
There is also the Coppersmith–Winograd algorithm which runs in $O(n^{2.3718... |
What's the fastest known non-galactic algorithm for matrix multiplication of large matrices |
Associative memory, also known as content-addressable memory is a memory that you access by supplying the tag rather than an address (using your terminology). For efficiency, the lookup is performed by specialized hardware.
It is useful for instance in paging systems, where you give a virtual page number and the mem... |
There is asymptotic behaviour, and there is real time measurements. Asymptotic behaviour tells you how the time that your algorithm takes will grow as your problem size grows, assuming operations take constant speed. Things like adding, subtracting, multiplying, dividing will take constant speed, if the operands have a... |
I cannot provide an authoritative answer, but, besides key arithmetic support missing, this machine is lacking a stack mechanism, which precludes the implementation of function calls. These can be emulated by inlining, to a very limited extent, but that cannot decently be called C anymore. |
null |
null |
I cannot provide an authoritative answer, but, besides key arithmetic support missing, this machine is lacking a stack mechanism, which precludes the implementation of function calls. These can be emulated by inlining, to a very limited extent, but that cannot decently be called C anymore.
----------
**Update:**
... |
I am trying to find the first and second-order partial derivatives of a function of four variables $S$ using pythons symbolic math package sympy.
The issue is that sympy does not automatically see that certain pairs of partial derivatives, **when evaluated at the same arguments**, are in fact equal, and so cancellat... |
Sympy does not recognise when two partial derivatives happen to be equal |
|python| |
I need to find the empirical mode of a sample of numbers taken from a continuous distribution (i.e. floating-point data).
I can think of using an histogram, but choosing an appropriate bin size does not seem so easy. I could also count the values in a sliding Parzen window, but again, which window size ? I could als... |
Finding the mode of a continuous distribution |
|algorithms|statistics| |
I am unable to get the bound on the maximum size of a graph of order $n$ with girth $g$. Is there any literature regarding this. I know that there is an asymptotic bound on the size of a graph $G$ with even girth $2k$ and order $n$. Is there a similar one for arbitrary grith? Thanks beforehand. |
Maximum size of a graph with given girth |
|graphs|combinatorics|discrete-mathematics| |
I think you should substitute before differentiating:
`sympy.diff(S(x, y, u, v).subs({u: x, v: y}), x) == sympy.diff(S(u, v, x, y).subs({u: x, v: y}), u)` |
The *straightforward* solution is an easy but possibly inefficient solution, such as the one you can design for a small number of elements (e.g. sorting 1, 2 or 3 elements).
The *brute-force* solution is a particular case of straightforward solution, which tries all possibilities without caring for efficiency (for i... |
The *straightforward* solution is an easy but possibly inefficient solution, such as the one you can design for a small number of elements (e.g. sorting 1, 2 or 3 elements).
The *brute-force* solution is a particular case of straightforward solution, which tries all possibilities without caring for efficiency (for i... |
null |
null |
Given the SMALL FACTOR problem where:
- INPUT: an integer N and an integer k
- OUTPUT: yes ⇐⇒ N has a prime factor ≤ k.
I know that SMALL-FACTOR problem ∈ in NP ∩ CO-NP.
If it were NP-Complete we would have that CO-NP=NP.
So how can I answer the above question?
|
SMALL-FACTOR is not NPC. Is the statement true or false? |
|complexity-theory|np-complete|np|co-np| |
null |
When I calculate the entropy values of files compressed with Gzip, PKZIP, 7ZIP and Winrar, I find that the compression rate of Gzip is higher than the others. The entropy value is higher (indicating less redundancy) and the file size is smaller. Even for small files, the overhead of Gzip is lower compared to the other ... |
Compression Gzip/7Zip |
|algorithms|data-compression|filesystems| |
null |
null |
Edit: Since this post is gaining traction, I feel the need to clarify that the purpose of this is to see if asymptotic and constant factor estimations calculated from high level code implementations of algorithms are reasonable approximations of the true version. **I am not trying to predict the speed of code when runn... |
It is related to this question: https://leetcode.com/problems/product-of-array-except-self/
And assuming we cannot alter the original array, but have to allocate a same size array to store the results, that is, if the input array is 200GB, we need to allocate a 200GB array. Input 800GB, allocate extra 800GB. Input 1... |
Isn't allocating a same size array for result considered to be space complexity O(n)? |
|algorithms|space-complexity| |
null |
null |
null |
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.).
I've formalized the p... |
Minimal set of elements needed to satisfy property counts |
|algorithms|constraint-satisfaction|selection-problem| |
The Floyd-Warshall algorithm is typically used for computing the transitive closure of a directed graph, which is similar to finding the simultaneous reachability matrix in an NFA.
The time complexity of the Floyd-Warshall algorithm is (^3⋅|Σ|), which is an improvement over the (^4⋅|Σ|) complexity of the NFA product... |
null |
null |
I don't think the question is answerable without more context. If you observe a list of $n$ values $x_i$, there are multiple distributions that are consistent with the observed values, each with different modes. You would need to define what you mean by "the empirical mode" in this context.
For a discrete r.v., we... |
The binary search tree of @dw seems a good solution.
For something simpler, if the time density of messages is homogeneous, you can consider successive time intervals of a well-chosen fixed duration and associate to every interval the doubly-linked list of events that occurred, in chronological order. The intervals ... |
I don't have a complete answer yet, but it is actually easy to show that if it were true then we'd get $AWPP ⊂ BPP$, so I guess no we can't assume this. To prove this, let $L \in AWPP$, then there are $f \in GapP$ and $g \in FP$ s.t.: $x\in L => 2/3<f(x)/g(1^{|x|})<1$ and $x\notin L => 0 <f(x)/g(1^{|x|})<1/3$, but beca... |
I don't have a complete answer, but it is actually easy to show that if it were true then we'd get $AWPP ⊂ BPP$, so I guess no we can't assume this. To prove this, let $L \in AWPP$, then there are $f \in GapP$ and $g \in FP$ s.t.: $x\in L => 2/3<f(x)/g(1^{|x|})<1$ and $x\notin L => 0 <f(x)/g(1^{|x|})<1/3$, but becasue ... |
null |
I don't have a complete answer, but it is actually easy to show that if it were true then we'd get $AWPP ⊂ BPP$, so I guess no we can't assume this. To prove this, let $L \in AWPP$, then there are $f \in GapP$ and $g \in FP$ s.t.: $x\in L => 2/3<f(x)/g(1^{|x|})<1$ and $x\notin L => 0 <f(x)/g(1^{|x|})<1/3$, but becasue ... |
I have a problem that I am trying to model, but I am unable to capture one particularity of the system that seems to be crucial. I will try to give an abstract description first and then the toy model hoping that someone might have an idea or a reference suggestion.
**Description**: There is a system and I can obser... |
How to capture the update-delay of observable variable in a model? |
|optimization|modelling|time-series-analysis| |
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.).
I've formalized the p... |
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.).
I've formalized the p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.