instruction
stringlengths
35
29.1k
I was thinking about whether $\{ 0^{a}10^{a}10^{a}|a\in\mathbb{N} \}$ is a context-free language, and I found this post. I am not sure if my understanding is correct or not, but I guess $R = \{ (a,1,a,1,a)|a\in\mathbb{N} \}$ is not a stratified set, so this language is not context-free? Before looking this up, I have b...
If I have an undirected graph with more than one connected component, can I apply the Gomory-Hu algorithm directly on the entire graph or do I have to apply it separately to each component?
I have this language that I have to prove either regular or irregular. $$ L_3 = \{mm^rn | m^r \text{ is the reverse of } m,\ m,n \in \{a,b\}^+\} $$ It's trivial to prove that it is in fact irregular using Myhill-Nerode theorem. We let $$S = \{ab,abab,ababab,\ldots\}$$, and the suffix for two strings $s_1$ and $s_2$, $\...
I was reading a book titled "Essentials of Logic Programming.", most parts of the book are easy to understand. but now having a problem with Theme 45: incremental constructions of the minimal model. The relevant parts are shown below. Some notations: $P$ is a definite program, $B(P)$ is the Herbrand base of $P$, $G(P)$...
From what I understand about the Y2K38 problem, unpatched 32 bit systems with signed UTC times will jump back from 19 January 2038 at 03:14:07 UTC to 13 December 1901, at 20:45:52. Calculating the difference between these date-times gives me 4294197095 seconds. That's not the same as 4294967296 seconds, off by 770201 s...
I am presented with the following code segment and asked to find the growth rate, which can be done by finding the number of times the variable sum is incremented: sum = 0 for i = 1 to 2 * n for j = 1 to i * i for k = 1 to j sum++ I tried making this into a function called run(n) in Python that returns sum an...
Prove P ∨ Q, Q ∨ R, P → ¬R |- Q with natural deduction. P ∨ Q, premiss Q ∨ R, premiss P → ¬R, premiss ... ... Conclusion, Q I dont know how to properly solve this question? I know somewhat how to solve similar questions like below, but on this specific question above I dont know where to start.
I have some problems understanding the following 2 question from an exam last year, which I am preparing for this week in Parallel Programming. Determine the Work -> $W(n) = 7$ (#vertices) Determine the Depth -> $D(n) = 4$ (longest path) Determine average parallelism -> $\frac{W(n)}{D(n)} = 7/4$ Ok, now the 2 question...
I have a function $f(x)$, has been sampled into a sequence $$ y_0, y_1, ..., y_{n - 1} $$ at points $x_k = k \Delta x$. $f(x)$ is neither smooth or monotone. Under this assumption, what is the fastest way of finding $$ \min_{k=0}^{n - 1}|P - (x_k, y_k)| $$ where $P$ is an arbitrary point? I could do a linear search, bu...
Say there is someone claiming to have solved P vs NP, by finding a (computationally feasible, i.e. no huge constants) polynomial solution to a problem in NP: Apart from a formal proof, is there any kind of challenge comparable to the RSA Numbers, which could be used to "prove" (or at least give strong evidence) that yo...
I am searching for a program to convert 3sat to clique problem. I tried following links https://www.geeksforgeeks.org/maximal-clique-problem-recursive-solution/ https://www.geeksforgeeks.org/find-all-cliques-of-size-k-in-an-undirected-graph/ But it is not converting 3sat problem. Is there any algorithm to convert 3sat ...
I have been reading Cormen's chapter 11 and I stumbled upon the following statement on page 260 (3rd Edition): Let xi denote the ith element inserted into the table, for i = 1, 2 ... n, and let ki = xi.key. For keys ki and kj , we define the indicator random variable Xij = I {h(ki) = h(kj)}. Under the assumption of si...
I wonder why can't I allow an exponential-time reduction from all problems in $\textbf{NEXP}$ to a language $L$ and claim $L$ to be $\text{NEXP-complete}$. The computational complexity class $\text{NEXPTIME}$ or $\text{NEXP}$ has been defined here. In the same page, there is a section on $\text{NEXP-complete}$. This s...
In finding a minimum spanning tree, if we use a BFS and at any node instead of deleting the edge to a repeated node, we can find the most expensive node in that cycle instead and delete it. In such a case, will the time complexity remain O(E+V)?
Ask for the name of the employee. If the employee is full time, get his monthly salary rate. Then, display his name and salary. If the employee is part time, get his rate per hour and the total number of hours he worked for the entire month. Then, display his name and wage. Hello guys, I am freshman in college and I'...
Can I say that all languages in the class $\textbf{P}$ are just a padded version of some other problem in $\textbf{EXP}$? I am familiar with the padding argument, which states that if $\textbf{P} = \textbf{NP}$, then $\textbf{EXP} = \textbf{NEXP}$. I describe the languages obtained by padding an exponential-time proble...
Which function grows faster: $$f(n) = 4^{n^2 \log_2 n} \text{ or } g(n) = (n!)^n$$ Which is true? $f(n) = O(g(n))$ $g(n) = O(f(n))$ i.e., $f(n) = \Theta(g(n))$ none of the above? For lower values of $n$, it looks like $f(n)$ is bigger, but I'm not sure for very big values of $n$.
The following a small-scale example meant to illustrate the general problem Suppose we have $n = 60$ marbles that we want to distribute into 3 bowls, $B = \{bowl_1, bowl_2, bowl_3\}$ The marbles can take the distinct colors $C = \{red, yellow, blue, green\}$ where we have: $n_{red} = 15$, $n_{yellow} = 10$, $n_{blue} =...
At our school, we have a schedule that looks like the following (simplified): Remarks: One course can be taught multiple times a week (to different class-groups, like 1A, 1B and 2A) Multiple lessons (even from the same course) can be scheduled on the same time (but of course for different class-groups). Some of our ...
We were given this practice question to do in a lecture and its solution afterwards. I have spent hours upon hours trying to understand the solution but still do not understand. From my knowledge when we are reducing SAT to clique we don't focus on its compliment, so why are we trying to derive the formula from the com...
I came up with this algorithm for finding all prime numbers from 1 to n. This algorithm could already exist, if it does I don't know what it is called. primes = [] n = int(input("Enter number : ")) for j in range(2,n+1): flag = True for i in primes: if i*i>j: break if j%i == 0: ...
Given a network with flow on the nodes. How can we find min s-t cut in a network with flow on the nodes? We know how to find min s-t cut whenever there’s a network with flow on the edges (Ford Fulkerson, Edmonds Karp)
It is mentioned in 22 - 23 Number of Channels which will be 1 if mono, 2 if stereo. So why 22 and 23 (that is 2 bytes) allocated here? With 1 byte, we can put either 1 or 2.
I'm reading Michael Sipser's "Introduction to the Theory of Computation", and it says: THEOREM 1.26 The class of regular languages is closed under the concatenation operation In the video, if we scroll to the last section, he said that we cannot prove this by "concatenating" m1 and m2 together and pointing all accept...
I'm trying to understand de construction of a DFA from the book "Introduction to Automata Theory, Languages, and Computation by John Hopcroft and Jeffrey Ullman 1st ed" It says: Where it says "If the remainder of i/3 is p, then the remainder of 2i/3 is 2p mod 3." its dividing it twice to get the remainder. Shouldn't i...
Given the following theorem and definitions from Introduction to Algorithms 3rd edition by CLRS: Theorem 22.5: (Correctness of breadth-first search) Let $G = (V, E)$ be a directed or undirected graph, and suppose that $BFS$ is run on $G$ from a given source vertex $s \in V$. Then, during its execution, $BFS$ discovers ...
As per the author, ...In this case, we generally need to use a garbage collection scheme to determine when the last reference has been deleted and the disk space can be reallocated. Garbage collection involves traversing the entire file system, marking everything that can be accessed. Then, a second pass collects eve...
So a process have scheduler context and trapframe and both of them are allocated in the kernel stack (kstack). When process wants to transition from user mode to kernel mode, usually due to traps (software interrupts), and while interrupt routines execute, it saves the context of main process in trapframe. But during a...
I think call by value may be pure function or impure function... And pure function can be written through call by value or call by reference.... So according to the facts (c) should be correct ans...
Typically (from what I can tell) reduction operations produce a "number". This makes them easy to deal with since there isn't really any memory overhead. However, I have something that I'm working on where I want to combine instances of a nontrivial data structure. That is, if x and y are instances of some class C, I h...
I'm trying to order some data in real-time (in an API call) where my item count is on the order of a few million. I'm using Go, so my pseudo code may resemble that. My input items look like this: type Item struct { // SetID is the set this item belongs to. This may be in the // 100,000s in unique sets. SetID int ...
Let's say N students S1, S2, ... SN with their respective candies count c1, c2,... cN The ask is to distribute the candies (whole number only) as evenly as possible among the students, with last student can get the extra candy. Hence, average cookie (c1 + c2 + ... + cn)/N E.g student -> number of cookies S1 -> 3 S2 -...
Despite a huge amount of literature regarding table representation and indexing in secondary memory (also including database books), I found no information on how relational databases represent records generated from intermediate results in secondary memory. How are they representing this, thus considering that you mig...
(Context) Given two byte arrays of length 16, say $L$ and $H$, one can define a mapping $M$ from the set of all bytes to itself in the following way. If $0 \le b \lt 256$ is a byte, let $\text{lo}(b)$ denote the lower 4 bits of $b$ and let $\text{hi}(b)$ denote the higher 4 bits of $b$. Let $L_i$ (resp. $H_i$) denote t...
Consider signed integers with common addition and multiplication. Reassociation of expression is another equivalent form. Say expressions: a * b + a * c + c * b a * (b + c) + c * b a * b + c * (a + b) Are all reassociations of each other. Lets call optimal reassociation one with minimal multiplications. It can be hard...
Systems impose semantics to clarify functionality. For example, a system may disallow a mount over a directory that contains files; or it may make the mounted file system available at tha directory and obscure the directory's existing files until the file system is unmounted, terminating the use of the file system and...
I'm trying to convert a x86 assembly language program to binary. I have read a 1979 Intel 8086 manual and so understand the basic architecture, however I am still unsure as to how to convert this. Here's the code: MOV BX, 1300H ; Load the Base Address 1st input Matrix in BX MOV BP, 1400H ...
This problem comes from a competitive programming problem. I'll restate it(feel free to see it here): A balanced bracket sequence is a bracket sequence(including open and close only) of even length such that we can add 1 and + to make it a valid mathematical expression. Given a balanced bracket sequence (BBS), we then...
I know matrix multiplication of matrices with real numbers is bounded by $ \Omega (n^2 log(n))$, but what about if all numbers are natural? Can we use the same methods to get a lower bound for this case and how should I do this? Also, what is the current known bound for this case?
On page 11 in the book Foundation of Machine Learning, 2nd edition MIT press, the authors wrote: Definition 2.3 (PAC-learning) A concept class $C$ is said to be PAC-learnable if there exists an algorithm $A$ and a polynomial function $poly(·,·,·,·)$ such that for any $ε > 0$ and $δ > 0$, for all distributions $D$ on $...
Given are the coordinates of a convex polygonal area ("field"), a moving circle of radius r ("crayon") and a home location for the crayon ("home") well outside the field. Main goal: Get the shortest total end-to-end path of the crayon so the crayon fills most of the area of the field, without painting at all outside it...
For Instance, if I allowed the user to pass in expressions like "35 + 2 * 5" as strings, how would I go about writing such a program? Also, what topics does this question fall under?
For a bit of context, I was going through the previous year questions of my college computer networks course and found this in one of the papers. I don't even know how to go about solving this problem, it would be really helpful if someone could help me with this. The question goes as follows: Justify the validity of f...
Problem: Imagine you are an agent with a knapsack, who travels a known route of cities. All cities are different: $C_1 \rightarrow C_2 \rightarrow \dots \rightarrow C_n$. Each city offers you to buy fixed commodity or to sell it (but only to buy or to sell, never both). Prices are known and available; available volume ...
An induced subgraph $G’$ of a graph $G$ is a subset of its vertices along with all the edges that are present in $G$ among those vertices. For $G’$ to be a tree, all vertices of a cycle in $G$ cannot be in $G’$. The tree composed of bold edges in the illustration given below shows an induced tree $T$. Vertex $u$ cannot...
The pumping lemma is allowed to be used in this assignment, so I have tried to make $|0^{m+b|y|-|y|}| = |xy^b| = a!, a\ge |y|,a\ge n$ so that $gcd(|0^{m+b|y|-|y|}|,n) \neq 1$.
I am trying to solve a problem where I am given a directed graph with $n$ nodes where, from any given node, I can reach one and exactly one node. Nodes contain integers from $1$ to $n$. Starting at node $1$, the problem consists in writing an algorithm which determines on which node we end up after moving along $k$ edg...
I have two questions about the validity of lambda expressions. First, is a variable on it's own a valid lambda expression (ex: λx) Second, take for example these two lambda expressions (λx.fxya and λz.fxya). They're identical besides the fact that the bounded variable is different. Does this affect it's validity? Also...
I need to prove that the binary operator $-_\pm: \mathbb{P}^\pm\times\mathbb{P}^\pm\rightarrow\mathbb{P}^\pm$ is increasing in each of its arguments, where $$ \mathbb{P}^\pm = \{\top_\pm, \leq0,\neq0, \geq0,<0,=0,>0,\bot_\pm\} $$ are the abstract properties it operates on. They represent the "signs" of values in $\ma...
This semester we have a class related to Operating Systems.The class itself is not obligatory but the class is done at the same time with a core class and I will simply not waste a year for 1 class so I have decided to access the resources of the Operating Systems class and study on my own. A process is any program lo...
I am trying to construct an AFA from a NFA, how do I know if a state of NFA becoms existential or universal in the AFA?
Consider the language L given by the regular expression (a + b )*b(a + b) over the alphabet {a, b} . The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting L is : My attempt : I designed the following DFA The answer key says that minimal DFA will have 4 states. I am unable to fi...
I'm trying to figure out an algorithm for this specific problem. The problem: I have N people (say 60 but could be far more) that I want to organize into groups of 4 on a monthly cadence. The constraints: Each month, groups should contain people that haven't been grouped before (until they've been in a group with ever...
How to calculate the time complexity of a algorithm which contains while loops or if statements using summations? I only know how they work with the for loops. And I'm guessing the if loop are calculated as a time complexity of (1)? r=1 for i=6 to n+2 do { j=n−3 while j≥log7(n−1) do { j=j−2 ...
I have a set of points $P = \{p_1, \dots, p_m \}, \; 0 \le m \le 10^4$ on a plane of two colors (red and green). Each point has integer x-coordinate (all x-coordinates are different), and non-negative y-coordinate (y-coordinate can be non-integer). In addition, each point has a weight $w \in \mathbb{R}^+$. I can match ...
What is the subproblem associated with this DP and what are the terms to calculate?
Your task is to count the number of ways numbers $1,2,…,n$ can be divided into two sets of equal sum. For example, if n=$7$, there are four solutions: ${1,3,4,6}$ and ${2,5,7}$, ${1,2,5,6}$ and ${3,4,7}$, ${1,2,4,7}$ and ${3,5,6}$, ${1,6,7}$ and ${2,3,4,5}$ Input The only input line contains an integer n. Output Print...
I am wondering why are read/write operations on I/O devices much faster when we use DMA?I must be that when using DMA we have 1 less clock cycle to access the local buffer of a IO device since it is already part of the main memory.Am I correct?
Let $f(n) = n \cdot \sqrt n$ and $g(n)= \frac{n^2}{\log n}$. Why is $f(n) = o(g(n))$? Could you please explain to me why this is so? I have tried l'Hôpital's rule but it doesn't add any clarification.
I understand that in Dynamic Programming approach the subproblems are solved in a particular order from smallest to largest. In LCS how the subproblems sizes are defined and in which order it is solved.
In Machine Learning: The Basics, Alexander Jung, Spinger, the author states that using the zero-one loss function defined by:$$\mathit{L}((\mathbf{x}, y), h)= \begin{cases} 1, y \ne \hat{y}\\ 0\ otherwise, \end{cases}\\ (with\ \hat{y}=1\ for\ h(\mathbf{x}) \ge 0, and\ \hat{y} = −1 \ for \ h(\mathbf{x})\lt0). $$ results...
If each edge has a distinct weight then there will be only one, unique minimum spanning tree. This is true in many realistic situations, such as the telecommunications company example above, where it's unlikely any two paths have exactly the same cost. This generalizes to spanning forests as well. Proof: Assume the co...
I've been stuck for hours trying to solve the recurrence $T(n) = 7T(n/3) + n^2 + 2n$ by using case 3 of the master theorem. I've done a good chunk of the proof, but currently stuck attempting to solve the regularity property $af(n/b) \leq cf(n)$. I don't think this fits the case 3 requirements, but my best shot has bee...
Question: Let G(V, E) be an undirected connected finite graph with the weight function w : E → R+. Let T be a minimum spanning tree of G. Prove that there exists a run of Kruskal’s algorithm that finds T (for suitable ordering of edges). Answer: We show that the following proposition P is true by induction: If F is the...
Could you please explain me why that's the case?
I am trying to understand the "Structure Theorem" in Arora's TSP slides. In particular, I do not understand the image on slide 13-3 (page 68 of the PDF). The high level idea is to show that (without randomization/derandomization) there is a chance that you will get a "bad" approximation of the Euclidean TSP using the p...
What is the efficient algorithm to find a submatrix (must be rectangle) with a sum that is as close as possible to k? Matrix consists only of nonnegative integers. Iterating through all possible submatricies requires O(n^4). Computing the sum can be done in O(1) time using prefix sums. I've thought about a similar prob...
I had posted earlier a question regarding ranking max "n" consecutive "0"s and "1"s in a "K"-bit string - Order in a subset I got clarification regarding how it can be solved by using DFA (Deterministic Finite Automation) - https://cstheory.stackexchange.com/q/8200/5038 https://cs.stackexchange.com/a/71379/755. Howe...
One of the services of a OS is communication between processes.However how much important is that?I dont think it is that important just for example if we saved a .txt file the file explorer wouldnt give back the name of the file to the text processor .Am I missing something here?
I was reading Type Theory and Formal Proof by Nederpelt and Geuvers and in Chapter 3 about $\lambda2$ at page 81 they show how the self-applicator $\lambda x . xx$ can be typed by observing that $\lambda x : (\Pi \alpha : * . \alpha \rightarrow \alpha) . x(\sigma \rightarrow \sigma)(x\sigma)$ typechecks correctly. They...
I am wondering is usually the OS kernel which provides a link between 2 processes part of the main() of the os or is it a seperate function?In other words do we usually encapsulate the OS kernel in the main or we use a seperate function?
According to this article, we have the following: The device controller gets data from a connected system device and temporarily saves such data in a special purpose register inside the controller known as a local buffer. So according to the above statement, the local buffer is a part of the special purpose registers...
It will help to know how to figure out the size of header of a WAV file by looking at its byte structure. Source: http://soundfile.sapp.org/doc/WaveFormat/ UPDATE: On second look, it says SubChunkSize = 16. But not sure how 10 00 00 00 leads to 16. Now given 16 and 2 channels, it is 32. 32 + 12 bytes of earlier block ...
Did I correctly rank these functions by order of growth? I ranked them from smallest to largest (left to right). I have to eventually prove this ranking, so just looking to make sure that I have the right understanding. $n^{\sqrt{\frac{2}{\log_2 n}}}, \quad 10^{\log_2 (\log_2 n)}, \quad 2^{\sqrt{2 \log_2 (n)}}, \quad \...
In the paper titled Quake Heaps:A Simple Alternative to Fibonacci Heaps, by Timothy Chan He mentions that: The tournament trees require a linear number of extra nodes, but more space- efficient representations are possible where each element is stored in only one node. One option is to transform each tournament tree T...
I am facing the following problem in a script I am trying to develop: Given a string and a set of tokens, where the tokens are known and are overlapping (the set can contain the tokens 'a', 'b' and 'ab'), I need to split the string into a list of tokens from the set. I know there can be multiple ones, I don't need all ...
I've begun reading the paper "Random Walks in a Convex Body and an Improved Volume Algorithm" by Lovász-Simonovits ('93). Although the paper for the most part is pretty self-contained and easy to read, the proof of the Localization lemma seems to be rather obtuse to me. Importantly there are certain statements that I'm...
Well-known example of divergent expression in lambda calculus is big-Omega combinator, defined as (λf. f f)(λf. f f). Although big-Omega is divergent expression, it's size became stable and always equal (λf. f f)(λf. f f) . Big-Omega combinator can be extended to provide more growth speed, for instance, expression (λf....
Does anyone have any examples of NP-hard graph problems which stay NP-hard on cycles, or is this class somehow not able to have NP-hard problems? I found a similar post concerning trees here which answers affirmatively, but by using the fact that any $n$-size input can be encoded as a tree of order $n$. Cycles only hav...
I have been studying the structure of a hardwired control unit and at 8:57 of this video we get a basic block diagram.What does the sequence counter do exactly?
Given the following theorem and definitions from Introduction to Algorithms 3rd edition by CLRS: Theorem 22.5: (Correctness of breadth-first search) Let $G = (V, E)$ be a directed or undirected graph, and suppose that $BFS$ is run on $G$ from a given source vertex $s \in V$. Then, during its execution, $BFS$ discovers ...
The C standard carves out room for implementations which have padding bits in their integer types. Padding bits affect the size of an integer but not the number of possible values they can contain. I understand the purpose of padding bits/bytes in structs to ensure that they are properly aligned but including padding b...
You have 27 coins, 1 of which is a different weight. Using a balance scale with 2 pans, how can you determine which coin is different in only 4 weighings? Generalize this to N coins. Hint My solution was to number the coins in trinary and weigh them as follows: Solution Coins whose 1st trit is 0 on the left; co...
I am creating a timetabling software for a school, which given parameters for teachers/class sizes will output a timetable. There will be a list of classrooms per subject and a list of teachers per subject and I'll divide the students between the teachers. The main focus is creating timetables for teachers, as opposed ...
I am currently trying to figure out whether a flavor of the bin packing problem, which I call the "flexible bin packing problem" (F-BPP), is NP-complete. Here are the definitions for the traditional bin packing problem (BPP) and the flexible bin packing problem (F-BPP): Bin packing problem (BPP): Optimization problem: ...
I want to formally show that a computational system $\mathcal M$ is computationally universal by showing it is computationally equivalent to some already known universal system, i.e. some UTM. To show that system $\mathcal M$ is computationally equivalent I need to prove something along the lines of this following defi...
I was watching a talk by Anand Natarajan on $\text{NEEXP} \subseteq \text{MIP*}$, and he uses $\text{3-coloring}$ as an example problem for $\text{NEXP} = \text{MIP}$ (timestamp 3:50). He mentioned that a two-prover interactive system could solve an exponential-sized graph's $\text{3-coloring}$ problem. I have two ques...
So I am trying to create a Q-learning algorithm to solve simple games, starting with tic-tac-toe. I would like to do so without completely eating away my memory, but all the examples online create a 2 dimensionnal array of dimensions [number_states, number_actions]. But just for tic-tac-toe we have 3^9 possible states ...
The dominating set problem asks us to find a set of nodes $S$ such that for a graph $(V, E), \forall v \in V$, $v$ has a neighbor in $S$ or is in $S$ itself. I'm looking for an algorithm which finds $S$ such that any $v$ has at least two neighbors in $S$ instead. It doesn't have to be optimal, as I'm using this algorit...
I am an engineer learning about the complexity class DP, and I am looking at a number of sources that mention that UNIQUE-SAT and CRITICAL-SAT are both in DP. Is there a proof of this fact somewhere that I can learn from?
I am looking at finding acceptable binary values with maximum 2 consecutive 1s and 0s, from a range of maximum 6 bits (2^6 values). Also, I want to rank and unrank these subset of values (in polynomial time). I have formed this regular expression - R = (ϵ + 1 + 11)((0 + 00)(1 + 11))*(ϵ + 0 + 00) I want to rank the all...
I'm trying to create (or find) an algorithm to iterate over a range (e.g.: 1-100, etc) but randomly, without any duplicate values (similar result to random sort, etc) but without actually storing the full range in memory (such as using list(range(1, 100)) in Python, etc). Problem is, I'm not sure how to tackle this. As...
In Operating Systems, What is the difference between Application Programs and System Programs? Also, what are examples of each?
I've been stuck with this problem for a day or so, and I really can't figure it out. I need to modify this pseudocode so that it works when b is not just a vector, but a matrix with same number of rows as A. I understand the idea to basically apply the row operations to the matrix b just as if it were a vector, and the...
For example, the following CFG: S$\rightarrow$aSb|$\epsilon$ A valid string within the language described by the CFG would be, e.g., "aabb". The converted PDA has the following form: The loop transitions on $q_2$ are: $\epsilon,S{\rightarrow}aSb$ $\epsilon,S{\rightarrow}\epsilon$ $a,a{\rightarrow}\epsilon$ $b,b{\righ...
I have a transaction grouping problem that I'm having trouble to devise the algorithm to solve it. Not even ChatGPT (version 3.5) can solve this correctly. Suppose I have five transactions: Transaction ID AA value 10 Transaction ID BB value 20 Transaction ID CC value 15 Transaction ID DD value 17 Transaction ID EE val...
If I have a deterministic finite automaton (DFA) with a language $W$, and I need to create another DFA that returns all the strings that are a concatenation of an even number of strings in $W$, how would I solve this? I was considering an approach where I alternate between accepted even multiples of the DFA and unaccep...
I am looking for a method in python/matlab to calculate the corner points of polytope which is an intersection of a polytope with half spaces. I have a polytope P1 of the form -1<= x0 <= 1 -1<= x1 <= 1 -1<= x2 <= 1 -1<= x3 <= 1 And half spaces defined by the equations as in the following format. -0.1 * x0 + 1.0 * x1...
To my knowledge, The number of CPU registers can tell us the maximum RAM we can have. I am only talking about physical memory, no virtual memory or virtualization in my question. A 32-bit CPU architecture with 32 registers, each one bit, can give us 2^32 = 4GB RAM (a bit, which is either true or false, times how many r...
Suppose a machine $T$, and oracles $A$ and $B$ solve all problems in the complexity classes $\mathcal C_T$, $\mathcal C_A$ and $\mathcal C_B$ respectively. Let $T^{\{A,B\}}$ denote a machine that is equivalent to a machine $T$ that has access to oracles $A$ and $B$. What would be the complexity class of all problems so...