instruction
stringlengths
0
29.8k
⌀
I am studying Turing machines 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 comp...
Does the Turing test have anything to do with Turing completeness or Turing machines?
null
K = {<J, a, b, c> : J is a Java program, a, b, and c are integer variables declared in J, and throughout the execution of J, a never has the same value as b and a never has the same value as c}. I'm aware the problem is not actually decidable as I performed a reduction from ATM (or halting problem), which proves it ...
Is this java program decidable? if not is it or complement not Turing-recognisable
|complexity-theory|turing-machines|turing-recognizable|
K = {<J, a, b, c> : J is a Java program, a, b, and c are integer variables declared in J, and throughout the execution of J, a never has the same value as b and a never has the same value as c}. I'm aware the problem is not actually decidable as I performed a reduction from ATM (or halting problem), which proves it ...
is this lanuage or it' complement not Turing-recognisable
When we say that X is polytime reducible to Y, it means that Y is at least as hard as X or that X is no harder than Y. The hardness of X does not affect the hardness of Y since Y is at least as hard as X; it can be even harder (may be NP or NP-complete) than X. Therefore, if X is in P, then it is not necessary that Y i...
null
The complement of your language $K$ is easily seen to be recognizable: If $J$ isn't a valid Java programme, or it is lacking the specified integer variables, we can easily tell. Otherwise, we run the Java programme and monitor the values of $a$, $b$ and $c$. If we see $a$ to have the same value as $b$, or if we see $a$...
null
null
null
Suppose I have already sorted an array $a$ of length $N$, each element having its position index into the sorted result recorded together with the element. Now I randomly sampled a sub-array $b$ of the original array $a$ without putting back (that is, no duplicated elements). Since the position index is recorded togeth...
Ask for an algorithm for sub-ordering a sub-array of an already sorted super-array
|algorithms|sorting|
_I hope this is the correct subpage of SE, if not please direct me to the more appropriate place._ Imagine the following scenario: You are put into a random but known position inside a given maze. The maze contains, in addition to walls (█) and pathways (.), the following things: - R - A **refresh point** whic...
null
I found the following question in my book and I have no clue on what the answer should be: > What is the condition on search graph so that BFS on a graph and BFS on a tree **generate and expand** identical nodes in the same order? I'm not thinking of any correct condition, can you help me with this? Please don'...
BFS on a graph and BFS on a tree
|algorithms|graphs|trees|artificial-intelligence|game-theory|
Although I understand the definition of batch processing (a method of running software programs called jobs in batches automatically) and some applications of this system (bank statements and payroll and timesheet processing), how do emails use this system? I saw that emails use this system, but how are emails done in ...
How do emails use batch processing sytems?
|operating-systems|
null
I realize that Java bytecode uses (absolute/relative) address offset instead of (symbolic) labels in its jumping instructions such as `goto`. Then I know that backpatching is indeed useful during intermediate code generation. (`javac` uses backpatching.)
215201 is logical address space provided to us which means it is a process size. 1 KB is page size which is equivalent to 2^10 or 1024 Bytes. Process divided by page size gives a quotient and remainder, 215201/1024 = 210 quotient which is number of pages and 161 as a remainder which is offset.
null
Here is an example: Assume a database that is maintained in a school. Here, T1 is a course enrollment table, where the (roll_number, course_number) is a primary key. It says which student has enrolled in which course. Then, T2 is a course_details table where the primary key is (course_number, instructor_code). Thi...
Here is an example: Assume a database that is maintained in a school. Here, T1 is a course enrollment table, where the (roll_number, course_number) is a primary key. It says which student has enrolled in which course. Then, T2 is a course_details table where the primary key is (course_number, instructor_code). Thi...
Here is an example: Assume a database that is maintained in a school. Here, T1 is a course enrollment table, where the (roll_number, course_number) is a primary key. It says which student has enrolled in which course. Then, T2 is a course_details table where the primary key is (course_number, instructor_code). Thi...
$FPT$ is the set of parameterized problems that are fixed-parameter tractable. If $L_{w,h}$ is the language associated to boolean circuits of weft $w$ and depth $h$, then $W[t]$ is the set of parameterized problems that can be fixed-parameter reduced to $L_{t,h}$ for some constant $h$. (I know that there are multiple e...
But why *is* $FPT$ a subset of $W[1]$?
|parameterized-complexity|
null
I want to find how many shortest paths are there from Node A to node B. For example, let's say we have a graph with 3 nodes and 3 connections: from 1 to 2 weight 5 from 1 to 3 weight 11 from 2 to 3 weight 6 The answer is 2. Also I should keep track what vertices were visited for every path. In the example above,...
How can I track multiple shortest paths from one node to another using Dijkstra / Bellman-Ford
|graphs|graph-traversal|weighted-graphs|dijkstras-algorithm|
A problem $P$ in FPT has a parametrized reduction to _any_ parametrized decision problem that has at least one "true" and "false" instance. The reduction algorithm has enough time to compute whether an instance of $P$ is true or false (because $P$ is in FPT), and can then simply map it to one of the true or false insta...
I would like to know if there exist some complexity classes that are defined according to the integrality gap of their problems? In particular, is there a class of problems for which their integrality gap is unbounded? Where by unbounded integrality gap, I mean an integrality gap that is equal to infinite, where...
Integrality gap and complexity classes
|complexity-theory|optimization|complexity-classes|integer-programming|
I found the following question in my book and I have no clue on what the answer should be: > What is the condition on search graph so that BFS on a graph and BFS on a tree **generate and expand** identical nodes in the same order? I'm not thinking of any correct condition, can you help me with this? No need to ...
null
*Kindly Note, The question was updated as there was a typo which confused some people and lead them to understand a total different question.* I found the following question in my book and I have no clue on what the answer should be: > What is the condition on search graph so that BFS Algorithm for graph and BF...
From [OSTEP Chp. 43](https://pages.cs.wisc.edu/~remzi/OSTEP/file-lfs.pdf): > The imap is a structure that takes an inode number as input and produces the disk address of the most recent version of the inode This makes sense to me as a solution to the problem of LFS scattering needing to keep track of inodes. ...
Log-Structured Filesystem -- why do we need an explicit, scattered inode map?
|data-structures|operating-systems|memory-hardware|filesystems|
null
Basic approach ============== I suggest you reduce this to a longest path problem in a directed graph. In particular, conceptually we imagine the entire state space, and build a graph with one vertex per possible state in the state space, with edges representing moves you can make in a single step. More specifi...
The only time guarantee you get from "$X$ is polytime reducible to $Y$" is that the time required to form $X$ into an input for the $Y$-subroutine is polynomially-bounded in $|X|$. If $Y$ were also in $\mathbf{P}$ then, complete-problems from complexity classes $\mathcal{C} \supsetneq \mathbf{P}$ would lie in $\math...
I found the following question in my book and I have no clue on what the answer should be: > What is the condition on search graph so that BFS Algorithm for graph and BFS Algorithm for tree **generate and expand** identical nodes in the same order? Please Note you don't have to write a proof as I will prove it ...
I would like to know if there exist some complexity classes that are defined according to the integrality gap of their problems? In particular, is there a class of problems for which their integrality gap is unbounded? Where by unbounded integrality gap, I mean an integrality gap that is equal to infinite, where...
Let's say we're some function problem, $R \subseteq \Sigma^* \times \Sigma^*$, where $\Sigma = {0, 1}$ and some oracle $O_R$ that solves $R$. Now, we're given some language, $L \subseteq \Sigma^*$ and an associated oracle $O_L$ that solves $L$. We say $R =_{poly} L$ if and only if $R^L \in P$ and $L^R \in P$. In ...
Constructing equivalent (to a polynomial-time degree) decision problems from function problems
|complexity-theory|turing-machines|decision-problem|
Yes, there is an equivalence. Suppose the function problem is to compute the function $g$. Define the language $L$ by $$L=\{\langle x,i,b \rangle \mid x \in \{0,1\}^*, g(x)_i=b\},$$ i.e., $L$ consists of all triples $\langle x,i,b \rangle$ such that the $i$th bit of the output is $b$ when the input is $x$. Ass...
Let's say we're some function problem, $R \subseteq \Sigma^* \times \Sigma^*$, where $\Sigma = \{0, 1\}$ and some oracle $O_R$ that solves $R$. Now, we're given some language, $L \subseteq \Sigma^*$ and an associated oracle $O_L$ that solves $L$. We say $R =_{poly} L$ if a machine equipped with $O_L$ can solve $R...
null
Yes, there is an equivalence. Suppose the function problem is to compute the function $g$. Define the language $L$ by $$L=\{\langle x,i,b \rangle \mid x \in \{0,1\}^*, g(x)_i=b\},$$ i.e., $L$ consists of all triples $\langle x,i,b \rangle$ such that the $i$th bit of the output is $b$ when the input is $x$. Ass...
$$\begin{align}T(n)&=T(n-a)+T(a)+cn \\&=T(n-2a)+T(a)+c(n-a)+T(a)+cn \\&=T(n-3a)+T(a)+c(n-2a)+T(a)+c(n-a)+T(a)+cn \\&\cdots \end{align}$$ The recursion stops after $k$ substitutions, in such a way that $n-ka$ is no more a function of $n$. In other words, when $$0\le n-ka<a.$$ ---------- The solution of t...
$$\begin{align}T(n)&=T(n-a)+T(a)+cn \\&=T(n-2a)+T(a)+c(n-a)+T(a)+cn \\&=T(n-3a)+T(a)+c(n-2a)+T(a)+c(n-a)+T(a)+cn \\&\cdots \end{align}$$ The recursion stops after $k$ substitutions, in such a way that $n-ka$ is no more a function of $n$. In other words, when $$0\le n-ka<a.$$ ---------- The solution of t...
null
null
null
null
null
The question is incorrect. The integrality gap is defined for a linear programming formulation of the problem and not for the problem. It is possible that a problem has two linear programming relaxations, with one having unbounded integrality gap and the other having bounded integrality gap. For example, see thi...
The question is incorrect. The integrality gap is defined for a linear programming formulation of the problem and not fundamentally for the problem. It is possible that a problem has more than one linear programming relaxations, with some having unbounded integrality gap and the others having bounded integrality gap...
null
The question is incorrect. The integrality gap is defined for a linear programming formulation of the problem and not fundamentally for the problem. It is possible that a problem has more than one integer programming formulations, with some having unbounded integrality gap and the others having bounded integrality g...
Algorithm fairness is the field of research aimed at understanding and correcting biases like these. It is at the intersection of machine learning and ethics. Specifically, the field includes: Researching the causes of bias in data and algorithms. There are several ways to define fairness. I am interested in the ind...
How to show that an algorithm is not fair?
|machine-learning|
Take any NP-complete problem, for instance $\text{SAT}$. Note that there are infinitely many unsatisfiable formulas. So let $\phi_1, \phi_2, \phi_3 \ldots$ be an infinite enumeration of (distinct) unsatisfiable formulas. For each $i$, we can consider the problem $\text{SAT}_i = \text{SAT} \cup \{\phi_i\}$ i.e. the ...
null
Hash codes are computed using the same formula on all keys and are designed to yield dissimilar values even from similar data. The semantic interpretation of the data is irrelevant and will be "erased" by hashing. No unfairness is possible. In addition, hash codes are used in hash tables, that have collision arbitra...
Yes, there is an equivalence. Suppose the function problem is to compute the function $g$. Define the language $L$ by $$L=\{\langle x,i,b \rangle \mid x \in \{0,1\}^*, g(x)_i=b\},$$ i.e., $L$ consists of all triples $\langle x,i,b \rangle$ such that the $i$th bit of the output is $b$ when the input is $x$. Ass...
You want to organize a party and invite as many of your N friends as possible so that the following condition is met: at a party, everyone invited must know at least three other guests and must not be familiar with at least three other guests. The input to the problem is number N and the list of pairs (i, j) where i an...
What would be an efficient algorithm that finds the maximum number of party people?
|algorithms|graphs|greedy-algorithms|
I am studying Turing machines and Turing completeness and just remembered I saw something called the Turing test. It seems that the Turing test ([from Wikipedia][1]) > is a test of a machine's ability to exhibit intelligent behavior > equivalent to, or indistinguishable from, that of a human. while Turing compl...
null
My lecture notes for $T$-joins states: > If $T = V$ then $T$ -joins of cardinality $V/2$ are exactly the perfect matchings of $G$ = $(V ,E)$. So, the minimum weight perfect matching problem can be reduced to the minimum weight $T$ -join problem by adding a large constant to each edge weight (to get a degree of 1...
Reducing the min weight perfect matching problem to a T-join
|algorithms|graphs|matching|
Let's say we're some function problem, $R \subseteq \Sigma^* \times \Sigma^*$, where $\Sigma = \{0, 1\}$ and some oracle $O_R$ that solves $R$. Now, we're given some language, $L \subseteq \Sigma^*$ and an associated oracle $O_L$ that solves $L$. We say $R =_{poly} L$ if a machine equipped with $O_L$ can solve $R...
Since the algorithm is adding a large positive weight to each edge, the minimum weight $T$-join will have the minimum number of edges in it. Note that the least number of edges in a $T$-join for $T = V$ could be $|V|/2$. That is, each vertex has degree exactly $1$.
null
<b>"Abstract":</b><br> I have recently crafted a new algorithm for constructing code trees which I believe are optimal (the same thing that is constructed using [Huffman's algorithm][1], at [Wikipedia][2]). It is based on one observation which is in form of an illegal property (i.e. code trees with that property are n...
Proving that this Huffman tree construction is valid
|algorithms|huffman-coding|linear-complexity|
<b>"Abstract":</b><br> I have recently crafted a new algorithm for constructing code trees which I believe are optimal (the same thing that is constructed using [Huffman's algorithm][1], at [Wikipedia][2]). It is based on one observation which is in form of an illegal property (i.e. code trees with that property are n...
<b>"Abstract":</b><br> I have recently crafted a new algorithm for constructing code trees which I believe are optimal (the same thing that is constructed using [Huffman's algorithm][1], at [Wikipedia][2]). It is based on one observation which is in form of an illegal property (i.e. code trees with that property are n...
I have a question question about an "apparent" contradiction I found in my lesson notes on Application Order Reduction (AOR) and the Church-Rosser Theorem (CRT). I'd like to emphasize that I'm not suggesting there's a real contradiction, and it is most certainly just my lack of understanding of CRT at issue. Ok her...
lambda-calculus Church Rosser Theorem and Application Order Reduction
|lambda-calculus|
<b>"Abstract":</b><br> I have recently crafted a new algorithm for constructing code trees which I believe are optimal (the same thing that is constructed using [Huffman's algorithm][1], at [Wikipedia][2]). It is based on one observation which is in form of an illegal property (i.e. code trees with that property are n...
Hint: It's actually quite simple. (Yes, that's all the hint you need).