instruction
stringlengths
35
29.1k
A and ( A or C ) = A And A or A and C = A How do these identities work? Using the rule A and ( B or C ) = A and B or A and C For the first identity, I get A and A or A and C = A or A and C How is the C eliminated? Mental substitution shows that it will equal A, but can it be algebraically shown. Equation 2, t...
This is third-hand, so please bear with me. A collaborator was at a review meeting where he heard another participant make the claim that given an assignment for a SAT problem that satisfies (some high percentage) of clauses, there are polynomial time algorithms that finish the problem. Is this true? Can someone poin...
For my application problem, I am looking for an easy to implement or source code for approximation algorithm for maximum k-Set Packing problem. Given a universe $U$ and a family $ \mathcal{S} $ of subsets of $ {\mathcal{U}}$. Assume that all subsets in $\mathcal{S}$ have size $k$. A $k$-set packing is a subfamily ${...
In this course lecture; section 5.1, single-source shortest path (SSSP) is formulated as the following linear program (LP): \begin{align} \max &\sum d_u \\ \text{subject to} & \\ d_v &\le d_u + l_{uv} \quad \forall (u,v) \in E \\ d_s &= 0 \end{align} The comment on the objective function is as follows (emphasis added):...
What is an example of a typed lambda term $\lambda x.\phi : A \to B$ and a term $a : A$ such that, when $\beta$-reducing the term $(\lambda x.\phi)(a)$, the argument $a$ must be repeated/recomputed several times?
If $2$ is the Church numeral $\lambda fx. f(f(x))$, then is there a closed term $t$ of System F of type $\forall \alpha ((\alpha \to \alpha) \to (\alpha \to \alpha))$ such that the type-erasure of $t$ is the untyped term $2(2)$?
Suppose that I am given as input the number $p^i$ for some prime $p$ and some positive integer $i$. I wish to find $p$ and $i$. Is there an algorithm to do this that works in time polynomial in the number of digits of $p^i$?
Im trying to work out that a Hadamard transform H (a unitary matrix) is its own inverse by applying it twice to an arbitrary state $|x⟩$: $$H|x⟩ = \frac{1}{\sqrt{2^n}}\sum_{y \in \{0,1\}^n}(-1)^{x \cdot y}|y⟩\,.$$ Then \begin{align*} H\left(\frac{1}{\sqrt{2^n}}\sum_{y \in \{0,1\}^n}(-1)^{x \cdot y}|y⟩\right) &= \frac{1...
We're given $n^2$ different points in $(0,1)$ : $x_1< x_2 < \dots < x_{n^2}$. We are required to choose $n$ points $x_{i_1}<\dots<x_{i_n}$ such that the value of $\max\,\{x_{i_1}, x_{i_2}-x_{i_1}, x_{i_3}-x_{i_2},\dots,x_{i_n} - x_{i_{n-1}}, 1-x_{i_n}\} $ is minimal. It feels a lot like a dynamic programming problem, ...
Let $C$ be the binary linear code with the following generator matrix $G= \begin{bmatrix} 1 & 1 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 1 \end{bmatrix}$ I need to decode the received word $r$, $\begin{pmatrix} 1 & 1 & 0 &0 & 0 &1 &1\end{pmat...
Definition: $\text{A fuction}\ f: \Sigma^* \to \Sigma^*\ \text{is a reduction from Language A to language B if}\ w\in A \iff f(w) \in B\ \text{for every}\ w \in \Sigma^*$. My question is which direction should I take in order to reduce a problem to another the other? From what I've been reading I concluded we can pro...
Question is $$\left\{ w | w \text{ contains an even number of } 0\text{s or exactly two }1\text{s} \right\}$$ I need to confirm my answer but i don't from where to ask someone. My answer is 1*(01*0)*+11 but i don't know if it's correct or not
Problem Statement: Want to find out what impact Insurance markets will have if ACA (Obamacare) is repealed. This can be done by creating an ABM (agent based model) and trying out simulations. What I want to do is solve this as a machine learning problem. The Approach I thought of is training a classifier(or an ensemble...
Let $F$ be a finite set of real numbers say $\{w_1,\dots,w_k\}$. Let $G=(V,E)$ be an undirected connected graph and let $w\colon E\to F$ be a weight function. Describe a linear time algorithm that will find a Minimum spanning tree in $G$. Assume that $|V|\gg k$, i.e. the number of vertices is much larger than k. I kno...
Consider a Turing machine $T$ with access to an oracle for a proper, nonempty subset of $A_{TM}$, say $L$. That is, $T$ can query this oracle to check whether some string belongs or doesn't belong to $L$. Is it possible to define such an $L$ so that $T$ does not decide $E_{TM}$ (the language of descriptions of Turing m...
Given a language $L$, I sometimes try to find a subset of $L' \subseteq L$ which I can prove is undecidable. I conclude that if a subset of $L$ is undecidable, then $L$ must be undecidable as well. Is this correct for arbitrary languages $L$ and $L' \subseteq L$? What if someone said: $L'$ could be empty (we don't know...
I am trying to implement an optimization procedure in Python using BFGS and L-BFGS in Python, and I am getting surprisingly different results in the two cases. L-BFGS converges to the proper minimum super fast, whereas BFGS converges very slowly, and that too to a nonsensical minimum. QUESTION: From my readings, it see...
I was trying to rigorously/mathematically analyze the runtime of the following algorithm: while i < n { b_D = randomly_generate_bit_array_length(D) # simply selects each bit randomly with 1/2 prob of choosing 0 or 1. if b_n NOT in HashTable[b_D]: HashTable[b_D] = b_D i++ } First I started by th...
Say a graph contains a directed edge e from vertex a to vertex b. Is there a standard name for vertex a relative to edge e? And similarly for vertex b? Something akin to vectors in high school physics, where the initial point of the vector is called the "tail" and the terminal point of the vector is called the "tip"?...
I am currently learning about Büchi automata and have a combinatorial question about the acceptance condition. Let $A=(Q,\Sigma,\delta,q_0,F)$ be a (nondeterministic finite) Büchi automaton and $w=w_1w_2w_3\ldots$ an infinite word over $\Sigma$. Suppose that for each natural number $n$ there exists a run $q_0 \xrightar...
Explain and compare selection, insertion and bubble sorts. Assume that your application (say a data base application) deals with large records where comparisons are performed by means of integer keys. Assume also that your application requires a stable sorting method, i.e. a method that does not change the relative o...
Assume I have some data in 2D. How to draw the first and second principal component in PCA method? By referring to the image: the plot on the right is confusing, how I can detect the position of first PCA?
First post here and i hope this is the correct forum to ask this. I'm currently on my 5th semester of Computer Engineering. I´m having some hard time deciding on what to specialize or what to do when i go out from university. Some areas or subjects i'm interested are Mathematics, programming, also gpgpu computing and...
For rules please refer to https://www.hackerrank.com/challenges/ultimate-ttt .I have implemented minimax search with alpha-beta pruning. There is a time limit of 15 seconds.Which algorithms would yield better results?
The complexity of $A^{k \cdot log_{x}(n)}$ is exponential? ($k$ and $x$ is constants, $A$ is defined constant base, $n$ is the size of the task). It is in a class of polynomial complexity?
As I understand it's best practice to always use a prime number during a shell sort for its interval. Why is this the case?
I am given two strings, $\overline{a},\overline{b}$ in a finite alphabet, $\Sigma$, and a positive integer $k$. I want to compute the $k$-th order contiguous string kernel, which is defined to be the sum $$\sum_{s\in\Sigma^k}n_s(\overline{a})n_s(\overline{b})$$ where $n_s(x)$ is equal to the number of occurrences of ...
Consider the language: $A'_{TM} = \{\langle M,w\rangle: M \mbox{ is a TM with access to an oracle for } A_{TM} \mbox{ and } M \mbox{ accepts } w\}$ Clearly, we expect that any language is decidable relative to itself, including $A'_{TM}$. So let $F$ be an oracle decider for $A'_{TM}$ that has access to an oracle for $A...
I have been thinking about this problem for a long time. If anyone can help me out here, I'd really appreciate it. A hypergraph $H = (V,E)$ consists of a set $V = \{v_1, v_2, \cdots, v_n\}$ of vertices and a set $E = \{e_1, e_2, \cdots , e_m\}$ of edges, each being a subset of $V$. A subset $M \subseteq E(H)$ is a ma...
I am working on a homework assignment to create a function and it says to use a "pure recursive approach". I am trying to piece together what is actually meant by this. I am aware a recursive function calls it self, usually by reducing until it hits a base case and a pure function is basically a function that does not ...
Will there ever be differential difference in emotions of humans and a robot? Or will they posses different emotions?
I am a computer science sophomore doing a data structures and algorithms course. My professor said that insertion sort requires random access, while merge sort does not. According to him, the insertion step in insertion sort requires random access. But can't it be implemented using sequential access in a linked list, g...
Primitive recursion seems to be related to bounded quantification. It is easier to make sense of bounded quantification with respect to natural numbers than to make sense of bounded quantification with respect to finite strings. A relatively clean way out of this dilemma could be a two sorted language with both natura...
A $k$-Hamiltonian Path is an Hamiltonian Path where each node (but the last $k$ nodes on the path) is connected to his $k$ successors, and the last $k$ nodes are connected to all of their successors. This is an Hamiltonian Path: This is a 3-Hamiltonian Path: How would you prove that searching for a k-Hamiltonian Path...
Let $\{m_1,...,m_t\}$ be a set of relatively coprime integers $M=\prod_{i=1}^tm_i$ the range of this system $X$ an integer such that $X \in [0,M-1]$ This forms a Residue Number System and every integer $X$ can be uniquely represented in RNS format as $(x_1,\dots,x_t)$, where $x_i = X\bmod m_i, \forall i\in[0,t]$. On...
In my thesis I am working on a problem connected with sequence alignment, in particular, I deal with the Dynamic Time Warping (DTW) algorithm (see this for more), which is used to evaluate the distance between two time series. It is very similar to the Needleman–Wunsch algorithm for aligning protein sequences, the diff...
Let the $\textbf{bold characters}$ represent the vectors/matrices.All the vectors/matrices/scalars only refer to real numbers. In a continuous LTI system. $\frac{d\mathbf{T}(t)}{dt}=\mathbf{A}\mathbf{T}(t)+\mathbf{B}$ in which $\mathbf{T}=[T_i]_{N\times 1}$, $\mathbf{B}=[B_i]_{N\times 1}$ and $\mathbf{A}=[A_{i,j}]_{N\...
A hypergraph $H = (V,E)$ consists of a set $V = \{v_1, v_2, \cdots, v_n\}$ of vertices and a set $E = \{e_1, e_2, \cdots , e_m\}$ of edges, each being a subset of $V$. If each $|V| = 2$, H is a general graph. The degree $d(v)$ of a vertex v is the number of edges that contain it. H is k-regular if every vertex has th...
In Uniqueness Typing Simplified, when applying functions, how many times the function could be used is simply ignored , however, in I Got Plenty o’ Nuttin’ , the application inherit the sparsity from the one of the function, why?
Overfitting happens for some methods in certain conditions, but there is generic rule for all linear classifiers to overfitting? I know that regularization is a remedy for overfitting, but I am asking the behavior of methods before regularization.
Let $C*$ be the length 8 binary code obtained by adding a parity check symbol to each word in $C$. (so a word $c_1, c_2, c_3, c_4, c_5, c_6, c_7$ is extended to the word $c_1, c_2, c_3, c_4, c_5, c_6, c_7, c_8$ for which $\sum_{i=0}^8 c_i =0$. Show that $C*$ is self dual (I.e show that $C*=C*^{\bot}$. Where $C*^{\bot...
For example, we have $T(N) = T(N/2) + T(N/5) + O(N)$. So: $2T(N/2) + O(N) \leq T(N) \leq 2T(N/5) + O(N)$ $O(N) \leq T(N) \leq O(N)$. Thus, $T(N) = O(N)$. Is it correct?
I've been given a question that states I will be given a set of itineraries, which are basically tuples in the form (cost, time) for airplane flights. An itinerary dominates another itinerary if its cost and time are less than the second itinerary's. If there exists an itinerary that dominates the current itinerary, th...
If i have a recursive sequence $a_1=4$ and $a_{n}=a_{n-1}^{2}-2$ in $\mathbb{Z}_{M_{n}}$ where $M_n=2^n-1$ how i can calculate the complexity time of this sequence ? if we put it in the loop for n-1 iteration . pseudocode : S=4; i=2; While($i<n$, $S=S^2-2 (\mod M_n)$ If( S==0 then Break[]); ); im not sure that overal...
I've recently come across the following problem. We're given up to $10^4$ distinct positive integers $a_1,\dots , a_n$, each of them below $10^6$. Let's call a subset $S \subset \{a_1,\dots,a_n\}$ a very divisible subset if any number in this subset divides the product of other numbers in this subset. The task is to fi...
Wikipedia says: The backward propagation of errors or backpropagation, is a common method of training artificial neural networks and used in conjunction with an optimization method such as gradient descent. Ultimately, backward propagation is used to get the partial derivates of the weights and biases of the network,...
If computation on a PDA reaches a final state with an empty stack, will it immediately accept, regardless of whether or not the input tape has ended. For example if I have a PDA to recognize the language of strings where $a^nb^n$, if it was fed the string "aaabbba", will it stop after seeing the last "b" if the stack w...
If you want to fit a polynomial to a set of data points, there are many options available including least squares fitting, gradient descent, and lagrange interpolation. However, thinking in more programmer / computer science terms, let's say that I had something more like a pseudo random number generator where it had s...
I know machine learning can make some predictions. With enough input data and example output data a machine can accept an image as input and determine that the image is likely a "flower" (output). Could the same method apply to an interpretive programming language? Let's say Python for example. The inputs on every "lin...
Consider $\mbox{Halt}_\mbox{TM} = \{\langle M, w \rangle: M \mbox{ is a TM and } M \mbox{ halts on input } w\}$ and $\mbox{A}_\mbox{TM} = \{\langle M, w \rangle: M \mbox{ is a TM and } M \mbox{ accepts on input } w\}$. I'd like to prove that any oracle TM $T$ that can query the $\mbox{A}_\mbox{TM}$-oracle cannot decide...
Hi im looking to calculate FCFS and wondering if anyone can help. I have the dataset of the process, serviceTIme and accessTime, could anyone explain how to calculate the start and end times. Sorry for a dumb question guys! just that i cannot find a clear example. Thanks.
Consider a language $L$ that is undecidable relative to $L_1$ and is also undecidable relative to $L_2$. Suppose, however, that there is a "multi"-oracle Turing machine $M$ that can query both the $L_1$ oracle as well as the $L_2$ oracle such that $M$ decides $L$. In other words, $L$ requires both the $L_1$ and $L_2$ o...
I know the space requirements for a van Emde Boas tree is $Θ(u)$, and that the recurrence relation for this looks like: $$S(u) = (\sqrt u + 1) S(\sqrt u) + Θ(\sqrt u)$$ I'm curious and can't seem to find it anywhere but, how would one go about proving this recurrence relation is true? I.e., how do you prove $S(u) = Θ(u...
I'm trying to figure out if a 2-Dimensional Turing Machine can be represented by any 1-tape TM. I came across the Cantor Pairing Function when doing some research. And based on my understanding and how the pairing function works, any 2D TM can be represented by a 1-tape TM if it uses that said function. Am I right? Can...
I am studying pushdown automata and I am working on a problem that asks to generate a PDA that accepts the following regular languages: Intersection of L1 and L2 L1 = L (aaa* bab) L2 = L (aab* aba) I can't tell if this is even possible because I don't see any common string that would be in both languages. If it is n...
In Spanner, TrueTime & The CAP Theorem, Eric Brewer writes: One subtle thing about Spanner is that it gets serializability from locks, but it gets external consistency (similar to linearizability) from TrueTime [emphasis added]. What is the definition of external consistency, and how does it differ from linearizabi...
I was wondering if the following property holds true: $$\forall A, B \subseteq \Sigma^* : A \leq_m B \lor B \leq_m A$$ And the same for Turing reductions $$\forall A, B \subseteq \Sigma^* : A \leq_T B \lor B \leq_T A$$
Given a relations $P$ and $Q$ on $S$, what are the most efficient algorithms to find whether the relation satisfy the constraints $P \cup Q = S \times S$ and $P \cap Q = \emptyset$? If it helps, for my application the elements of $S$ are strings. Apologies if my question is not up to standard, this is my first question...
I have $n$ items that have a total of $k$ properties. Each item can have any number of properties, from $1$ to $k$. There is no upper limit to k (the lower limit is $\lceil log(n) \rceil$). The items are distinct, so they have different properties. The query must only contain AND logical operators. For example, a query...
It might be a very basic question.$\\$ I am considering the SVM optimization problem here.$\\$ In a training set where the data is linearly separable, and we are using a hard margin (no slack allowed), the support vectors lie along the supporting hyperplanes but is the inverse true that all points lying along the suppo...
Let $f : \mathbb{N} \to \mathbb{N}$ be an integer function. For a language $L$, define $$f(L) = \{w \mid \exists x : |x| = f(|w|) \text{ and } wx \in L\}$$ For example, if $f(n) = n$ this is just the "halving" operation, and regular languages are well known to be closed under this -- just simultaneously walk forwards ...
A heuristic function is said to be consistent, or monotone, if its estimate is always less than or equal to the estimated distance from any neighboring vertex to the goal, plus the step cost of reaching that neighbor. I know I can be sure if a heuristic is consistent by verifying the property for each couple (node, c...
I took part in the development of a knapsack-based asymmetric cryptosystem, and am currently planing to launch a campaign to promote it. Before we actually do, it occurred to me to research... what were all the attempts of knapsack-based cryptosystem, ever devised and which of them have been broken? Thanks in advance.
Consider the following statement: If $x$ and $y$ are integers and $z$ is a nonnegative integer and $x + z = y$, then $x$ is at most $y$. I'd like to build a sentence for this statement in the model of $(\mathbb{N}, +)$, where $\mathbb{N}$ is the set of nonnegative integers and $+$ is just the relation (where here I d...
I have a theoritical question about particles-based simulator (Reeves,83). I don't know if my question is relevant and I apologize if not. On each frame, the system generate particles and attribute to it properties and behaviour (speed, velocity, etc), some of them will die (disappear) after X seconds. Is because the r...
[Disclaimer: this is a rather specialized question] It is known that techniques like Conflict-Driven Clause Learning (CDCL) and back-jumping -- which improved the Satisfiability (SAT) strategies exponentially -- were actually inspired [2] by Constraint Satisfaction Problem (CSP) techniques (so-called nogoods [1], or ge...
I am confused on the inputs of a Long-Short Term Memory (LSTM) for the slot filling task in Spoken Language Understanding. Before I worked on this, I implemented a language model with a Recurrent Neural Network (RNN) and then with a LSTM. The input to the RNN and LSTM language models was a one hot vector, which repres...
As I understand, Decision graph is a directed graph where each vertex is a "Question" (decision to make), and each edge is an "Answer" (decision made for the vertex this edge is coming from). The terminal nodes of that graph is a solution. Problem: With this structure - each "Answer" can lead only to a single consequen...
I am currently studying computer science and we were given assignment to implement two algorithm(Insertion sort and Merge sort) and run them in order to track their running times across different input arrays. And ask us to do: "Your task is to run each algorithm 3 times on 5 input arrays with 5, 50, 500, 5000, and 500...
This is probably a duplicate of this question, but I need a somewhat blunter answer. Let's say I have a polynomial time algorithm that finds an assignment that satisfies more than $\frac{7}{8}$ of the clauses of a satisfiable 3SAT instance. Do I collect my million dollars from the Clay Institute for proving $P=NP$?
$(a(aa|b)^*ab|b)((ba|a)(aa|b)^*ab|bb)^*((ba|a)(aa|b)^*)^*|a(aa|b)^*$ I know long algorithmic procedures but since regex is large I tried a lot by substituting common patterns for some regex definition but didn't seem to help. What can be done so that this regex can be converted to DFA easily.
I am working on a bottleneck multicast tree for which I am using bottleneck Dijkstra algorithm. My question is 1) bottleneck Dijkstra has the same correctness as that of (simple) Dijkstra or not ? 2) if yes then how and if no then how? Will be happy to see your responses. Thank you
Can anyone please help me design an algorithm to solve the broadcast problem in parallel for the structures mentioned?
Every acyclic graph can be transformed structurally to a tree. Therefore, every node on odd numbered levels can be colored with color $X$ and every node on even numbered levels can be colored with color $Y$. Is the reasoning valid?
I have to find all the paths that have some n-distance from a start node. The destination node is not given. It seems that this problem is very hard to solve because in this scenario I am working with a geographical map, thus there exist cycles as well. Finding all of these paths must take a large amount of time becaus...
I was wondering what are the current existing internal clustering index for binary data. I know already the silhouette and Davis Bouldin for euclidian space, i suppose they work as well in binary space using Hamming distance for example, tell me if i'm wrong. We can use the distance to points from centroid per cluster ...
I am building software for an investment manager. The investment manager invests money on behalf of his clients. The investment manager has a model portfolio, of say 20 stocks, each with certain weightage. Eg: His model portfolio can look like this: {GOOG: .03, AAPL: 0.4, MSFT: 0.25, TESLA: 0.5, IBM: 0.1, .....} Now le...
Is there any puzzle or game which cannot be decided in polynomial time and whose problem description can be easily understood by a kid? If it is a fun puzzle so much the better. I want to demonstrate to a high school student the difference between P and NP class of problems using an example. Also, if there's some simpl...
Say, I have the situation where I am looking into all the possibilities to obtain a value of e.g. 20 (exactly) by taking all possible combinations of sums using values from 1 to 5. While doing this, I want to minimize my penalty P. There is no limit to the amount of values I use (I could do 4x5, 20x1 and any other poss...
I have a 3D triangle mesh with the following properties: unique vertices (triangles are stored as 3 vertex indices, the indices are stored in a point set backed up with an octree and a tolerance, to ensure that they are unique) watertight: each edge of the triangle mesh is shared by exactly two triangles The following...
You have to sort a given array (assuming nothing more than the elements are totally ordered) which is write once read many (WORM) in constant space i.e using a constant number of variables. So, my naive approach was to fix the position of one element at a time. But in what order? If I do it first to last then the infor...
I am trying to prove that the language $L=${$0^n 1^m |m ≤n^2$} is not a context free language. To do so I selected a string $w=0^p 1^{p^2}$. However, I am new to the CFL pumping lemma, and I am not sure if my proof is correct. Specifically, does the value of $i$ need to be the same for all divisions? My first division ...
Given that: A language with very expressive type systems (e.g. Idris) can also have escape mechanisms like foreign function interfaces/unsafePerformIO. There are proof assistants that can be used to prove some properties of a program written in a language that doesn't have a type system capable of expressing those pro...
I came up with the following statement: If there are $X$ nodes of height $h$ in an almost complete binary tree, there can be at most 1 node of height $h$ that is not full. That is to say, $X-1$ must full and the last node of height $h$ may or may not be full. Intuitively it seems right, but I can't seem to prove it. ...
Let's say I want to simulate a very large number of travelers booking flights. For example, a traveler might want to fly from New York to New Delhi. There's no direct flight from New York to New Delhi, but there's a flight from New York to London, and from London to New Delhi, so our traveler books those two flights. E...
Given a polynomial $f$ with integer coefficients and a prime power $p^i$, I wish to find a root of $f$ modulo $p^i$, provided one exists, in polynomial or randomized polynomial time in the size of the input. A simple idea would be to use Cantor-Zassenhaus' algorithm to find a root modulo $p$, and then lift it by Hensel...
I'm trying to understand the Naive Surface Nets algorithm which is related to surface generation out of Voxels. I've learned of it here So far I understood that the naive surface nets algorithm calculates the "optimal" edge crossings for a given input. Problem is that I don't understand how it's supposed to calculate t...
Players #1 to #10 with hit probabilities $0.1,0.2,...,0.9,1$ (which are common knowledge) take part in a shooting game. Rules of the game: Players from #1 to #10 take turns to fire at each other. After round one, survivors repeat the circle (still in the order of #1 to #10). The game lasts many rounds until only one p...
Why are the 1st 2nd and 3rd normal forms ignored in some Database books/courses? specifically: https://lagunita.stanford.edu/courses/Engineering/db/2014_1/about and https://www.amazon.com/Database-Systems-Complete-Book-2nd/dp/0131873253/ref=sr_1_4?ie=UTF8&qid=1488557782&sr=8-4&keywords=database+systems only cover BCNF ...
In our current project we need to model the following if-statement in linear programming: If T1 < b < T2 then z = s else z = 0 where T1 and T2 are two integer values (e.g. T1 = 10 and T2 = 100) and s is also an integer value (e.g. 5). We already know how to model a simpler if-statement with for example A > 0 but we ca...
Suppose we have a NP-Complete decision problem like independent set or finding matching in graph theory and we change the greatness or smallness of the condition of that problem i.e. change the direction of the inequality in the problem's definition ($ \ge$ or $\le $). For example in independent set problem when the c...
The algorithm should return the majority element if it exists (majority meaning that there are $> n/2$ occurrences in the array) I came up with this linear divide and conquer algorithm, but I'm not sure if it's correct. It returns an array with two elements, the name of the majority element and a number that is less th...
Looking at the above PDA, I am unsure whether or not it is normalized. Specifically, the loop transition from $q_1$ to $q_1$, because I know a transition must either push OR pop from the stack. Does this mean that there must be two separate transitions to push the * and then pop the *? Or is it normalized as is? Is it...
I work for a small non-profit that provides transportation for people who need medical treatment. We connect volunteer private pilots who fly people in their own (small) aircraft, typically 3-5 seats. Several times each year, we provide flights for kids to go to special needs camps. In this scenario, we have a number o...
I'm currently learning how isosurfaces are extrated from volumetric data. I already understood the original marching cubes algorithm which is based on 3D-voxel data which stores only values of either 1 or 0. For learning purposes I implemented the easier version of it for 2D-volumetric data called marching squares algo...
Statement: There are 256 formal languages $L$ with $L \subseteq \{w \in \{a,b\}^* \ \vert \ \ \vert w \vert = 3 \}$ Answer: True. My question is why there are 256 formal languages. If I calculate the possible combinations with length 3 I get 6 combinations: $M =\{aaa, aab, abb, bbb, bba, baa\}$ Calculalting th...
I am given a matrices each with 4 columns such that each element's value is between 1 to 4. Their is recurring pattern between first two digits while other two are random digits of a row. I need to find a pattern and then reduce it's number of elements. I am new to this topic . I don't need a complete solution just a l...
In the book The Annotated Turing, Charles Pezold writes: Because Turing Machines are entirely defined by a Description Number, it might be possible to create a Turing Machine that analyzes these Description Numbers to determine whether a particular machine is satisfactory or unsatisfactory. Turing proves this is not t...
I would like to know if there is a closed form expression from taking the reciprocal of a polynomial so that I can apply polynomial division to deconvolution using parallel fork-join multithreading. My idea is to multiply the numerator polynomial by the reciprocal of the denominator polynomial using Furer's algorithm ...
I'm not sure if I get the following definition right: 1.Def: A map $\varphi: \Sigma^{*} \rightarrow 2^{\Delta^{*}}$ is called Substitution iff: $\forall u,v \in \Sigma^{*}: \varphi(uv)=\varphi(u) \varphi(v)$ $\varphi(\epsilon)=\{\epsilon\}$ My assumption: every string in $\Sigma^{*}$ with the size $>0$ maps to a Lang...