id
int64
1
141k
title
stringlengths
15
150
body
stringlengths
45
28.5k
tags
stringlengths
1
102
label
int64
1
1
text
stringlengths
128
28.6k
source
stringclasses
1 value
120,691
Minimum total waiting time for arrivals/durations
<p>I have come up with the following problem, and cannot seem to find an effective way of solving it:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider <span class="math-container">$n$</span> clients arriving at a service point at time moments <span class="math-container">$\{a_i\}_{i=1}^n$</span> whose duration of service (b...
optimization np complete dynamic programming greedy algorithms
1
Minimum total waiting time for arrivals/durations -- (optimization np complete dynamic programming greedy algorithms) <p>I have come up with the following problem, and cannot seem to find an effective way of solving it:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider <span class="math-container">$n$</span> clients arriving...
habedi/stack-exchange-dataset
120,702
Count number of pairs of elements whose product is a perfect square
<p>Given two arrays whose elements lie between <span class="math-container">$[1,10^5]$</span> and the size of arrays is <span class="math-container">$[1,10^5]$</span>, how can we find the total number of pairs of elements from these arrays such that their product is a perfect square? The arrays may have same elements.<...
algorithms dynamic programming combinatorics linear algebra
1
Count number of pairs of elements whose product is a perfect square -- (algorithms dynamic programming combinatorics linear algebra) <p>Given two arrays whose elements lie between <span class="math-container">$[1,10^5]$</span> and the size of arrays is <span class="math-container">$[1,10^5]$</span>, how can we find the...
habedi/stack-exchange-dataset
120,707
A linear time algorithm to find the array of indices of bigger numbers
<p>Suppose you have an array <code>nums</code> of integers, unsorted, containing the values from 1 to n. You have a second array, call it <code>firstBigger</code>, initially empty, which you want to populate with integers such that <code>firstBigger[i]</code> contains j if j is the least index such that i &lt; j and <...
algorithms
1
A linear time algorithm to find the array of indices of bigger numbers -- (algorithms) <p>Suppose you have an array <code>nums</code> of integers, unsorted, containing the values from 1 to n. You have a second array, call it <code>firstBigger</code>, initially empty, which you want to populate with integers such that ...
habedi/stack-exchange-dataset
120,720
Given the Equivalence relation R = { x, y $\in$ $\Bbb{Z}$ : (x+y) mod 2 = 0}, what are equivalence classes 1 and 2?
<p>Given the Equivalence relation R = { x, y <span class="math-container">$\in$</span> <span class="math-container">$\Bbb{Z}$</span> : (x+y) mod 2 = 0}, what are equivalence classes of 1 and 2?</p>&#xA;&#xA;<p>I can't really see the equivalence classes of infinite sets. Only by having a drawing of all elements can I d...
sets
1
Given the Equivalence relation R = { x, y $\in$ $\Bbb{Z}$ : (x+y) mod 2 = 0}, what are equivalence classes 1 and 2? -- (sets) <p>Given the Equivalence relation R = { x, y <span class="math-container">$\in$</span> <span class="math-container">$\Bbb{Z}$</span> : (x+y) mod 2 = 0}, what are equivalence classes of 1 and 2?...
habedi/stack-exchange-dataset
120,724
NP-complete problem whose corresponding optimization problem is not NP-hard
<p>For this question I will refer to<span class="math-container">$\ NP-hard$</span> problems as those that are at least as hard as<span class="math-container">$ \ NP-complete$</span> problems. That is, a problem<span class="math-container">$ \ H$</span> is<span class="math-container">$\ NP-hard$</span> if there is an<s...
complexity theory
1
NP-complete problem whose corresponding optimization problem is not NP-hard -- (complexity theory) <p>For this question I will refer to<span class="math-container">$\ NP-hard$</span> problems as those that are at least as hard as<span class="math-container">$ \ NP-complete$</span> problems. That is, a problem<span clas...
habedi/stack-exchange-dataset
120,740
Combining merge sort with insertion sort - Time complexity
<p>I am learning algorithms from the CLRS book on my own, without any help. It has an exercise which combines merge sort {O(n log n)} with insertion sort {O(<span class="math-container">$ n^{2} $</span>)}. It says that when the sub-arrays in the merge-sorting reach a certain size "k", then it is better to use insertion...
algorithms
1
Combining merge sort with insertion sort - Time complexity -- (algorithms) <p>I am learning algorithms from the CLRS book on my own, without any help. It has an exercise which combines merge sort {O(n log n)} with insertion sort {O(<span class="math-container">$ n^{2} $</span>)}. It says that when the sub-arrays in the...
habedi/stack-exchange-dataset
120,770
Converting a function with single parameter to a function with multiple parameters
<p>I have been solving some algorithm questions recently and a pattern I have observed in some problems is as follows:</p>&#xA;&#xA;<p>Given a string or a list, do an aggregation operation on each of its elements. Here in each of these elements we apply some recurrence to solve it. </p>&#xA;&#xA;<p>An example of one su...
algorithms computability recurrence relation recursion functional programming
1
Converting a function with single parameter to a function with multiple parameters -- (algorithms computability recurrence relation recursion functional programming) <p>I have been solving some algorithm questions recently and a pattern I have observed in some problems is as follows:</p>&#xA;&#xA;<p>Given a string or a...
habedi/stack-exchange-dataset
120,772
Using MyHill Nerode theorem to prove a language is non-regular
<p>The language is <span class="math-container">$S = (a^nb^m | n \geq m)$</span>.</p>&#xA;&#xA;<p>I'm having trouble understanding MyHill Nerode theorem. Basically if I want to use MyHill Nerode theorem to prove <span class="math-container">$S$</span> is non-regular, I have to show that there are infinitely many equiva...
formal languages regular languages
1
Using MyHill Nerode theorem to prove a language is non-regular -- (formal languages regular languages) <p>The language is <span class="math-container">$S = (a^nb^m | n \geq m)$</span>.</p>&#xA;&#xA;<p>I'm having trouble understanding MyHill Nerode theorem. Basically if I want to use MyHill Nerode theorem to prove <span...
habedi/stack-exchange-dataset
120,784
CFG for $L=\{ \omega \in \{ a,b,c,d \}^* : |\omega|_a = |\omega|_b \}$
<p>Given the language:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$$ L=\{ \omega \in \{ a,b,c,d \}^* : |\omega|_a = |\omega|_b \} $$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>I propose the following grammar:&#xA;<span class="math-container">$$ \begin{align*}&#xA;S &amp;\to \varepsilon \mid aSbS \mid...
formal languages formal grammars
1
CFG for $L=\{ \omega \in \{ a,b,c,d \}^* : |\omega|_a = |\omega|_b \}$ -- (formal languages formal grammars) <p>Given the language:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$$ L=\{ \omega \in \{ a,b,c,d \}^* : |\omega|_a = |\omega|_b \} $$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>I propose the fo...
habedi/stack-exchange-dataset
120,787
Algorithm to enumerate all complete schedulings of finals tests?
<p>I'm creating an app that receives some map between finals and the respective periods during which they are held and a student's required finals. I was wondering if there was an algorithm to enumerate all <em>complete</em> schedulings of these finals. Concretely, I have a list of finals for a specific student and eac...
algorithms scheduling
1
Algorithm to enumerate all complete schedulings of finals tests? -- (algorithms scheduling) <p>I'm creating an app that receives some map between finals and the respective periods during which they are held and a student's required finals. I was wondering if there was an algorithm to enumerate all <em>complete</em> sch...
habedi/stack-exchange-dataset
120,790
What are HP and MP in this context?
<p>From Kozen's Automata and Computability, 3ed, lecture 32 p. 328:&#xA;<a href="https://i.stack.imgur.com/PKOFK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PKOFK.png" alt="a"></a></p>&#xA;&#xA;<p>What are HP and MP in this context? I tried looking around and this <a href="http://www.cs.cornell....
turing machines computability automata
1
What are HP and MP in this context? -- (turing machines computability automata) <p>From Kozen's Automata and Computability, 3ed, lecture 32 p. 328:&#xA;<a href="https://i.stack.imgur.com/PKOFK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PKOFK.png" alt="a"></a></p>&#xA;&#xA;<p>What are HP and MP i...
habedi/stack-exchange-dataset
120,810
Is there a name for the class of algorithms that are the most efficient for a particular task?
<p>This would be analogous to the <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity" rel="noreferrer">Kolmogorov complexity</a> of a string, except that in this case, I'm interested in the algorithm that solves a given problem using the least number of steps.</p>&#xA;&#xA;<p>We would therefore have to be abl...
algorithms time complexity terminology
1
Is there a name for the class of algorithms that are the most efficient for a particular task? -- (algorithms time complexity terminology) <p>This would be analogous to the <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity" rel="noreferrer">Kolmogorov complexity</a> of a string, except that in this case, I'm...
habedi/stack-exchange-dataset
120,836
Which inductive schemes can encode the following Agda definition?
<p>Which induction schemes (e.g. induction-recursion by Dybjer and Setzer, "Irish" induction-recursion by McBride or induction-induction by Forsberg and Setzer or perhaps some simpler ones) allow one to encode the following Agda definition</p>&#xA;&#xA;<pre><code> data A : Set where&#xA; a : Maybe (List A) → A&#xA;...
induction agda
1
Which inductive schemes can encode the following Agda definition? -- (induction agda) <p>Which induction schemes (e.g. induction-recursion by Dybjer and Setzer, "Irish" induction-recursion by McBride or induction-induction by Forsberg and Setzer or perhaps some simpler ones) allow one to encode the following Agda defin...
habedi/stack-exchange-dataset
120,848
Linear algorithm to measure how sorted an array is
<p>I've just attended an algorithm course, in which I've seen many sorting algorithms performing better or worse depending on how much the elements of an array are sorted already. For example, for what I've heard, quicksort is preferred most of the times, yet still it has <span class="math-container">$O(n^2)$</span> co...
algorithms algorithm analysis sorting
1
Linear algorithm to measure how sorted an array is -- (algorithms algorithm analysis sorting) <p>I've just attended an algorithm course, in which I've seen many sorting algorithms performing better or worse depending on how much the elements of an array are sorted already. For example, for what I've heard, quicksort is...
habedi/stack-exchange-dataset
120,853
How to create a LR(k) grammar for an arbitrary k
<p>Is there a simple procedure for constructing a grammar that is LR(k) but not LR(k-1) for any k?</p>&#xA;
context free parsers lr k
1
How to create a LR(k) grammar for an arbitrary k -- (context free parsers lr k) <p>Is there a simple procedure for constructing a grammar that is LR(k) but not LR(k-1) for any k?</p>&#xA;
habedi/stack-exchange-dataset
120,861
Two versions of Subset Sum Problem
<p>I keep seeing two versions of the Subset Sum Problem. The first and seemingly least common is:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given an integer bound <span class="math-container">$W$</span> and a collection of <span class="math-container">$n$</span> items, each with a positive integer weight <span class="math-con...
complexity theory np complete reductions subset sum
1
Two versions of Subset Sum Problem -- (complexity theory np complete reductions subset sum) <p>I keep seeing two versions of the Subset Sum Problem. The first and seemingly least common is:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given an integer bound <span class="math-container">$W$</span> and a collection of <span class=...
habedi/stack-exchange-dataset
120,892
How are "Problem Complexity" and "Solution Complexity" different?
<p>I am in an algorithms course, and my professor keeps specifying "we are talking about <em>Problem</em> complexity here, not <em>Solution</em> complexity". I would like to gain an intuitive understanding of the difference between these two. Do you all have an example(s) that can help me to understand?</p>&#xA;
algorithms complexity theory
1
How are "Problem Complexity" and "Solution Complexity" different? -- (algorithms complexity theory) <p>I am in an algorithms course, and my professor keeps specifying "we are talking about <em>Problem</em> complexity here, not <em>Solution</em> complexity". I would like to gain an intuitive understanding of the differe...
habedi/stack-exchange-dataset
120,895
Grammar for the following language: L = {$a^{k}$$b^{n}$$a^{m}$ : m,n,k $\in$$ N^{+}$ $\land$ m + k $\geq$ n}
<p>I'm trying to create a grammar (having the highest type) for the language: </p>&#xA;&#xA;<p>L = {<span class="math-container">$a^{k}$$b^{n}$$a^{m}$</span> : m,n,k <span class="math-container">$\in$</span> <span class="math-container">$N^{+}$</span> <span class="math-container">$\land$</span> m +k <span class="math-...
formal grammars
1
Grammar for the following language: L = {$a^{k}$$b^{n}$$a^{m}$ : m,n,k $\in$$ N^{+}$ $\land$ m + k $\geq$ n} -- (formal grammars) <p>I'm trying to create a grammar (having the highest type) for the language: </p>&#xA;&#xA;<p>L = {<span class="math-container">$a^{k}$$b^{n}$$a^{m}$</span> : m,n,k <span class="math-conta...
habedi/stack-exchange-dataset
120,913
IS there a consensus on the definition of a computer program in CS literature and if so, what is it?
<p><sub>The following is what I came up with from my synthetic prior research but I might be wrong.</sub></p>&#xA;&#xA;<p>I understand it is possible to reduce any computer "program", in a maximal reduction(?), to these features:</p>&#xA;&#xA;<ul>&#xA;<li><strong>Internal implementation:</strong> Everything from start ...
terminology reductions
1
IS there a consensus on the definition of a computer program in CS literature and if so, what is it? -- (terminology reductions) <p><sub>The following is what I came up with from my synthetic prior research but I might be wrong.</sub></p>&#xA;&#xA;<p>I understand it is possible to reduce any computer "program", in a ma...
habedi/stack-exchange-dataset
120,915
Interview Question with Arrays and Consecutive Subintervals
<p>I recently came across this question and honestly am pretty unsure of how to solve it, or even begin to develop an algorithm to properly solve it.. </p>&#xA;&#xA;<p>The question is: </p>&#xA;&#xA;<blockquote>&#xA; <p>"An array of <span class="math-container">$n$</span> integers is correctly positioned with respect ...
algorithms data structures
1
Interview Question with Arrays and Consecutive Subintervals -- (algorithms data structures) <p>I recently came across this question and honestly am pretty unsure of how to solve it, or even begin to develop an algorithm to properly solve it.. </p>&#xA;&#xA;<p>The question is: </p>&#xA;&#xA;<blockquote>&#xA; <p>"An arr...
habedi/stack-exchange-dataset
120,949
How come correctness proofs aren't tautological?
<p>Consider the following function on binary trees, which is supposed to tell whether a given <code>int</code> is a member of a binary tree <code>t</code>:</p>&#xA;&#xA;<pre><code>type tree = Leaf | Node of int * tree * tree;;&#xA;&#xA;let rec tmember (t:tree) (x:int) : bool =&#xA; match t with&#xA; Leaf -&gt; fa...
logic correctness proof
1
How come correctness proofs aren't tautological? -- (logic correctness proof) <p>Consider the following function on binary trees, which is supposed to tell whether a given <code>int</code> is a member of a binary tree <code>t</code>:</p>&#xA;&#xA;<pre><code>type tree = Leaf | Node of int * tree * tree;;&#xA;&#xA;let re...
habedi/stack-exchange-dataset
120,957
Computing the minimum distance between each pain of points
<p>I am trying to read an algorithm for computing minimum distance between each pair of points from the book: Algorithm Design</p>&#xA;&#xA;<p><a href="https://theswissbay.ch/pdf/Gentoomen%20Library/Algorithms/Algorithm%20Design%20-%20John%20Kleinberg%20-%20%C3%89va%20Tardos.pdf" rel="nofollow noreferrer">Algorithm De...
euclidean distance minimax
1
Computing the minimum distance between each pain of points -- (euclidean distance minimax) <p>I am trying to read an algorithm for computing minimum distance between each pair of points from the book: Algorithm Design</p>&#xA;&#xA;<p><a href="https://theswissbay.ch/pdf/Gentoomen%20Library/Algorithms/Algorithm%20Design...
habedi/stack-exchange-dataset
120,958
"Searching and sorting" algorithm to find the natural logarithim of a number?
<p>Yeah, this is for a homework assignment, but I hope that you'll humor me anyway. I am asked to design an algorithm that finds the natural logarithm of a number. This would be straightforward, but I'm not allowed to use strategies that involve integration, bit manipulation, approximation formulas, or Taylor Series. I...
algorithms sorting algorithm design
1
"Searching and sorting" algorithm to find the natural logarithim of a number? -- (algorithms sorting algorithm design) <p>Yeah, this is for a homework assignment, but I hope that you'll humor me anyway. I am asked to design an algorithm that finds the natural logarithm of a number. This would be straightforward, but I'...
habedi/stack-exchange-dataset
120,983
What is the Time complexity of $\sum_{i=1}^n 1+\lfloor\log_2 i\rfloor$
<p>What is the time complexity of</p>&#xA;&#xA;<p><span class="math-container">$$\sum_{i=1}^n 1+\lfloor\log_2 i\rfloor$$</span></p>&#xA;&#xA;<p>and how do you calculate it?</p>&#xA;
time complexity
1
What is the Time complexity of $\sum_{i=1}^n 1+\lfloor\log_2 i\rfloor$ -- (time complexity) <p>What is the time complexity of</p>&#xA;&#xA;<p><span class="math-container">$$\sum_{i=1}^n 1+\lfloor\log_2 i\rfloor$$</span></p>&#xA;&#xA;<p>and how do you calculate it?</p>&#xA;
habedi/stack-exchange-dataset
120,989
Maximum number of steps a Turing machine makes
<p>Given the Turing machine <span class="math-container">$M = ( \{q_0, q_1, q_2. q_3,q_4\}, \Sigma= \{a, b, c \}, \Gamma = \{a, b, c, \}, \delta, q_0, , \{q_4\} )$</span> &#xA;where <span class="math-container">$q_0$</span> is the start state, <span class="math-container">$q_4$</span> the end state and the blank symb...
turing machines
1
Maximum number of steps a Turing machine makes -- (turing machines) <p>Given the Turing machine <span class="math-container">$M = ( \{q_0, q_1, q_2. q_3,q_4\}, \Sigma= \{a, b, c \}, \Gamma = \{a, b, c, \}, \delta, q_0, , \{q_4\} )$</span> &#xA;where <span class="math-container">$q_0$</span> is the start state, <span c...
habedi/stack-exchange-dataset
120,991
For every 4 ‘c’ in the input push a ‘c’ in the stack (Push down automata)
<p>Given the following language: L = {<span class="math-container">$a^{2m}$</span> <span class="math-container">$c^{4n}$</span> <span class="math-container">$d^{n}$</span> <span class="math-container">$b^{m}$</span> : m,n >= 0}&#xA;I’m trying to design a PDA. My aproach is:</p>&#xA;&#xA;<p>-for every 2 ‘a’ push an ‘a’<...
pushdown automata
1
For every 4 ‘c’ in the input push a ‘c’ in the stack (Push down automata) -- (pushdown automata) <p>Given the following language: L = {<span class="math-container">$a^{2m}$</span> <span class="math-container">$c^{4n}$</span> <span class="math-container">$d^{n}$</span> <span class="math-container">$b^{m}$</span> : m,n >...
habedi/stack-exchange-dataset
120,995
If $L_1,\,L_1L_2$ are regular languages with $L_1\neq \emptyset,\,\lambda\notin L_1,\,\lambda\notin L_2,$ is $L_2$ regular?
<p>If <span class="math-container">$L_1,\,L_1L_2$</span> are regular languages with <span class="math-container">$L_1\neq \emptyset,\,\lambda\notin L_1,\,\lambda\notin L_2,$</span> is <span class="math-container">$L_2$</span> regular?</p>&#xA;&#xA;<p>I think I found a correct proof for this question but my professor sa...
regular languages
1
If $L_1,\,L_1L_2$ are regular languages with $L_1\neq \emptyset,\,\lambda\notin L_1,\,\lambda\notin L_2,$ is $L_2$ regular? -- (regular languages) <p>If <span class="math-container">$L_1,\,L_1L_2$</span> are regular languages with <span class="math-container">$L_1\neq \emptyset,\,\lambda\notin L_1,\,\lambda\notin L_2,$...
habedi/stack-exchange-dataset
121,000
Is Knapsack restricted to integers between 1 and 100 still NP-complete?
<p>The title pretty much says it all. I want to know if Knapsack is still NP-complete when the weights, values, and weight limit are restricted to a finite set of values. I figure that it wouldn't be because clearly for very small finite sets it isn't. (E.g., if you must use integers from 1 to 3.) That said, I'm strugg...
algorithms complexity theory
1
Is Knapsack restricted to integers between 1 and 100 still NP-complete? -- (algorithms complexity theory) <p>The title pretty much says it all. I want to know if Knapsack is still NP-complete when the weights, values, and weight limit are restricted to a finite set of values. I figure that it wouldn't be because clearl...
habedi/stack-exchange-dataset
121,004
Hardness of a scheduling/assignment problem
<p>I am trying to prove the hardness of the following problem. This problem is from <a href="https://codingcompetitions.withgoogle.com/hashcode" rel="nofollow noreferrer">google hashcode, qualification-round, 2020</a>.</p>&#xA;&#xA;<p>Hier is a brief description of the problem. Given a list or libraries and a list of b...
algorithms reductions np hard scheduling bipartite matching
1
Hardness of a scheduling/assignment problem -- (algorithms reductions np hard scheduling bipartite matching) <p>I am trying to prove the hardness of the following problem. This problem is from <a href="https://codingcompetitions.withgoogle.com/hashcode" rel="nofollow noreferrer">google hashcode, qualification-round, 20...
habedi/stack-exchange-dataset
121,015
How the kernel works in a LCF theorem prover
<p>I heard that there is some mechanism in LCF-based theorem provers that only allows some functions to create values of type theorem. I believe these are based on abstract data types.</p>&#xA;&#xA;<p>Could someone sketch in pseudo-code how does this work? (in case the above is correct)</p>&#xA;
programming languages automated theorem proving
1
How the kernel works in a LCF theorem prover -- (programming languages automated theorem proving) <p>I heard that there is some mechanism in LCF-based theorem provers that only allows some functions to create values of type theorem. I believe these are based on abstract data types.</p>&#xA;&#xA;<p>Could someone sketch ...
habedi/stack-exchange-dataset
121,021
Amount of k-partitions of a number
<p>I'm stuck on writing an algorithm for getting the amount of distinct partitions for a number <span class="math-container">$n$</span> with the partition being size <span class="math-container">$k$</span>. It's important that there isn't any repetition in the partitions.&#xA;For example:</p>&#xA;&#xA;<p>The partitions...
dynamic programming discrete mathematics partitions
1
Amount of k-partitions of a number -- (dynamic programming discrete mathematics partitions) <p>I'm stuck on writing an algorithm for getting the amount of distinct partitions for a number <span class="math-container">$n$</span> with the partition being size <span class="math-container">$k$</span>. It's important that t...
habedi/stack-exchange-dataset
121,025
Analyze undirected weight graph and generate two sub graphs
<p>I have a weighted undirected graph <span class="math-container">$G_0$</span>, from which I want to derive weighted undirected graphs <span class="math-container">$G_1$</span> and <span class="math-container">$G_2$</span>.</p>&#xA;&#xA;<ul>&#xA;<li>All nodes in <span class="math-container">$G_0$</span> have a degree ...
algorithms graphs
1
Analyze undirected weight graph and generate two sub graphs -- (algorithms graphs) <p>I have a weighted undirected graph <span class="math-container">$G_0$</span>, from which I want to derive weighted undirected graphs <span class="math-container">$G_1$</span> and <span class="math-container">$G_2$</span>.</p>&#xA;&#xA...
habedi/stack-exchange-dataset
121,034
Showing on-line P = NP
<p>I have developed a theorem that proposes a method to build algorithms. All the algorithms produced by this method are in P ... they never go up to more than <span class="math-container">$6(n^{12})$</span> operations. </p>&#xA;&#xA;<p>Following that, I have defined an algorithm to resolve the TSP-metric. I agree that...
complexity theory computability proof techniques p vs np
1
Showing on-line P = NP -- (complexity theory computability proof techniques p vs np) <p>I have developed a theorem that proposes a method to build algorithms. All the algorithms produced by this method are in P ... they never go up to more than <span class="math-container">$6(n^{12})$</span> operations. </p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
121,036
Maximum matching in a bipartite graph
<p>Given a bipartite graph <span class="math-container">$G=(V_1 \cup V_2, E)$</span> and a set <span class="math-container">$V' \in (V_1 \cup V_2)$</span>. What is the complexity of finding a maximum matching in <span class="math-container">$G$</span> that uses only <span class="math-container">$x$</span> vertices from...
complexity theory graphs bipartite matching bipartite graph
1
Maximum matching in a bipartite graph -- (complexity theory graphs bipartite matching bipartite graph) <p>Given a bipartite graph <span class="math-container">$G=(V_1 \cup V_2, E)$</span> and a set <span class="math-container">$V' \in (V_1 \cup V_2)$</span>. What is the complexity of finding a maximum matching in <span...
habedi/stack-exchange-dataset
121,054
Why does this NFA having an empty symbol
<p>I'm trying to understand the difference of DFA from NFA&#xA;I have this example in my coursebook&#xA;<a href="https://i.stack.imgur.com/qLXtM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qLXtM.png" alt="enter image description here"></a>&#xA;Are the empty symbols at the start necessary?&#xA;or ...
automata finite automata
1
Why does this NFA having an empty symbol -- (automata finite automata) <p>I'm trying to understand the difference of DFA from NFA&#xA;I have this example in my coursebook&#xA;<a href="https://i.stack.imgur.com/qLXtM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qLXtM.png" alt="enter image descripti...
habedi/stack-exchange-dataset
121,076
How to Calculate Clock Rate for Processor?
<p>Please can anyone help me to solve the following question, I have no idea to solve that . </p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/lXgn6.jpg" alt="enter image description here"></p>&#xA;
computer architecture cache
1
How to Calculate Clock Rate for Processor? -- (computer architecture cache) <p>Please can anyone help me to solve the following question, I have no idea to solve that . </p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/lXgn6.jpg" alt="enter image description here"></p>&#xA;
habedi/stack-exchange-dataset
121,078
Question of checking the $n$th root
<p><strong>Problem:</strong>&#xA;Input : <span class="math-container">$n$</span>, <span class="math-container">$k$</span></p>&#xA;&#xA;<p>Check : Is <span class="math-container">$\frac{k}{4h -1} = n^{\frac{1}{h}}$</span>? for any <span class="math-container">$ 0 \le h &lt;= n$</span>.</p>&#xA;&#xA;<p><strong>Question:...
algorithms
1
Question of checking the $n$th root -- (algorithms) <p><strong>Problem:</strong>&#xA;Input : <span class="math-container">$n$</span>, <span class="math-container">$k$</span></p>&#xA;&#xA;<p>Check : Is <span class="math-container">$\frac{k}{4h -1} = n^{\frac{1}{h}}$</span>? for any <span class="math-container">$ 0 \le ...
habedi/stack-exchange-dataset
121,080
What are GPUs bad at?
<p>I understand that GPUs are generally used to do LOTS of calculations in parallel. I understand why we would want to parallelize processes in order to speed things up. However, GPUs aren't always better than CPUs, as far as I know.</p>&#xA;&#xA;<p>What kinds of tasks are GPUs bad at? When would we prefer CPU over GP...
computer architecture
1
What are GPUs bad at? -- (computer architecture) <p>I understand that GPUs are generally used to do LOTS of calculations in parallel. I understand why we would want to parallelize processes in order to speed things up. However, GPUs aren't always better than CPUs, as far as I know.</p>&#xA;&#xA;<p>What kinds of tasks ...
habedi/stack-exchange-dataset
121,085
Standard ILP Formulation of Travelling salesman problem: Purpose of subtour elimination constraints?
<p>Consider the Traveling Salesman Problem:&#xA;<em>Input</em>: <span class="math-container">$n$</span> cities, distances <span class="math-container">$c_{ij}$</span> for each ordered pair <span class="math-container">$(i,j)$</span> of them.</p>&#xA;&#xA;<p><em>Output</em>: Find a shortest round tour visiting every cit...
linear programming traveling salesman
1
Standard ILP Formulation of Travelling salesman problem: Purpose of subtour elimination constraints? -- (linear programming traveling salesman) <p>Consider the Traveling Salesman Problem:&#xA;<em>Input</em>: <span class="math-container">$n$</span> cities, distances <span class="math-container">$c_{ij}$</span> for each ...
habedi/stack-exchange-dataset
121,088
How can Kruskal's algorithm return different spanning trees?
<p>We assume that we have the same graph G.</p>&#xA;&#xA;<p>In introduction to Algorithms by Cormen it's said that it`s possible depending on how it breaks ties when the edges are sorted into order.</p>&#xA;&#xA;<p>I have trouble visualizing the answer given:</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose that A is an empt...
algorithms graphs weighted graphs
1
How can Kruskal's algorithm return different spanning trees? -- (algorithms graphs weighted graphs) <p>We assume that we have the same graph G.</p>&#xA;&#xA;<p>In introduction to Algorithms by Cormen it's said that it`s possible depending on how it breaks ties when the edges are sorted into order.</p>&#xA;&#xA;<p>I hav...
habedi/stack-exchange-dataset
121,094
Composition of functions computable in logspace
<p>The <strong>bit-graph</strong> of <span class="math-container">$f\colon \{0,1\}^* \rightarrow \{0,1\}^*$</span> is the language:</p>&#xA;&#xA;<p><span class="math-container">$\text{BIT}_f := \{\langle x,i \rangle : 1\leq i \leq|f(x)| \text{ and the $i$-th bit of } f(x) \text{ is } 1\}$</span></p>&#xA;&#xA;<p>It is s...
complexity theory turing machines space complexity
1
Composition of functions computable in logspace -- (complexity theory turing machines space complexity) <p>The <strong>bit-graph</strong> of <span class="math-container">$f\colon \{0,1\}^* \rightarrow \{0,1\}^*$</span> is the language:</p>&#xA;&#xA;<p><span class="math-container">$\text{BIT}_f := \{\langle x,i \rangle ...
habedi/stack-exchange-dataset
121,099
Numerical Accuracy & Sorting Algorithms?
<p>Sedgewick and Wayne talk about how sorting algorithms and, specifically, priority queues are used in devising ways to improve accuracy in floating-point calculations: <a href="https://algs4.cs.princeton.edu/25applications/" rel="nofollow noreferrer">https://algs4.cs.princeton.edu/25applications/</a></p>&#xA;&#xA;<bl...
algorithms data structures sorting floating point priority queues
1
Numerical Accuracy & Sorting Algorithms? -- (algorithms data structures sorting floating point priority queues) <p>Sedgewick and Wayne talk about how sorting algorithms and, specifically, priority queues are used in devising ways to improve accuracy in floating-point calculations: <a href="https://algs4.cs.princeton.ed...
habedi/stack-exchange-dataset
121,102
Existence of walk in undirected connected graph where nodes must end with assigned value
<p>We have a graph with <span class="math-container">$N$</span> nodes and <span class="math-container">$N-1$</span> undirected edges, where it's possible to reach one node from any other node. Each node will get assigned a value randomly from [1,...,10]. We want the value of every node to end up at 10. The way we updat...
algorithms graphs graph traversal
1
Existence of walk in undirected connected graph where nodes must end with assigned value -- (algorithms graphs graph traversal) <p>We have a graph with <span class="math-container">$N$</span> nodes and <span class="math-container">$N-1$</span> undirected edges, where it's possible to reach one node from any other node....
habedi/stack-exchange-dataset
121,112
Is cubical type theory still consistent with univalent excluded middle and univalent choice?
<p>I want to formalize some undergraduate maths in cubical agda, and learning cubical type theory in the proccess. The problem is that I will need univalent excluded middle and univalent choice (and maybe propositional resizing). I know these are consistent with homotopy type theory (although computation is lost when a...
homotopy type theory cubical type theory
1
Is cubical type theory still consistent with univalent excluded middle and univalent choice? -- (homotopy type theory cubical type theory) <p>I want to formalize some undergraduate maths in cubical agda, and learning cubical type theory in the proccess. The problem is that I will need univalent excluded middle and univ...
habedi/stack-exchange-dataset
121,113
Find and sort 2d array elements like radar
<p>I don't know relevant keywords about this algorithm.&#xA;I can show you visually&#xA;<a href="https://i.stack.imgur.com/5JQ0D.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/5JQ0D.gif" alt="Sort elements like circular pattern"></a></p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/7NJnF.png" rel="noreferr...
sorting
1
Find and sort 2d array elements like radar -- (sorting) <p>I don't know relevant keywords about this algorithm.&#xA;I can show you visually&#xA;<a href="https://i.stack.imgur.com/5JQ0D.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/5JQ0D.gif" alt="Sort elements like circular pattern"></a></p>&#xA;&#xA;<p><a ...
habedi/stack-exchange-dataset
121,122
Clarifiaction on the NP-hardness of k-SUM-variants
<p>I am currently looking into the <span class="math-container">$k$</span>-Sum Problem and some of its variants. However i stumbled onto an inconsistency, that i can not seem to fix.</p>&#xA;&#xA;<p>If we begin with <span class="math-container">$3$</span>-Sum, the 'textbook'-definition goes something along the way of <...
complexity theory np
1
Clarifiaction on the NP-hardness of k-SUM-variants -- (complexity theory np) <p>I am currently looking into the <span class="math-container">$k$</span>-Sum Problem and some of its variants. However i stumbled onto an inconsistency, that i can not seem to fix.</p>&#xA;&#xA;<p>If we begin with <span class="math-container...
habedi/stack-exchange-dataset
121,124
How to sort objects based only on "less than" relationships?
<p>Say I have n objects, each with an unknown value, and a n by n matrix Z. Such that Z(i,j)=1 if the value of object i is less than the value of object j, and Z(i,j)=0 otherwise. How can I sort these n objects, given only the matrix Z?</p>&#xA;
algorithms sorting ordering
1
How to sort objects based only on "less than" relationships? -- (algorithms sorting ordering) <p>Say I have n objects, each with an unknown value, and a n by n matrix Z. Such that Z(i,j)=1 if the value of object i is less than the value of object j, and Z(i,j)=0 otherwise. How can I sort these n objects, given only the...
habedi/stack-exchange-dataset
121,128
Expected number of coins
<p>Alice and bob play a game.&#xA;Bob has a well-shuffled deck of <span class="math-container">$M=4999$</span> white cards and <span class="math-container">$N=4999$</span> green cards. Each permutation of cards in the deck is equally likely. Alice has set some rules for Bob. </p>&#xA;&#xA;<ul>&#xA;<li>Every time Bob f...
algorithms dynamic programming probability theory game theory
1
Expected number of coins -- (algorithms dynamic programming probability theory game theory) <p>Alice and bob play a game.&#xA;Bob has a well-shuffled deck of <span class="math-container">$M=4999$</span> white cards and <span class="math-container">$N=4999$</span> green cards. Each permutation of cards in the deck is e...
habedi/stack-exchange-dataset
121,136
Is there such a notion as "effectively computable reductions" or would this be not useful
<p>Most reductions for NP-hardness proofs I encountered are effective in the sense that given an instance of our hard problem, they give a polynomial time algorithm for our problem under question by using reductions. All reductions in the <a href="https://en.wikipedia.org/wiki/Karp%27s_21_NP-complete_problems" rel="no...
complexity theory computability np polynomial time reductions theory
1
Is there such a notion as "effectively computable reductions" or would this be not useful -- (complexity theory computability np polynomial time reductions theory) <p>Most reductions for NP-hardness proofs I encountered are effective in the sense that given an instance of our hard problem, they give a polynomial time ...
habedi/stack-exchange-dataset
121,152
determine if a turing machine halts in less than n step, in less than n step
<p>I would like to know if there is a turing machine which can do the following:</p>&#xA;&#xA;<p>take as input a turing machine T and integer n:<br>&#xA;return true if the turing machine halts before time n and false otherwise</p>&#xA;&#xA;<p>Clearly such a TM (turning machine) exists. Take the TM that simply runs T fo...
turing machines
1
determine if a turing machine halts in less than n step, in less than n step -- (turing machines) <p>I would like to know if there is a turing machine which can do the following:</p>&#xA;&#xA;<p>take as input a turing machine T and integer n:<br>&#xA;return true if the turing machine halts before time n and false other...
habedi/stack-exchange-dataset
121,153
NP-hard or not: partition with irrational input or parameter
<p>See some related questions in <a href="https://cs.stackexchange.com/questions/121197/cont-np-hard-or-not-partition-with-irrational-input-or-parameter]">Cont: NP-hard or not: partition with irrational input or parameter</a></p>&#xA;&#xA;<blockquote>&#xA; <p>Given a set <span class="math-container">$N=\{a_1,...,a_{n}...
complexity theory np complete np hard
1
NP-hard or not: partition with irrational input or parameter -- (complexity theory np complete np hard) <p>See some related questions in <a href="https://cs.stackexchange.com/questions/121197/cont-np-hard-or-not-partition-with-irrational-input-or-parameter]">Cont: NP-hard or not: partition with irrational input or para...
habedi/stack-exchange-dataset
121,156
Primality testing algorithm
<p>Say, I would like to check a hypothesis concerning primes. Something like "there exists a prime between <span class="math-container">$n$</span> and <span class="math-container">$2n$</span> for every choice of <span class="math-container">$n$</span>". I would like to run a code in MATLAB for choices of <span class="m...
algorithms algorithm analysis primes
1
Primality testing algorithm -- (algorithms algorithm analysis primes) <p>Say, I would like to check a hypothesis concerning primes. Something like "there exists a prime between <span class="math-container">$n$</span> and <span class="math-container">$2n$</span> for every choice of <span class="math-container">$n$</span...
habedi/stack-exchange-dataset
121,171
Time complexity of a 3 nested for-loop
<pre><code>for(i = 0; i&lt;n; i++) {&#xA; for(j = 1; j&lt;i*i; j++) {&#xA; if(j % i == 0) {&#xA; for(k = 0; k&lt;j; k++) {&#xA; //statement;&#xA; }&#xA; }&#xA; }&#xA;}&#xA;</code></pre>&#xA;&#xA;<p>Here, it's been asked to find the time complexity. I think it's O...
algorithms time complexity
1
Time complexity of a 3 nested for-loop -- (algorithms time complexity) <pre><code>for(i = 0; i&lt;n; i++) {&#xA; for(j = 1; j&lt;i*i; j++) {&#xA; if(j % i == 0) {&#xA; for(k = 0; k&lt;j; k++) {&#xA; //statement;&#xA; }&#xA; }&#xA; }&#xA;}&#xA;</code></pre>&#xA;&#...
habedi/stack-exchange-dataset
121,172
Is it possible to include numerical values or constants within brackets(time complexity)?
<p>I am currently trying to learn a bit more about the theoretical side of computer science and I have stumbled upon this example I found online:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$5n^2 + 5n = O(0.5n^2)$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>I do have basic understanding of how time com...
time complexity
1
Is it possible to include numerical values or constants within brackets(time complexity)? -- (time complexity) <p>I am currently trying to learn a bit more about the theoretical side of computer science and I have stumbled upon this example I found online:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container"...
habedi/stack-exchange-dataset
121,182
The hardness of solving $x^2=2$
<p>What's the hardness of the following problem: <span class="math-container">$\textbf{argmin}_x\{|x^2-2|\}$</span>. </p>&#xA;&#xA;<p>By analytical calculation, I know the solution is <span class="math-container">$\pm \sqrt{2}$</span>. But I am quite confused about whether it is hard with regarding to its computatio...
time complexity
1
The hardness of solving $x^2=2$ -- (time complexity) <p>What's the hardness of the following problem: <span class="math-container">$\textbf{argmin}_x\{|x^2-2|\}$</span>. </p>&#xA;&#xA;<p>By analytical calculation, I know the solution is <span class="math-container">$\pm \sqrt{2}$</span>. But I am quite confused about...
habedi/stack-exchange-dataset
121,184
Flajolet-Martin Algorithm : question about use of certain hash functions
<p>this is a question given in a PDF about streaming algorithms (this isnt an assignment but im trying to understand)</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Exercise 4.4.1</strong> : Suppose our stream consists of the integers 3, 1, 4,&#xA; 1, 5, 9, 2, 6, 5. Our hash functions will all be of the form h(x) =&#xA; ...
hashing streaming algorithm
1
Flajolet-Martin Algorithm : question about use of certain hash functions -- (hashing streaming algorithm) <p>this is a question given in a PDF about streaming algorithms (this isnt an assignment but im trying to understand)</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Exercise 4.4.1</strong> : Suppose our stream consists...
habedi/stack-exchange-dataset
121,185
Will irrational parameters make a problem not well-defined on complexity
<p>Given a set <span class="math-container">$=\{_1,⋯,_\}$</span> where all <span class="math-container">$_$</span>s are rational positive numbers and <span class="math-container">$\sum_{i\in N}a_i=1$</span>, find a subset ⊆ such that <span class="math-container">$(\sqrt{2\sum_{i\in S}a_i}-1)^2$</span> is minimized. Doe...
complexity theory
1
Will irrational parameters make a problem not well-defined on complexity -- (complexity theory) <p>Given a set <span class="math-container">$=\{_1,⋯,_\}$</span> where all <span class="math-container">$_$</span>s are rational positive numbers and <span class="math-container">$\sum_{i\in N}a_i=1$</span>, find a subset ⊆ ...
habedi/stack-exchange-dataset
121,187
Why is a threshold determined for Byzantine Fault Tolerance of an "Asynchronous" network? (where it cannot tolerate even one faulty node)
<p>In following answer (<strong>LINK:</strong> <a href="https://bitcoin.stackexchange.com/a/58908/41513">https://bitcoin.stackexchange.com/a/58908/41513</a>), it has been shown that for <strong>Asynchronous Byzantine Agreement</strong>:</p>&#xA;&#xA;<blockquote>&#xA; <p>"we cannot tolerate 1/3 or more of the nodes bei...
distributed systems security consensus fault tolerance byzantine
1
Why is a threshold determined for Byzantine Fault Tolerance of an "Asynchronous" network? (where it cannot tolerate even one faulty node) -- (distributed systems security consensus fault tolerance byzantine) <p>In following answer (<strong>LINK:</strong> <a href="https://bitcoin.stackexchange.com/a/58908/41513">https:/...
habedi/stack-exchange-dataset
121,193
Parallel programming models: Why do OpenMP and MPI dominate?
<p>In a lecture on HPC parallel programming (for CPUs) we discussed various models available from Pthreads to OpenMP to MPI and others like Charm++, X10, UPC, Chapel…. The main focus was clearly on the first three. Intrigued by the topic I did some research on my own but could find sources, examples and discussions mai...
programming languages computation models parallel computing message passing
1
Parallel programming models: Why do OpenMP and MPI dominate? -- (programming languages computation models parallel computing message passing) <p>In a lecture on HPC parallel programming (for CPUs) we discussed various models available from Pthreads to OpenMP to MPI and others like Charm++, X10, UPC, Chapel…. The main f...
habedi/stack-exchange-dataset
121,194
How many times is a for loop executed?
<p>Consider the following code snippet:</p>&#xA;&#xA;<pre><code>for(int i=0;i&lt;n;i++)&#xA;</code></pre>&#xA;&#xA;<p>The question I have is: whether this loop is executed <span class="math-container">$n$</span> times or <span class="math-container">$(n+1)$</span> times?</p>&#xA;&#xA;<p>According to what I understand: ...
algorithms time complexity loops
1
How many times is a for loop executed? -- (algorithms time complexity loops) <p>Consider the following code snippet:</p>&#xA;&#xA;<pre><code>for(int i=0;i&lt;n;i++)&#xA;</code></pre>&#xA;&#xA;<p>The question I have is: whether this loop is executed <span class="math-container">$n$</span> times or <span class="math-cont...
habedi/stack-exchange-dataset
121,197
Cont: NP-hard or not: partition with irrational input or parameter
<p>Please take a look at <a href="https://cs.stackexchange.com/questions/121153/np-hard-or-not-partition-with-irrational-input-or-parameter]">NP-hard or not: partition with irrational input or parameter</a> first. </p>&#xA;&#xA;<p>In <a href="https://cs.stackexchange.com/questions/121185/will-irrational-parameters-mak...
complexity theory
1
Cont: NP-hard or not: partition with irrational input or parameter -- (complexity theory) <p>Please take a look at <a href="https://cs.stackexchange.com/questions/121153/np-hard-or-not-partition-with-irrational-input-or-parameter]">NP-hard or not: partition with irrational input or parameter</a> first. </p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
121,199
Color coding to get an FPT algoirthm for $k$ disjoint triangles
<p>Consider the following problem:</p>&#xA;<p><strong>Input</strong>: A graph <span class="math-container">$G=(V,E)$</span> and an integer <span class="math-container">$k \in \mathbb{N}$</span></p>&#xA;<p><strong>Output</strong>: Are there <span class="math-container">$k$</span> vertex-disjoint triangles in <span class...
complexity theory np hard randomized algorithms
1
Color coding to get an FPT algoirthm for $k$ disjoint triangles -- (complexity theory np hard randomized algorithms) <p>Consider the following problem:</p>&#xA;<p><strong>Input</strong>: A graph <span class="math-container">$G=(V,E)$</span> and an integer <span class="math-container">$k \in \mathbb{N}$</span></p>&#xA;<...
habedi/stack-exchange-dataset
121,205
How does Pollard's rho algorithm work?
<p>I am trying to understand how does <code>Pollard's rho</code> algorithm actually work, but I just can not wrap my head around it. I already read its section in the CLRS book and also on internet but still can not understand its structure or analysis. &#xA;This is a java implementation of the pseudocode from the CLRS...
algorithms modular arithmetic factoring
1
How does Pollard's rho algorithm work? -- (algorithms modular arithmetic factoring) <p>I am trying to understand how does <code>Pollard's rho</code> algorithm actually work, but I just can not wrap my head around it. I already read its section in the CLRS book and also on internet but still can not understand its struc...
habedi/stack-exchange-dataset
121,215
Is this correct : whether or not a type 3 grammar generates $\Sigma^*$ is not c.e
<p>An example from Sipser's book, Introduction to the Theory of Computation, shows that it is not decidable for a <span class="math-container">$TM$</span> to recognize whether a <span class="math-container">$CFG$</span> (or a type 2 grammar) generates <span class="math-container">$\Sigma^*$</span>, where <span class="m...
formal languages regular languages undecidability
1
Is this correct : whether or not a type 3 grammar generates $\Sigma^*$ is not c.e -- (formal languages regular languages undecidability) <p>An example from Sipser's book, Introduction to the Theory of Computation, shows that it is not decidable for a <span class="math-container">$TM$</span> to recognize whether a <span...
habedi/stack-exchange-dataset
121,216
Is it possible to constract Moore or Mealy machine with a different size of input and output?
<p>Is it possible to constract Moore or Mealy machine to take input tape: 0011 and output: 00001111 (or vice versa). In other words, input and output have different size. </p>&#xA;&#xA;<p>I want to construct FSMs to produce different transformation patters:</p>&#xA;&#xA;<ol>&#xA;<li>copy 2 times: 11 -> 11011, 101 -> 10...
automata finite automata transducers
1
Is it possible to constract Moore or Mealy machine with a different size of input and output? -- (automata finite automata transducers) <p>Is it possible to constract Moore or Mealy machine to take input tape: 0011 and output: 00001111 (or vice versa). In other words, input and output have different size. </p>&#xA;&#xA...
habedi/stack-exchange-dataset
121,222
"If A is nonregular, then there exists a nonregular language B such that A ∩ B is finite."?
<p>Is the statement true?</p>&#xA;&#xA;<p>I feel that the statement is true. I want to prove it but I don't know how to start the proof.</p>&#xA;&#xA;<p>Any help would be appreciated.</p>&#xA;
automata regular languages
1
"If A is nonregular, then there exists a nonregular language B such that A ∩ B is finite."? -- (automata regular languages) <p>Is the statement true?</p>&#xA;&#xA;<p>I feel that the statement is true. I want to prove it but I don't know how to start the proof.</p>&#xA;&#xA;<p>Any help would be appreciated.</p>&#xA;
habedi/stack-exchange-dataset
121,228
3-Approximation for General position subset
<p>I am currently studying for an exam and stumbled upon the following task:&#xA;Given the following problem:</p>&#xA;&#xA;<p><strong>Input</strong> A set of points <span class="math-container">$P \subseteq \mathcal{Q}^2$</span> and <span class="math-container">$k \in \mathbb{N}$</span></p>&#xA;&#xA;<p><strong>Question...
computational geometry approximation
1
3-Approximation for General position subset -- (computational geometry approximation) <p>I am currently studying for an exam and stumbled upon the following task:&#xA;Given the following problem:</p>&#xA;&#xA;<p><strong>Input</strong> A set of points <span class="math-container">$P \subseteq \mathcal{Q}^2$</span> and <...
habedi/stack-exchange-dataset
121,230
Explanation of O(n2^n) time complexity for powerset generation
<p>I'm working on a problem to generate all powersets of a given set. The algorithm itself is relatively straightforward:</p>&#xA;&#xA;<pre><code>def power_sets(A):&#xA; """Returns the power set of A as a list of lists"""&#xA;&#xA; if len(A) == 0:&#xA; return [[]]&#xA;&#xA; else:&#xA; ps_n1 = pow...
time complexity asymptotics runtime analysis recursion sets
1
Explanation of O(n2^n) time complexity for powerset generation -- (time complexity asymptotics runtime analysis recursion sets) <p>I'm working on a problem to generate all powersets of a given set. The algorithm itself is relatively straightforward:</p>&#xA;&#xA;<pre><code>def power_sets(A):&#xA; """Returns the powe...
habedi/stack-exchange-dataset
121,243
Relationship between circuit size and formula size in Sipser text
<p>The <a href="https://math.mit.edu/~sipser/book.html" rel="nofollow noreferrer">Sipser text</a> (3rd edition) contains a proof that 3-SAT is NP-Complete based on Boolean circuits. Part of the proof contains the remark that the reduction from the circuit to the Boolean formula can be done in polynomial time.</p>&#xA;&...
complexity theory circuits boolean algebra
1
Relationship between circuit size and formula size in Sipser text -- (complexity theory circuits boolean algebra) <p>The <a href="https://math.mit.edu/~sipser/book.html" rel="nofollow noreferrer">Sipser text</a> (3rd edition) contains a proof that 3-SAT is NP-Complete based on Boolean circuits. Part of the proof contai...
habedi/stack-exchange-dataset
121,245
Why MIT lecture breadth-first search algorithm is so complicated?
<p>I watched a <a href="http://https:://youtu.be/s-CYnVz-uh4" rel="nofollow noreferrer">video for BFS from MIT</a> and the algorithm the lecturer presented was really complicated compared to what I came up. My solution seems to work fine and walk through the vertices in the correct order. Am I missing something?</p>&#x...
breadth first search
1
Why MIT lecture breadth-first search algorithm is so complicated? -- (breadth first search) <p>I watched a <a href="http://https:://youtu.be/s-CYnVz-uh4" rel="nofollow noreferrer">video for BFS from MIT</a> and the algorithm the lecturer presented was really complicated compared to what I came up. My solution seems to ...
habedi/stack-exchange-dataset
121,247
The characterization of a problem as PSPACE-complete is ...?
<p>Let's assume that you found out that some problem <span class="math-container">$\mathit{\Pi}$</span> is PSPACE-complete (with respect to your favorite kind of reductions, say, logspace reductions). However, as there are dozens of well-known and very different PSPACE-complete problems, this characterization doesn't t...
terminology space complexity
1
The characterization of a problem as PSPACE-complete is ...? -- (terminology space complexity) <p>Let's assume that you found out that some problem <span class="math-container">$\mathit{\Pi}$</span> is PSPACE-complete (with respect to your favorite kind of reductions, say, logspace reductions). However, as there are do...
habedi/stack-exchange-dataset
121,253
Prove that a language is regular
<p>I'm working on an example which says that a string x is obtained from a string w by deleting symbols if it is possible&#xA;to remove zero or more symbols from w so that just the string x remains. For example, the&#xA;following strings can all be obtained from 0110 by deleting symbols:</p>&#xA;&#xA;<p>λ, 0, 1, 00, 01...
automata regular languages finite automata
1
Prove that a language is regular -- (automata regular languages finite automata) <p>I'm working on an example which says that a string x is obtained from a string w by deleting symbols if it is possible&#xA;to remove zero or more symbols from w so that just the string x remains. For example, the&#xA;following strings c...
habedi/stack-exchange-dataset
121,269
What is the algorithmic complexity of this?
<p>I'm practicing leet code questions and want to understand more fully how to determine Big O notation. What is the algorithmic complexity of my solution to the following problem? </p>&#xA;&#xA;<p><strong>O(n^2) ?</strong> For every item in n I could loop an additional n[i] times. Or is it <strong>O(n)</strong> ?</p>&...
algorithm analysis
1
What is the algorithmic complexity of this? -- (algorithm analysis) <p>I'm practicing leet code questions and want to understand more fully how to determine Big O notation. What is the algorithmic complexity of my solution to the following problem? </p>&#xA;&#xA;<p><strong>O(n^2) ?</strong> For every item in n I could ...
habedi/stack-exchange-dataset
121,279
Selecting vertices in a graph in an order to keep border vertices as few as possible
<p>I am given an undirected graph. Initially all vertices are white. I need to color them black in such an order that the maximum number of vertices which are on the border between black and white regions is minimal. Is there an algorithm to find an optimal order for that?</p>&#xA;&#xA;<p>More formally. We are given an...
algorithms graphs optimization
1
Selecting vertices in a graph in an order to keep border vertices as few as possible -- (algorithms graphs optimization) <p>I am given an undirected graph. Initially all vertices are white. I need to color them black in such an order that the maximum number of vertices which are on the border between black and white re...
habedi/stack-exchange-dataset
121,293
Time complexity for the 'Restore IP Addresses' problem
<p>There's a programming problem 'Restore IP Addresses' where given a string containing only digits, restore it by returning all possible valid IP address combinations. Example, "25525511135" returns ["255.255.11.135", "255.255.111.35"].</p>&#xA;&#xA;<p>My solution basically breaks up the string (upto 3 chars at a time...
time complexity space complexity
1
Time complexity for the 'Restore IP Addresses' problem -- (time complexity space complexity) <p>There's a programming problem 'Restore IP Addresses' where given a string containing only digits, restore it by returning all possible valid IP address combinations. Example, "25525511135" returns ["255.255.11.135", "255.255...
habedi/stack-exchange-dataset
121,299
Why Minimum circuit size problem is important?
<p>Given a truth table, find the smallest size circuit computing it. Recently it was shown that for multiple output function the problem MSCP (Minimum Size Circuit Problem) is NP-Complete. The article is available online <a href="https://eccc.weizmann.ac.il/report/2020/021/" rel="nofollow noreferrer">see</a>.</p>&#xA;&...
complexity theory
1
Why Minimum circuit size problem is important? -- (complexity theory) <p>Given a truth table, find the smallest size circuit computing it. Recently it was shown that for multiple output function the problem MSCP (Minimum Size Circuit Problem) is NP-Complete. The article is available online <a href="https://eccc.weizman...
habedi/stack-exchange-dataset
121,304
binary search terminating condition (left != right) vs (left <= right)
<p>I have seen several implementations of binary search where they can use either (left != right) or (left &lt;= right). For example, in normal binary search where you check if target value is in the array, using inclusive right bound (right initially set to array size-1), you will use left &lt;= right. When you want t...
binary search
1
binary search terminating condition (left != right) vs (left <= right) -- (binary search) <p>I have seen several implementations of binary search where they can use either (left != right) or (left &lt;= right). For example, in normal binary search where you check if target value is in the array, using inclusive right b...
habedi/stack-exchange-dataset
121,309
Why doesn't the recursion theorem prove there is an undecidable finite set?
<p>I created something similar to Sipser's proof for the undecidability of <span class="math-container">$A_{TM}$</span> (theorem 6.5), &quot;proving&quot; the undecidability of a set that must be finite. Presumably, it's wrong, but I can't figure out why for the life of me.</p>&#xA;<blockquote>&#xA;<p><span class="math...
turing machines computability undecidability
1
Why doesn't the recursion theorem prove there is an undecidable finite set? -- (turing machines computability undecidability) <p>I created something similar to Sipser's proof for the undecidability of <span class="math-container">$A_{TM}$</span> (theorem 6.5), &quot;proving&quot; the undecidability of a set that must b...
habedi/stack-exchange-dataset
121,312
Does RAM get an indication of data size required
<h2>Pre-information:</h2>&#xA;&#xA;<p>I'm sure someone has asked something along these lines, but no matter how I word it, I can't seem to find a definitive answer</p>&#xA;&#xA;<h2>Question:</h2>&#xA;&#xA;<p>Does RAM get some kind of indication as to how much data the CPU requires or is there a set amount of data and i...
memory management cpu cache memory access
1
Does RAM get an indication of data size required -- (memory management cpu cache memory access) <h2>Pre-information:</h2>&#xA;&#xA;<p>I'm sure someone has asked something along these lines, but no matter how I word it, I can't seem to find a definitive answer</p>&#xA;&#xA;<h2>Question:</h2>&#xA;&#xA;<p>Does RAM get som...
habedi/stack-exchange-dataset
121,348
Termination of Z combinator with call-by-value
<p>I am trying to build my own λ-calculus interpreter. So far it supports both call-by-value and normal order.</p>&#xA;&#xA;<p>I now want to try recursion via fixed points. The <span class="math-container">$Y$</span> combinator works with normal order, tested with the faculty function <span class="math-container">$$\te...
lambda calculus evaluation strategies fixed point
1
Termination of Z combinator with call-by-value -- (lambda calculus evaluation strategies fixed point) <p>I am trying to build my own λ-calculus interpreter. So far it supports both call-by-value and normal order.</p>&#xA;&#xA;<p>I now want to try recursion via fixed points. The <span class="math-container">$Y$</span> c...
habedi/stack-exchange-dataset
121,354
why don't we use machines with random access memory as our basic model of computation?
<p>Turing machines are perhaps the most popular model of computation for theoretical computer science. Turing machines don't have random access memory, since we can only do a read where the slider is currently located.</p>&#xA;&#xA;<p>This seem unwieldy to me. Why don't theoretical computer scientists use a model with ...
turing machines
1
why don't we use machines with random access memory as our basic model of computation? -- (turing machines) <p>Turing machines are perhaps the most popular model of computation for theoretical computer science. Turing machines don't have random access memory, since we can only do a read where the slider is currently lo...
habedi/stack-exchange-dataset
121,355
"Subpaths" of Dijkstra's shortest path also shortest?
<p>I have trouble putting this into formal mathematical terms, so let's suppose that I found the shortest path from A to E as A > C > D > B > F > E with Dijkstra's algorithm. Am I correct in assuming that the shortest path from C to B would be C > D > B, and that the shortest path from D to F would be D > B > F?</p>&#x...
algorithms algorithm analysis dijkstras algorithm
1
"Subpaths" of Dijkstra's shortest path also shortest? -- (algorithms algorithm analysis dijkstras algorithm) <p>I have trouble putting this into formal mathematical terms, so let's suppose that I found the shortest path from A to E as A > C > D > B > F > E with Dijkstra's algorithm. Am I correct in assuming that the sh...
habedi/stack-exchange-dataset
121,358
Relation between size of address bus and memory size; memory Segmentation in 8086
<p>My question is related to memory segmentation in 8086. I learnt that,</p>&#xA;&#xA;<blockquote>&#xA; <p>8086 has a 20 bit address bus. And so it can address 2^20 different addresses. Which means it has an memory size of 2^20, i.e, 1MB.</p>&#xA;</blockquote>&#xA;&#xA;<p>I have a few doubts:</p>&#xA;&#xA;<ol>&#xA;<li...
memory management cpu
1
Relation between size of address bus and memory size; memory Segmentation in 8086 -- (memory management cpu) <p>My question is related to memory segmentation in 8086. I learnt that,</p>&#xA;&#xA;<blockquote>&#xA; <p>8086 has a 20 bit address bus. And so it can address 2^20 different addresses. Which means it has an me...
habedi/stack-exchange-dataset
121,364
What are the underlying mechanisms allowing us to unsend an email?
<p>I am currently studying Computer Networking, and I was reading about the different types of Application Layer Protocols. In the book I am reading (Computer Networking: A Top-down Approach) it is mentioned that: "<em>Once the client&#xA;sends a message into its socket interface, the message is out of the client’s han...
computer networks communication protocols
1
What are the underlying mechanisms allowing us to unsend an email? -- (computer networks communication protocols) <p>I am currently studying Computer Networking, and I was reading about the different types of Application Layer Protocols. In the book I am reading (Computer Networking: A Top-down Approach) it is mentione...
habedi/stack-exchange-dataset
121,365
Where to find practical exercises for algorithm analysis?
<p>What is a good book or resource to find practical exercises of analysis of the complexity of concrete algorithm implementations (that is, which asymptotic complexity does a particular code have)? </p>&#xA;&#xA;<p>I'm interested not in solving algorithms but in practising finding out their complexity. I have seen a c...
algorithm analysis
1
Where to find practical exercises for algorithm analysis? -- (algorithm analysis) <p>What is a good book or resource to find practical exercises of analysis of the complexity of concrete algorithm implementations (that is, which asymptotic complexity does a particular code have)? </p>&#xA;&#xA;<p>I'm interested not in ...
habedi/stack-exchange-dataset
121,375
Is my grammar correct and context free?
<p>I have this language </p>&#xA;&#xA;<p><span class="math-container">$L = \{a^{n}b^{3n}c^{2m} : m,n \ge 1\}$</span>. </p>&#xA;&#xA;<p>I have to determine a free context grammar that generates L.&#xA;Looks easy BUT i have a question about the grammar I found.&#xA;First things first, this is my grammar:</p>&#xA;&#xA;<p>...
context free formal grammars
1
Is my grammar correct and context free? -- (context free formal grammars) <p>I have this language </p>&#xA;&#xA;<p><span class="math-container">$L = \{a^{n}b^{3n}c^{2m} : m,n \ge 1\}$</span>. </p>&#xA;&#xA;<p>I have to determine a free context grammar that generates L.&#xA;Looks easy BUT i have a question about the gra...
habedi/stack-exchange-dataset
121,381
What is the meaning of the mutation rate in genetic algorithms?
<p>Let us suppose that we have a mutation rate of 5%. What does this mean?</p>&#xA;&#xA;<ul>&#xA;<li>Each gene of each individual has 5% of probability of change to another value? At the end, around 5% of the genes of each individual in the population will be changed.</li>&#xA;<li>Each individual in the population has ...
artificial intelligence
1
What is the meaning of the mutation rate in genetic algorithms? -- (artificial intelligence) <p>Let us suppose that we have a mutation rate of 5%. What does this mean?</p>&#xA;&#xA;<ul>&#xA;<li>Each gene of each individual has 5% of probability of change to another value? At the end, around 5% of the genes of each indi...
habedi/stack-exchange-dataset
121,399
Dynamic selection of cache replacement policy
<p>There are some different cache replacement policies could be implemented in CPU. As far as I know, ones have better hit ratio on specific type of code than others, but if that type changes (for example, loops and scan of long file), other replacement policy may become more effective. Did somebody try to investigate ...
cpu cache caching
1
Dynamic selection of cache replacement policy -- (cpu cache caching) <p>There are some different cache replacement policies could be implemented in CPU. As far as I know, ones have better hit ratio on specific type of code than others, but if that type changes (for example, loops and scan of long file), other replaceme...
habedi/stack-exchange-dataset
121,401
Asymptotics of a logarithmic series
<p>Given that,</p>&#xA;&#xA;<p><span class="math-container">$T(n) = \sum_{i=2}^{n} \log_i n$</span></p>&#xA;&#xA;<p>I need to find the asymptotic boundary of <span class="math-container">$T(n)$</span>.</p>&#xA;&#xA;<p>Answer given is <span class="math-container">$\theta(n)$</span>.&#xA;Please provide explanation. </p>&...
asymptotics
1
Asymptotics of a logarithmic series -- (asymptotics) <p>Given that,</p>&#xA;&#xA;<p><span class="math-container">$T(n) = \sum_{i=2}^{n} \log_i n$</span></p>&#xA;&#xA;<p>I need to find the asymptotic boundary of <span class="math-container">$T(n)$</span>.</p>&#xA;&#xA;<p>Answer given is <span class="math-container">$\th...
habedi/stack-exchange-dataset
121,408
Contour pushing algorithm
<p>I'm implementing push contour feature for web application. It is an ability to change the contour by touching it. Mouse pointer becomes a circle that bumps contour (like in Photoshop). Contour is <em>polyline</em> object and pushing circle is some point with defined radius.</p>&#xA;&#xA;<p>Sequence of actions on <co...
algorithms
1
Contour pushing algorithm -- (algorithms) <p>I'm implementing push contour feature for web application. It is an ability to change the contour by touching it. Mouse pointer becomes a circle that bumps contour (like in Photoshop). Contour is <em>polyline</em> object and pushing circle is some point with defined radius.<...
habedi/stack-exchange-dataset
121,468
Proving that $T(n) = T(\lfloor n/2 \rfloor) + T(\lfloor n/4 \rfloor) + T(\lfloor n/8 \rfloor) + n$ is $\in O(n)$
<blockquote>&#xA; <p>Show <span class="math-container">$T(n) = T(\lfloor n/2 \rfloor) + T(\lfloor n/4 \rfloor) + T(\lfloor&#xA;n/8 \rfloor) + n$</span> is <span class="math-container">$\in O(n)$</span>.</p>&#xA;</blockquote>&#xA;&#xA;<p>I will make the bound to be <span class="math-container">$\in O(cn)$</span> instea...
asymptotics recurrence relation
1
Proving that $T(n) = T(\lfloor n/2 \rfloor) + T(\lfloor n/4 \rfloor) + T(\lfloor n/8 \rfloor) + n$ is $\in O(n)$ -- (asymptotics recurrence relation) <blockquote>&#xA; <p>Show <span class="math-container">$T(n) = T(\lfloor n/2 \rfloor) + T(\lfloor n/4 \rfloor) + T(\lfloor&#xA;n/8 \rfloor) + n$</span> is <span class="m...
habedi/stack-exchange-dataset
121,471
NFA-$\epsilon$ extended transition function for inverted strings
<p>It is well known that in <span class="math-container">$NFA-\epsilon$</span> the extended transition function is defined as it follows:&#xA;<span class="math-container">\begin{align*}&#xA;\hat\delta: Q &amp;\times \Sigma^* \rightarrow \mathbb{P}(Q) \\&#xA;\hat\delta(q,\epsilon) &amp;= ECLOSURE(q) \\&#xA;\hat\delta(q,...
formal languages automata finite automata
1
NFA-$\epsilon$ extended transition function for inverted strings -- (formal languages automata finite automata) <p>It is well known that in <span class="math-container">$NFA-\epsilon$</span> the extended transition function is defined as it follows:&#xA;<span class="math-container">\begin{align*}&#xA;\hat\delta: Q &amp...
habedi/stack-exchange-dataset
121,477
Mod 2 is primitive recursive
<blockquote>&#xA; <p>Given a function E(x) which outputs 0 is x is even and 1 is x is odd, prove that this function is primitive recursive. </p>&#xA;</blockquote>&#xA;&#xA;<hr>&#xA;&#xA;<p>My attempt is as follows</p>&#xA;&#xA;<p><span class="math-container">$$ E(x) = x \mod 2$$</span>&#xA;To show that any function is...
computability primitive recursion
1
Mod 2 is primitive recursive -- (computability primitive recursion) <blockquote>&#xA; <p>Given a function E(x) which outputs 0 is x is even and 1 is x is odd, prove that this function is primitive recursive. </p>&#xA;</blockquote>&#xA;&#xA;<hr>&#xA;&#xA;<p>My attempt is as follows</p>&#xA;&#xA;<p><span class="math-con...
habedi/stack-exchange-dataset
121,486
What is the point of the "check" array in a triple-array trie?
<p>I am currently reading the definition of a triple-array trie as described <a href="https://linux.thai.net/~thep/datrie/" rel="nofollow noreferrer">here</a>.</p>&#xA;&#xA;<p>More precisely, I am trying to understand the nature of the three arrays:</p>&#xA;&#xA;<blockquote>&#xA; <ul>&#xA; <li><strong><em>base</em></...
data structures information retrieval
1
What is the point of the "check" array in a triple-array trie? -- (data structures information retrieval) <p>I am currently reading the definition of a triple-array trie as described <a href="https://linux.thai.net/~thep/datrie/" rel="nofollow noreferrer">here</a>.</p>&#xA;&#xA;<p>More precisely, I am trying to underst...
habedi/stack-exchange-dataset
121,493
Prove Lecture Planning is NP-complete
<p>This is a practice problem from my algorithms class. (And no, it was not assigned as homework. I can't prove this, but you don't have to answer if you don't believe me.) To me this seems like a very difficult problem to show NP-completeness for since due to its abundance of features, it's tricky to mold a known NP-c...
complexity theory np complete
1
Prove Lecture Planning is NP-complete -- (complexity theory np complete) <p>This is a practice problem from my algorithms class. (And no, it was not assigned as homework. I can't prove this, but you don't have to answer if you don't believe me.) To me this seems like a very difficult problem to show NP-completeness for...
habedi/stack-exchange-dataset
121,501
Difficulty in understanding this summations to analyze time complexity
<p>I wanna know if what this link <a href="https://stackabuse.com/shell-sort-in-java/" rel="nofollow noreferrer">https://stackabuse.com/shell-sort-in-java/</a>'s calculation of the complexity of shell sort is true.</p>&#xA;&#xA;<p>Here's the shell sort algorithm:</p>&#xA;&#xA;<pre><code>void shellSort(int array[], int ...
algorithms time complexity loops java
1
Difficulty in understanding this summations to analyze time complexity -- (algorithms time complexity loops java) <p>I wanna know if what this link <a href="https://stackabuse.com/shell-sort-in-java/" rel="nofollow noreferrer">https://stackabuse.com/shell-sort-in-java/</a>'s calculation of the complexity of shell sort ...
habedi/stack-exchange-dataset
121,504
Sqrt(x) function implementation; what is $(i^2 \leq x) \land ((i + 1)^2 > x)$ checking?
<p>Recently I was working on a <a href="https://leetcode.com/problems/sqrtx/" rel="nofollow noreferrer">LeetCode question</a></p>&#xA;&#xA;<pre><code>Compute and return the square root of x, where x is guaranteed to be a non-negative integer.&#xA;&#xA;Since the return type is an integer, the decimal digits are truncate...
algorithms search algorithms
1
Sqrt(x) function implementation; what is $(i^2 \leq x) \land ((i + 1)^2 > x)$ checking? -- (algorithms search algorithms) <p>Recently I was working on a <a href="https://leetcode.com/problems/sqrtx/" rel="nofollow noreferrer">LeetCode question</a></p>&#xA;&#xA;<pre><code>Compute and return the square root of x, where x...
habedi/stack-exchange-dataset
121,514
Practical applications of the palindromic substring problem?
<p>The longest palindromic substring problem is certainly an interesting intellectual exercise, and seems to be popular in coding interviews in industry. As an interesting puzzle, its popularity for interviews is not too hard to understand--it's not too hard to find an <span class="math-container">$O(N^2)$</span> solut...
algorithms applied theory
1
Practical applications of the palindromic substring problem? -- (algorithms applied theory) <p>The longest palindromic substring problem is certainly an interesting intellectual exercise, and seems to be popular in coding interviews in industry. As an interesting puzzle, its popularity for interviews is not too hard to...
habedi/stack-exchange-dataset
121,526
Deriving the Time Complexity of Ryser's Algorithm for Evaluating the Permanent of a Matrix
<p>Ryser has shown that the permanent of an <span class="math-container">$n \times n$</span> matrix <span class="math-container">$A=(a_{ij})$</span> can be expressed as </p>&#xA;&#xA;<p><span class="math-container">\begin{align}&#xA;Perm(A) = (-1)^n \sum_{s \subset [n]} (-1)^{|s|} \prod_{i=1}^n \sum_{j \in s} a_{ij},&#...
algorithms complexity theory algorithm analysis time complexity
1
Deriving the Time Complexity of Ryser's Algorithm for Evaluating the Permanent of a Matrix -- (algorithms complexity theory algorithm analysis time complexity) <p>Ryser has shown that the permanent of an <span class="math-container">$n \times n$</span> matrix <span class="math-container">$A=(a_{ij})$</span> can be expr...
habedi/stack-exchange-dataset
121,528
What is the earliest use of the "this" keyword in any programming language?
<p>I understand the <code>this</code> (or <code>self</code> or <code>Me</code>) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The earliest language I could find which has such a concept was Smalltalk, which uses <code>self</code> but was wondering where and w...
programming languages history object oriented
1
What is the earliest use of the "this" keyword in any programming language? -- (programming languages history object oriented) <p>I understand the <code>this</code> (or <code>self</code> or <code>Me</code>) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The ea...
habedi/stack-exchange-dataset