instruction
stringlengths
0
29.8k
⌀
The Hidden Subgroup Problem under different mappings
|complexity-theory|quantum-computing|factoring|
The following problem statement is given: Let S = {s1, s2, ..., sn} be a sequence of unique positive integers and K a positive integer, where K >= si, for every i between 1 and n. Write an approximation algorithm which computes a sum which is at least half of the optimal solution on any given input. This algorithm mu...
Linear time, constant space maximum subset sum problem 1/2-approximation algorithm
|algorithms|dynamic-programming|approximation|subset-sum|
null
{"Voters":[{"Id":755,"DisplayName":"D.W."}]}
The following problem statement is given: Let S = {s1, s2, ..., sn} be a sequence of unique positive integers and K a positive integer, where K >= si, for every i between 1 and n. The goal is to find a subset of S whose sum is maximum, subject to the constraint that the sum must be <= K. Write an approximation algor...
{"Voters":[{"Id":755,"DisplayName":"D.W."}]}
null
Substantive reasons: Some PRNGs intended for statistical simulations are faster than cryptographic PRNGs. Yes, cryptographic PRNGs are pretty fast, but some statistical ones are even faster, and are good enough for some purposes. Non-technical reasons: There is a lot of inertia and many people just use whatever the...
null
null
On top of what D.W. said, scientific reproducibility is absolutely a real concern. I personally know a researcher who spent a couple of days ensuring that their PRNG was bit-for-bit accurate to an existing one, when writing a new Monte Carlo simulation in a different language. It's easier to make valid comparisons b...
The answer I found on the Internet is false. But my argument is that if I know that X is poly-time reducible to Y, which means I can use Y as a sub-routine to solve X, i.e., if I have a blackbox of Y that gives an answer to X and I am getting the answer in polynomial time (since X is in P), then the blackbox of Y must ...
If X is poly-time reducible to Y and X is in P, then Y is in P
|complexity-theory|np|p-vs-np|
null
I find it surprising that none of these answers use the abbreviations [SIMD][1] and [MIMD][2], which have been core architectural concepts for parallel processing since the [origin][3] of that term. [1]: https://en.wikipedia.org/wiki/Single_instruction,_multiple_data [2]: https://en.wikipedia.org/wiki/Multipl...
Background ---------- Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: Quicksort($a$): - (1) If length($a$) $> 1$, then - - 1.1) pivot $← a [1]$. - - 1.2) less $← a[a <$ pivot]. - - 1.3) equals $← a[a =...
How to derive a recursive formula for the number of comparisons using Quicksort with the median as the pivot?
|algorithms|time-complexity|asymptotics|runtime-analysis|big-o-notation|
Formula for the number of comparisons using Quicksort with the median as the pivot?
Call the decision problem in the question the bounded-union problem. Yes, the bounded-union problem is NP-hard. The following is a proof. ------ Consider (the decision version of) the hitting set problem, "Given $S=\{1,2,\cdots, m\}$, a list of $n$ subsets of $S$ $S_1, \cdots, S_n$ and an integer $s$, decide w...
I am self-learning a lot of Computer Science and Mathematics. I am using ChatGPT 4 to help me in this endeavor. Basically, if I like a set of lecture notes or if a book doesn't have solutions, I upload the relevant pages as pdf and convert them into LaTex code using Mathpix and then copy and paste the relevant sections...
Alternatives to Mathpix for converting pdf to LaTex code
|artificial-intelligence|education|mathematical-software|
Is the only reason for why a modern computer can't implement all computations is that the detailed specification of some algorithmic action (as a natural number) can be larger than what the storage space of the computer allows to process? I am trying to understand the difference in input implementation between Turi...
Why exactly can Turing Machines implement all computations but computers can't?
|turing-machines|
Your argument is wrong. There is no guarantee that there exists a blackbox that runs in polynomial time. If I had \$10, I could buy you a coffee. But that doesn't imply that I have \$10.
null
I know this is a very specific question, but: Let's assume that someone designed a 1.1 approximation algorithm for the load balancing problem involving exactly 2 machines. After running the algorithm on a set of n activities, the final loads are 80 for the first machine and 120 for the second one. Is this possible give...
Can there be a 1.1 approximation algorithm for the load balancing problem?
|algorithms|approximation|
null
Background ---------- Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: Quicksort($a$): - (1) If length($a$) $> 1$, then - - 1.1) pivot $← a [1]$. - - 1.2) less $← a[a <$ pivot]. - - 1.3) equals $← a[a =...
Background ---------- Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: > **Quicksort($a$):** > > - (1) If length($a$) $> 1$, then > > > > - 1.1) pivot $← a [1]$. > > - 1.2) less $← a[a <$ pivot]. > > - 1...
Background ---------- Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: > **Quicksort($a$):** > > - (1) If length($a$) $> 1$, then > > > > - 1.1) pivot $← a [1]$. > > - 1.2) less $← a[a <$ pivot]. > > - 1...
Number of comparisons using Quicksort with the median as the pivot?
Given two graphs $G$ and $F$ on the same vertex set $V$. Compute a sub set $\tilde{V}\subset V$ which' sub graph of $G$ is of maximum density and does not have any pair that is connected in $F$. Formally, find $$ arg\max_{\tilde{V}\subset V}\Bigg\{\frac{\big\vert {E(G)}_{\vert\tilde{V}}\big\vert}{\vert \tilde{V}...
You can easily write a Turing machine simulator in your favourite programming language. A universal Turing machine does not need many states, so you can then run the simulator on a universal TM, and indeed the only issue is the tape. If you implement the tape eg as a doubly-linked list, the simulator could could run...
Comparisons using Quicksort with the median as the pivot
Consider the problem of finding a perfect matching for a graph $G$ as a constraint satisfaction problem where the variables are the vertices and there is just one global constraint (which does not depend on the edges of $G$): My formulation of it is: Variables: A random subset of $|V|/2$ nodes $V'$ Domain: $...
Constraint Satisfaction Problem for Perfect Matchings
|artificial-intelligence|constraint-satisfaction|
I am not a CS student, just a layman trying to understand if the CPU development field is somewhat "stuck" in the past decades. If personal computer CPUs of the 2020's generally use more power than those of previous decades hence get hot faster and require more extensive and noisy cooling, I'd carefully assume that ...
Are there any radical approaches in CPU development?
|computer-architecture|cpu|
I was reading "Open Logic book", "Sequent Calculus". Given the fact that all antecedents must hold for at least one succedent to hold, I can't get rid off the impression that using a "comma" on the left side doesn't bring anything new, and I could simply replace it with "/\\". For example, let's take: [![enter i...
Sequent calculus: "a/\b => ... " vs "a,b => ..."
|logic|propositional-logic|
> What prevents me from treating the bottom part as if it was "$-\varphi \land \Gamma \implies \Delta$"? Nothing prevents you! In fact, this is exactly the right idea. You can think of the symbols in sequent calculus as follows: - comma on the left means $\land$ - comma on the right means $\lor$ - $\implies$ mean...
> What prevents me from treating the bottom part as if it was "$-\varphi \land \Gamma \implies \Delta$"? Nothing prevents you! In fact, this is exactly the right idea. You can think of the symbols in sequent calculus as follows: - comma on the left means $\land$ - comma on the right means $\lor$ - $\implies$ mean...
I was reading "Open Logic book", "Sequent Calculus". Given the fact that all antecedents must hold for at least one succedent to hold, I can't get rid off the impression that using a "comma" on the left side doesn't bring anything new, and I could simply replace it with "$\land$". For example, let's take: [![ent...
Sequent calculus and vs comma: $a \land b \implies ...$ vs $a, b \implies ...$
The genuine Quicksort is an in-place algorithm, and your version with concatenations uses extra memory and is much less efficient for this reason [$\Theta(n^2)$ instead of $O(n^2)$ with best case $O(n\log n)$]. Also, it is a waste of time to apply the trichotomy <, =, >, which costs two comparisons where you can do wit...
I am not a CS student, just a layman trying to understand if the desktop computer CPU development field is somewhat "stuck" in the past decades. If desktop computer CPUs of the 2020's generally use more power than those of previous decades hence get hot faster and require more extensive and noisy cooling, I'd carefu...
Background ---------- Using a simplified Quicksort algorithm where the first element of the array is assigned as the pivot we get the following pseudocode for the algorithm: > **Quicksort($a$):** > > - (1) If length($a$) $> 1$, then > > > > - 1.1) pivot $← a [1]$. > > - 1.2) less $← a[a <$ pivot]. > > - 1...
|algorithms|time-complexity|asymptotics|recurrence-relation|big-o-notation|
I am not a CS student, just a layman trying to understand if the desktop computer CPU development field is somewhat "stuck" in the past decades. If desktop computer CPUs of the 2020's generally use more power than those of previous decades hence get hot faster and require more extensive and noisy cooling, I'd carefu...
I am not a CS student, just a layman trying to understand if the desktop computer CPU development field is somewhat "stuck" in the past decades. If desktop CPUs of the 2020's generally use more power than those of previous decades hence get hot faster and require more extensive and noisy cooling, I'd carefully assum...
I am not a CS student, just a layman trying to understand if the desktop computer CPU development field is somewhat "stuck" in the past decades. If desktop CPUs of the 2020's generally use more power than those of previous decades hence get hot faster and require more extensive and noisy cooling, I'd carefully assum...
One way to look at these specific problems is to have states labeled $(x,y)$ where $x$ will correspond to the ones seen so far and $y$ similarly to the zeros so far. These are taken mod 2 or mod 3 respectively so, for instance the $y$ value 2 will represent $2,5,8,11,\dots$. You'll then have six states: $(0,0),(0,1)...
I was requested to draw the graph of a finite state machine whose language is $$L = \{ w \in \{0, 1\}: w \text{ has $2k$ ones and $3q$ zeros }\}$$ In other words, the number of ones must be even and the number of zeros must be a multiple of $3$. I have failed in my attempts to draw the graph of a DFA that sa...
Creating a deterministic finite automaton for strings of 2k ones and 3q zeros or a general language
|algorithms|automata|finite-automata|
I am studying Turing machine and Turing completeness and just remembered I saw something called the Turing test. It seems that the Turing test > is a test of a machine's ability to exhibit intelligent behavior > equivalent to, or indistinguishable from, that of a human. from [wikipedia][1] while Turing compl...
Does Turing test has anything to do with Turing complete or Turing machine?
|turing-machines|turing-completeness|turing-test|
In class, professor mentions that there are Stream and Storage devices. I mean to ask about Stream devices. I've also heard the terminology [character](https://linux-kernel-labs.github.io/refs/heads/master/labs/device_drivers.html) devices. On a Linux VM, the corresponding terminal devices can be seen via the `proc`...
Concept of a Stream Device
|computer-architecture|operating-systems|filesystems|
I have a data (from simulations) that is coming from something similar to a bifurcation diagram: it is a lower hemicontinuous correspondence (actually limit points of each branch is included), or in other words a set-valued function mapping a point in the domain to a (non-empty) set in the codomain such that the set is...
Clustering data to recover individual functions of a lower-hemicontinuous correspondence/bifurcation diagram
|algorithms|clustering|mathematical-analysis|numerical-analysis|
null
Suppose you have a computable function that dominates the busy beaver function. Then you immediately get that the busy beaver function is computable: given a machine of n states, simply run the machine for f(n) cycles, where f is your dominating computable function. If it quits note that number of cycles. If it doe...
I'm learning some computer science and mathematics by myself. I know that proving theorems in ZFC is undecidable in general, but, is there a formal way to express how complex it is? Is it as complex as the Halting Problem, i.e., knowing if a TM halts? Where can I learn more of this (subjects, books, articles)? Let m...
What is the complexity of theorem proving?
|complexity-theory|halting-problem|automated-theorem-proving|
null
null
In general, the complexity of theorem proving in a particular logical system (such as ZFC) is recursively enumerable (RE), and is complete for this class -- that is, equally as hard as solving the halting problem. To see this, we can show a reduction both ways: - First, to show that theorem proving is RE: the statem...
null
No, there is no relationship. The connection is that they are both based on concepts/work by Alan Turing, who was an early pioneer who made many advances.
This already exists. [Mobile processors](https://en.wikipedia.org/wiki/Mobile_processor) meet all of your requirements. There is a tradeoff between power consumption and processing speed. Many desktop CPUs are designed to maximize processing speed, at the cost of consuming more power; many mobile CPUs are designed t...
In general, the complexity of theorem proving in a particular logical system (such as ZFC) is recursively enumerable (RE), and is complete for this class -- that is, equally as hard as solving the halting problem. To see this, we can show a reduction both ways: - First, to show that theorem proving is RE: the statem...
This already exists. [Mobile processors](https://en.wikipedia.org/wiki/Mobile_processor) meet all of your requirements. There is a fundamental, unavoidable tradeoff between power consumption and processing speed. You can already buy CPUs that lie at different points along that tradeoff. Companies like Intel, AMD,...
null
null
null
null
Two areas of research to consider: - [Reversible logic][1], and in particular, [adiabatic circuits][2]. The idea here is to increase energy conservation as much as possible by not destroying information most of the time. - [Asynchronous logic][3]. The theory behind this is that the best CPU clock speed is no cloc...
### [Very closely related, but NOT a duplicate.][1] One time, I decided to test how long it takes to compute \$2^x\$ compared to \$e^x\$ in Python. I expected \$2^x\$ to be faster as in binary, the base computers use, you can just append 0 to the number 1 \$x\$ times. I entered into the shell: ```python >>> import t...
Why is \$e^x\$ faster to compute than \$2^x\$?
|time-complexity|
### [Very closely related, but NOT a duplicate.][1] One time, I decided to test how long it takes to compute \$2^x\$ compared to \$e^x\$ in Python. I expected \$2^x\$ to be faster as in binary, the base computers use, you can just append 0 to the number 1 \$x\$ times. I entered into IDLE: ```python >>> import timeit...
The reason is simple: `2**100` returns a bignum, with full accuracy. There is more work to handle the bignum representation than mere binary shifts. On the opposite, `e**100` returns a float and uses the built-in power function of the processor.
null