instruction
stringlengths
35
29.1k
The minimum spanning tree problem can be solved in polynomial time via Kruskal's or Prim's algorithm. However, every integer program I have seen that corresponds to the MST problem require a constraint for every subset of vertices, so the number of constraints would be exponential. That makes me wonder, is it is possib...
I'm looking for a data structure that stores an approximation of a DAG: If a node $x$ is reachable from a node $y$ in the DAG, then it is reachable in the approximation. For a given fairly small root set of nodes that have no incoming edges, it supports getting an over-approximation of nodes reachable from a root and ...
Let $A = \{ uu \text{ } | \text{ } u \in \{a,b\}^* \}$ be a language. Suppose that we want to prove that A is not regular via the pumping lemma, why is the string w = $a^{p} a^{p}$ not valid to derive a contradiction?
select k sets from a collection of sets such that each selected set has an empty intersection with the non selected ones
I'm new to Operating System, just learnt about process and now is about to learn about threads. From what I understand, a program is an executable file, program code a process is a program in execution a thread is part of a process in a process, there might be multiple threads. e.g. MS Word in a programming code, ther...
Strassen's algorithm uses the divide and conquer approach to divide the matrix multiplication of two nxn matrices to multiplication of 7 2x2 matrices to get an overall complexity O(n^c) where c=log_2(7). I also read a paper which proved that it was impossible to multiply two 2x2 matrices in less than 7 multiplication ...
For my research work, I need to generate dataset by using some standard statistical distribution. I have seen Unknown distribution for dataset generation. I do not have any idea about unknown distribution and how to generate data using this distribution. Could you please clarify what is unknown distribution? My problem...
I read that there is a $\Omega(n^3)$ lower bound for $(max,+)$ matrix multiplication (with $n\times n$ matrices). This is the matrix product defined as: $(A\cdot B)_{ij}:=\max^n_{k=1}\{A_{ik}+B_{kj}\}$, for some $n\times n$ matrices $A$ and $B$. This lower bound means that the trivial algorithm is the best one. Is ther...
according to the Smith-Waterman setup, I have 2 string sequences S and T, and I want to identify their respective subsequences $\alpha$ and $\beta$ whose global alignment have maximum score over all pairs of subsequences. As usual, the scoring system is a substitution matrix and a gap-scoring scheme. However, I want to...
I have two exercises: 1) A 128KB direct-mapped cache, with lines from 32bytes/lines and 36-bit address. 2) A 512KB 2-way associative cache, with lines from 64bytes/lines and 36-bit address. For both exercises i have to find the number of bits needed for the tag,index and offset fields. I tried to do both exercises and ...
I have started learning lambda calculus from the book by Hindley and Seldin. It brought up the concept with the function $x-y$, first as a function of $x$ and then as a function of $y$. In a way, it emphasized the difference between treating the expression as a function of $x$ and function of $y$, giving separate names...
Let $\Sigma$ be an alphabet of size $2$, and let's consider $n$ regular languages $L_i \subseteq \Sigma^*$ respectively recognized by $n$ minimal DFAs $D_i$ whose size are bounded by $m$. As the number $k$ of minimal DFAs of size at most $m$ is finite, there exists a function $f$ that returns this number $k=f(m)$. Let ...
My lecture states that search in a sorted array can be done in ω(n). Why is that? I know it can be done with "normal" search in Θ(n) and with binary search in O(log(n)). My guess would be, make the algorithm so bad that it is in ω(n) but that's a kinda silly guess I think. Thank you all in advance.
Does a process's page table too gets swapped out to secondary storage from main memory when the process gets swapped out to secondary storage from main memory? And gets swapped back in when the process is swapped in? I tried to find the answer in text books and online, but none is clear. Also, it would be helpful if yo...
The problem: Exact Cover by 3-Sets (X3C) The definition: Given a set X, with |X| = 3q (so, the size of X is a multiple of 3), and a collection C of 3-element subsets of X. Can we find a subset C’ of C where every element of X occurs in exactly one member of C’? (So, C’ is an “exact cover” of X). The class US (Unique ...
How would one represent the number -4 as an 8-bit normalised, 2's complement, floating point, with 4 bits dedicated to the exponent? As a normal 4-bit 2's complement number, it would be represented as 1100. How would this be normalised, with the start of the mantissa being 1.0? Would it be 1.000 0010, with the extra 1 ...
I have the following problem: Inputs: A finite collection $V$ of vertices A metric cost function $c:V^2\to\Bbb R$ (interpreted as the edge cost of a complete graph on $V$) An amount of resource $s:V\to\Bbb R$ on each vertex, satisfying $\sum_{u\in V}s(u)=0$ The problem is to determine a transfer function $f:V^2\to\B...
I've spend the last few days searching online for an example of a constructive proof of regular languages being closed under homomorphism, but I have not seen one. I am mostly unsure of how to show the construction of a DFA for a homomorphism in general. For example, if I were to create a mapping between an alphabet $A...
Several times, I saw $\lambda$-terms such as $\lambda x. \lambda x.x$, where $x$ is bound by the inner lambda, which I agree. why not just write it as $\lambda y. \lambda x.x$, so it is clear and you don't need to comment such as "where $x$ is bound by the inner lambda". what is the point of writing $\lambda x. \lam...
I'm reading the book The Annotated Turing by Charles Petzold. In it he mentions the Diophantine equations - which was a joy to read. This then lead to Hilbert's 10th problem - finding an algorithm of solving Diophantine in a fixed number of steps to whole numbers. Interestingly enough - Diophantine sets are Turing Mac...
let T be tree with 10 vertices. what is the sum of degree of all vertices in tree
Given collection of sets S1,...,Sn and a positive number k. Is the problem of selecting some of the sets such that their intersection is of size k NP-hard? So far, I tend to believe it is so I tried to find a reduction (unsuccessful so far), I have tried is to replace intersection by union (which is equivalent if we ta...
* Initial Question * I'm trying to write a logical formula consists of three Boolean variable C1, C2, C3. My program takes graph as input and checks properties about them. C1 represents presence of some structural properties of the input graph (graph being strongly connected). If graph have this property, variable C1 ...
I was studying about naive pattern search algorithm and found that it requires two loops to match the pattern present in a string or not. That time an Idea stuck in my mind and I think it would be a better approach because I used only one loop to find out the pattern in string. Here is Pseudocode MY-PAT-ALGO(T[n],P[m...
$A, B$ – enumerable sets, is $A \times B$ enumerable? I have some thoughts, that maybe it can be done using something like the proof of countability of $\mathbb{N} \times \mathbb{N}$, but I don't know how to prove this more proper.
The problem I'm trying to tackle is to show that for a Kolmogorov-random number of length $n$, the amount of $1$'s in its binary representation is greater than $n/4$. My only idea so far, is to use a Turing machine that takes indices of $1$'s as an argument and produces a binary sequence accordingly. Then, for instance...
I am trying to find out how many times the "statement" is executed by finding its formula based on these loops: int s = 0; for(int k = n; k > 0; k /= 2) { for(int l = k; l < n; l++) { s++; // statement } } I have been stuck with this problem for a while since I couldn't really get the correct formula wheneve...
I've been reading some papers on reinforcement learning. $$\Delta w=\frac{\partial ln\ p_w}{\partial w}r$$ I often see expressions, similar to the above one, where the weights (denoted by $w$) are updated following the partial derivative of the policy function (denoted by $p_w$) with respect to its weights. But why do...
I am learning Lambda Calculus from the book by Hindley and Seldin . They start the formal postulation of lambda calculus as follow : (a) all variables and atomic constants are λ-terms (called atoms); (b) if M and N are any λ-terms, then (MN) is a λ-term (called an application); (c) if M is any λ-term and x is any va...
Suppose there is a tutorial session at a university. We have a set of $k$ questions $Q = \{ q_1 \ldots q_k \}$ and a set of $n$ students $S = \{ s_1 \ldots s_n \}$. Each student has a doubt in a certain subset of questions, i.e. for each student $s_j$, let $Q_j \subseteq Q$ be the set of questions that a student has a ...
Assuming $L$ is defined as follows: $$ L = \{ 0^n1^{n^2} | n \ge 0 \} $$ I'm trying to either prove/disprove whether $L$ is CFL or not. My intuition tells me its not CFL since I cannot express the power $n^2$ by itself using CFL, but I'm having trouble proving so using the pumping lemma. Also, I failed to create any s...
In Philip Wadler's presentation, "Category Theory for the Working Hacker", something confused me. At about 30:52, he says: We need this additional construct which is called distributivity. Here it is, right? It just says "given a choice of an A or a C and a choice of a B or a C, we can get a choice of an A or a B and ...
Hello everyone this is my first question ever and I apologize if I ask in the wrong manner causing this post to be either closed or deleted. I'm learning Reductions and my professor has asked us to write a paper on reductions (3SAT) When doing the Reduction from the Clique Problem to 3SAT, I understand that we make cla...
I can't find a counterexample to $$f(n) = o(g(n)) \text{ implies } 2^{f(n)} = o(2^{g(n)})\,,$$ but I do not know a formal way of proving it. Can anyone lead me in the right direction? I asked this exact question yesterday in Stack Overflow by accident (meant to post here) but no one could come up with a valid way of a...
Consider the following problem statement: Given an initial number, you and your friend take turns to subtract a perfect square from it. The first one to get to zero wins. For example: Initial State: 37 Player1 subtracts 16. State: 21 Player2 subtracts 8. State: 13 Player1 subtracts 4. State: 9 Player2 subtracts 9. ...
is the Big-O for this O(1) or some asymptotic like 1/n? Saying that because if it defaults, the time limits at about 1000000 ns, but if it returns while in the loop, it is about a fraction of that. The time seems to increase very slightly as the inputs increase. public static int[] call(int b, int c) { int[] f = ne...
Construct a push-down automata to recognize the language $ A = \{u\#v \in \{0,1,\#\}^{*} | u = v^{\complement} \} $. Here, $v^{\complement}$ is the bit-complement of v. I don't see how to perform this with a LIFO stack. I would like some hints (not a solution) if possible. Thanks,
Construct a minimized Deterministic Finite Automaton that recognizes strings of 1's and 0's that are multiples of 3. This was one of the questions asked in my cycle test. What would be a correct interpretation to this question? Strings having a number of 0's and 1's that are multiple of 3, e.g.000111, 011010 Strings o...
Take a node-weighted, undirected graph $G$, and a node $r$ in $G$. Is there an efficient algorithm to find a tree in $G$ rooted at $r$ which has total weight at least $w$ and contains a minimal number of nodes?
Given a residue code representing a number N with the tuple (N, R(N))where R(N) equals N mod A. What is the error detection distance of a certain check base A? In other words, how many bits can be flipped but still detect an error? Edit: I would think the minimum distance is 2 for any base. Consider a base A > 2. If...
Many algorithms in computational geometry assume to have as input a complex data structure to represent a geometric object. The most common I know is the Doubly connected edge list, but there're also the halfdge data structure, winged edge etc... I was wondering if such data structure is also used to represent simple o...
There is a ring A and ring B made of Xs and Os. My aim is to convert A to B by using only the minimum number of # operations. When I do # on an element i of the ring, element i-1, i and i+1 will be toggled. (toggled => X->O and O->X).
I have read multiple times [Theorem 5.15, 1][End of page 2, 2] that local search heuristics for $\textsf{Weighted Max-Cut}$ with $\textsf{Flip}$ neighbourhood takes an exponential time in some cases. In particular, the problem is as follows. Given a partition $(V1,V2)$, its neighbours are partitions which can be obtain...
Ranked alphabet is very often used in Ranked Trees definition, like here for instance. In that example for given set $\Sigma=\{a,b,c\}$ ranks assigned by arity function $ar : \Sigma\rightarrow\mathcal{N}$ as: $ar(a)=2, ar(b)=2, ar(c)=1$. And Ranked Tree over $\Sigma$ is defined as: $T_{\Sigma_r}$, the set of ranked tre...
I'm creating a tic tac toe game, there will be two players: X and O. X will be a human, and O is an AI which will always choose the best move to play. My board is an 11x11 board and the winning condition is 5 in a row. How do I know if a board is at end state (where one player has won)? For the 3x3 board, you can do...
Alright, I am not entirely sure if this is the right place to ask this, but here goes: I have a map of coordinates of robots and obstacles. The first robot is awake from the start of the problem and it can wake up other robots on the map by walking next to them. Once a robot is woken up by another, it can also traverse...
Given a set of random variables $X = \{x_1, x_2, \dots, x_n\}$. If the conditional entropy for all $Y \subset X - \{X_i\}$ where $|Y| \leq 5$. How to approximate conditional entropy when $|Y| = 10$ based on the given knowledge? Is it possible to approximate better than $H(X_i | X - \{X_i\})$ ?
Given the context-free grammar \begin{align*} & S \rightarrow AA \\ & A \rightarrow xA \\ & A \rightarrow B \\ & B \rightarrow yB \\ & B \rightarrow \lambda \end{align*} What is the meaning of $\lambda$? $\lambda$ itself means the empty string and will match anything without consuming it, but in terms of the production...
I have an exercise and I don't understand the solution. Given memory data ranging from 1A0040h: 000102070405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F Given memory data ranging from 1A0090h: 202122272425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F Given memory data ranging from 7B0040h: 404142474445...
Given a set with n inserted elements and a desired false positive probability p, we can find the minimum number of bits in the bloom filter m by computing -n*ln(p)/(ln2)2 Suppose we have two sets of different sizes and we want to compute their intersection using the bitwise-AND operator on their bloom filters - this m...
This is one of the example lemma that has been proved in TAPL book which I'm unable to grasp. The objective is to prove |Consts(t)| <= size(t) where t is a term. Now, Consts is a function defined like this: Consts(true) = {true} Consts(false) = {false} ... and so on Similarly size(true) = 1 size(false) = 1 ... and so ...
I'm looking for an algorithm that will help me determine substring matches at scale. I have a pool of 100+ million "needles" (strings). I can do as much pre-processing on them as I want, and storage is cheap. On detection side, I have both a very large pool (hundreds of TB) of strings to search for needles in, and also...
I started with this sum of products: abc’d’ + abc’d + ab’cd’ + a’b’cd’ + a’bc’d + a’bcd + ab’c’d + a’b’c’d I have been able to simplify to this: b'c'd + abc' + a'bc + b'cd' I can't seem to find a way to simplify it anymore. I have tried reading and watching a ton of tutorials but nothing is clicking. Some things I ha...
I was given the following algorithms problem: Suppose you have $n$ cities. Each city $c_i$ has population $p_i$. You want to construct $m \geq n$ schools, where each school can only serve students of its city, and fulfill two objectives: Every city must have at least $1$ school. You want to allocate schools to citi...
Suppose there is a tutorial session at a university. We have a set of $k$ questions $Q = \{ q_1 \ldots q_k \}$ and a set of $n$ students $S = \{ s_1 \ldots s_n \}$. Each student has a doubt in a certain subset of questions, i.e. for each student $s_j$, let $Q_j \subseteq Q$ be the set of questions that a student has a ...
I would like a way to hide a piece of information from Alice and Bob. Let's say this piece of information lets Alice and Bob vote me off the island. If Alice had this information she could vote me off even if Bob did not want that. Likewise if Bob had this information he could vote me off the island even if Alice did n...
Player $A$ thinks of number between 1 and $n$ and ask $B$ to guess the number with minimum number of decision queries (yes or no type ). Game : $A$ chooses an element in {1,2....,n} $B$ tries to guess this number by asking Yes/No questions. Binary search is a way to solve the problem, so with $\log n$ many queries w...
An integer addition can be represented as following: $A + B = A \oplus B \oplus carry_{vector}$ My question is how to determine the carry vector from $A$ and $B$ (not from the result)?
If I have an algorithm that fills out an $|V| \times |V|$ table with for loops and an $O(1)$ sub-problem after running Dijkstra twice (outside the loop), I think I get the following runtime complexity statement: $$ O(\text{my algorithm}) = O(|V|\mathop{log}|V| + |E|\mathop{log}|V|) + O(|V|^2) $$ Assuming Dijkstra's is...
Algorithmic (aka Automatic) Differentiation is a wonderful technique for numerical computation of derivatives. I understand how it relates to the fact that we know how to deal with every elementary operation in a computer program, but I am not sure to get how this applies to every computer program. To quote from this w...
There are two problems I see with negotiating the next block chain: which transactions to include in the chain (because consider transaction T which has propagated through exactly 49% of the network at the time the next block is negotiated) which proposed block to consider the next legitimate block in the chain, becau...
I'm trying to understand how instance variables for a given object are stored for easy access later on. For some background, I understand that if you have a reference to an array it is very easy for a computer to access any particular item in the array with an efficiency of $O(1)$ by just multiplying the index provided...
In this paper -> https://www.cs.ucsb.edu/~mturk/Papers/jcn.pdf by Turk and Pentland, 1991, pg 76, formula (8) quote "... The simplest method for determining which face class provides the best description of an input face image is to find the face class k that minimizes the euclidean distance. (epsilon_k)^2 = || omega -...
Background and main question I am studying algorithm analysis and design, and have been going through "Algorithm Design and Applications" by Goodrich and Tamassia. One of the applications problems (A-11.2) poses the following: Given a set, P, of n teams in some sport, a round-robin tournament is a collection of games ...
Question: Let $A$ and $B$ be finite alphabets and let $\#$ be a symbol outside both $A$ and $B$. Let $f$ be a total function from $A^{*}$ to $B^{*}$. We say $f$ is computable if there exists a Turing machine $M$ which given an input $x \in A^{*}$, always halts with $f(x)$ on its tape. Let $L_{f}$ denote the language $\...
I have a matrix $C \in \mathbb{N}^{n \times n}$. Semantically, it is a confusion matrix where the element $c_{ij}$ denotes how often members of class $i$ are predicted by a given classifier as members of class $j$. The order of elements does not matter, but $c_{ii}$ has to be the correct predction of class $i$. So for ...
First post here, glad I found this exchange. I am in my Operating Systems course at university learning process scheduling. In my homework assignment we have to fill out a simulated scheduling chart along with the corresponding Gant chart. The arrival time of the first process is at time 0, and it's service time is 5 s...
I have a dataset of events with timestamps spanning several months. The event rate is "bursty", i.e. there are periods of much higher and lower rate than the average. I would like to randomly select a subset of these events having approximately uniform time distribution. What weight should be applied to the random sam...
I'd like to devise an algorithm which, given n non-intersecting line segments in the plane and a point p that does not lie on any of these segments, determines the region of the plane that is “visible” to p (see the image I've provided below). Ideally, this algorithm should run in O(n log n) time.
Suppose we are tasked with expressing a randomized list of all numbers up to but excluding $2^n$ (ie. a random list of all n-bit numbers). What are some efficient ways to do such a listing using as few bits as possible? Attempt: My thought is that the verbose listing of all $n$-bit numbers has a lot of redundancy, so ...
When running a data center, one of the cost metrics you might care about is "ram seconds". For example, an algorithm that holds 1 MB of memory for five minutes consumes 300 million ram seconds. A datacenter only has so many ram seconds in a day. The spacetime complexity of most algorithms, i.e. their cost in ram-second...
I've been playing around with converting regular languages to regular expressions and was wondering if my thinking is correct for this one. Question: The set of all strings that begin or end with a doubled digit, either 11 or 00. (In all cases assume the alphabet is {0,1}). So far, I have: $((11+00) + (1 + 0)^*) + ...
I've run into a problem concerning epsilon transitions and removing them. Specifically, it is to do with the picture seen in this post. My problem is that I am unsure of what to do with q1. I've already attempted to solve it but I don't know if it's correct. Should it just sit there still with no inputs going to it ess...
How would I go about predicting the next word in a sentence if I have a n-gram model available? A intuitive solution would be to just ask the probability of all the words that can come next and see which has the highest. But this would be dreadfully slow if I have a very large set of n-grams wouldn't it? If anyone coul...
Suppose a leauge of tic-tac-toe playing agents. As the league proceeds, the bad players are kicked out, and better players come in. The problem resides on how to at least approximate the better player. One way to think of is an evolutionary approach. By random mutation possibly followed by crossovers, you may expect th...
For error detection purpose I am looking for separate arithmetic codes which are closed under integer addition. By separate, I mean the code word $C$ for message $x$ is a tuple $(x,f(x))$ where $f(x)$ is the redundancy part. In contrast to that, a non-separate code word $C$ would be $f_2(x)$ where $f_2$ encodes the wor...
Motivated by Hardness proof of EVEN-ODD PARTITION post I came up with a string version. String even-odd partition INPUT: $(x_{1,0},x_{1,1}),\dots,(x_{n,0},x_{n,1})$, i.e., $n$ pairs of strings over $\{0,1\}^*$ QUESTION: Does there exist $(b_1,\dots,b_n) \in \{0,1\}^n$ such that $x_{1,b_1} \cdots x_{n,b_n} = x_{1,1-b_...
Control Unit has MAR and MBR registers. so MAR emits instruction to address bus so that the specific cell in the memory is activated. MAR also emits READ or WRITE command to control bus. MBR emit data for WRITE actions to data bus. Question is how does the control bus communicate between MAR and MBR to know whether it ...
Is there any specific architecture to pipelining that we must follow to perform "operand-forwarding" inorder to avoid its harzards? My tutor seem to have, there are different architecture. And he taught us 3 different, and i am not even sure how to know which one to use.
2QBF is the following problem: given a CNF formula $\psi$ on $2n$ variables, determine the truth value of $$\forall x \in \{0,1\}^n . \exists y \in \{0,1\}^n . \psi(x,y).$$ Question: Is 2QBF in $P^{NP}$ (or, expected to be in $P^{NP}$, under standard conjectures)? Motivation: If the answer were yes, it would suggest a ...
I want to find all possible train routes from the user's chosen city A to city Z, given that for any combination of cities there is defined one or more combinations of one or more graphs that can be traversed. The graphs are defined in KML files, and the valid combinations are also pre-defined. The number of valid comb...
I've recently been working on a problem that I believe can be expressed as a vertex cover problem over a directed graph. Formally, I have a graph $G = (V,E)$ where $V$ is a vertex set and $E$ is a set of edges between vertices. The edges are directed so we can have $e_{ij} = 1$ but $e_{ji} = 0$ where $i,j \in V$. Here...
I asked this question on DB.SE but it didn't get any traction, so I'll ask it here... The following statement is in the Ramakrishnan text (2nd ed. page 252): (emphasis in bold is mine) The non-leaf pages direct a search to the correct leaf page. The number of disk I/Os is equal to the number of levels of the tree an...
I have a hypothetical question: suppose there exists an algorithm that solves an NP-Complete problem polynomial time, but requires the computation of values that grow exponentially big (or small). For example, suppose POLY-3SAT solves 3-SAT in N^17, however to do so it must compute/evaluate the value of a number C wh...
Suppose I have an algorithm that runs in $O(n)$ for every input of size $n$, but only after a pre-computation step of $O(n^2)$ for that given size $n.$ Is the algorithm considered $O(n)$ still, with $O(n^2)$ amortized? Or does big O only consider one "run" of the algorithm at size $n$, and so the pre-computation step i...
Randal Bryant developed an exponential size lower bound for any BDD encoding the middle bit output of the multiplication function, regardless of variable permutation. But at the same time the multiplication function is decidable in logarithmic space. Of course related to P versus NP, the lower bounds complexity of its ...
Suppose that we are given a pattern $p$, which is a set of characters (order doesn't matter). We are also given a set of strings $A$. I want to find all of the strings in $A$ whose characters are all contained in $p$ (without taking the order of these characters into consideration), i.e., to find all $s \in A$ such th...
Parsing expression grammars (PEGs) are unambiguous and have a superficially similar syntax to BNF, but include three important differences: The ordered choice operator e1 / e2 / e3. The and predicate &. The not operator !. I have a few questions: Are the languages recognized by PEGs all context-free? If the answer ...
I recently discovered the idea of a total transition function in Automata Theory. To my understanding this means that every state has at least one outgoing state. My question is whether this restriction applies to accepting states, since my initial intuition tells me that this would be an overly strict enforcement of t...
float myTotalAmount=0; void update(float amt){ myTotalAmount+= amt; } Task A called update(10); Calculated myTotalAmount+= amt; Didn't store the value for myTotalAmount; -------X Task B called update(5); Can we say X didn't happen due to context switch? or is Task B able to call update method because context switc...
I have a hole in my understanding of what makes a problem NP. I understand that Mario, for example, is NP-hard - it can be reduced to the NP-complete problem of 3SAT (see https://www.youtube.com/watch?v=mr1FMrwi6Ew) Therefore if these games were also in NP, they would be NP-complete (by definition). My understanding is...
The Wikipedia article on the pumping lemma states: We now pump $y$ up: $xy^2z$ has more instances of the letter $a$ than the letter $b$, since we have added some instances of $a$ without adding instances of $b$. Therefore, $xy^2z$ is not in $L$. We have reached a contradiction. Therefore, the assumption that $L$ is re...
So I am trying to work on a problem and honestly... I am so lost with this one. I will try to ask it the best I can. Exact text of the problem: "Prove the following directly from the definition of Big Theta; 100,000,000 is a member of the set of functions defined by Big Theta of g(n), where g(n) = 1" Additionally, the ...
I have an assignment in which the problem, $D$, is simple but, once found, easy to check. Is it enough to prove that a solution $x$ can be checked in polynomial time to prove that $D \in NP$? (The problem $D$ is a decision problem) Edit: Changed $P$ to $D$
Suppose the alphabet is {a,b}. I have tried coming up with NFA1: third symbol is a, and NFA2: third from last symbol is a. Then NFA3 and NFA4 similar but with symbol of b. Then I use intersection of NFA1, NFA2, and intersection of NFA3, NFA4, and add $\epsilon$ transition. But things seem to go wrong here. When doing t...
Can someone explain to me in a plain English what call by Reference mean ? I am having trouble to recognize a difference between "call by value" and "call by reference" Thank you.
Proving the language $L=\{ a^i b a^j |\ i<j,\text{ or }i>j;\ i,j>0 \} $ is not regular, I am trying to use the pumping lemma for regular languages: pumping length $:= m$ case 1: $i<j; j=m$ $w_1 = a^i b a^m = xyz$ $|xy| < m$ $|y| > 0$ $\Rightarrow$ $y$ can be: $a$s only $a$s + $b$ just $b$ However, this leads to...
I am with the phone so I would be more verbose when I will have a pc on hand, if you desire. The first fit algorithm for approximating the bin packing problem (NP-hard) is a $2$-approximation for the optimum. Can you show me a concrete worst case showing that $2$ is a good (or bad) extimate for the bound?
I'm not sure if this is the right place, but I have an idea for a database kind of like a wiki, that would NOT have editors, and would have the following requirements: Any user can start with using their real name or a pseudonym Anyone can later switch to using their real name (no reversals to a pseudonym or changing ...
In the book "Constraint Handling Rules", Thom Frühwirth explains (on p. 50) "Substitutions, variants and equality" over a usual first-order logic language composed of variables, function symbols and predicate symbols. It's the usual foundation in preparation for introducing unification. However, one then meets the fol...