instruction
stringlengths
35
29.1k
Let $G$ be the CF grammar that has the production rules: $S \to aS | aSbS | c$. Show that $G$ is ambiguous. I thought of proving it by representing the string $aacbc$ but I don't know if it is correct as a solution: $aS \to aaSbS \to aacbS \to aacbc$ $aSbS \to aaSbS \to aacbS \to aacbc$
Most optimization textbooks do not cover the concept of NP-hardness. Some examples include: "Convex optimization" by Boyd and Vandenberghe "Numerical Optimization" by Nocedal and Wright "An Introduction to Optimization" by Chong and Zak and half a dozen more well-known optimization textbooks. Yet, in discussion on...
Given $n$ points in a 2d metric space, the $k$-center problem asks us to find a subset of size $k$ of the points which we will call centers. The task is to pick these centers to minimize the maximum distance from any point to its closest center. A classic greedy algorithm repeatedly picks points which are furthest fr...
Question Prove that the number of comparisons between elements in binary heap build is at most $2n-2$. $n$ is the total number of the nodes. Pseudocode BUILD-MAX-HEAP (A) 1 heap-size [A] < - length[A] 2 for i <- Length[A]/2| downto 1 3 do MAX-HEAPIFY (A, i) MAX-HEAPIFY (A, i) 1 l <- LEFT (i) 2 r <- RIGHT (i) 3 if l <...
I am attending a course about algorithm design, and I have found an old test which has once been submitted. However, I don't have the solutions to it, and I am having some trouble with one specific excersise. This is the text: Matt is planning a road trip from City A to City B, and he wants to minimize the number of br...
In parallel programming the iteration scheduling is defined as the determination of the logical execution time for each loop iteration, while in operating systems, the processor scheduling (FCFS etc) is defined as the ordering in which the processes get the CPU to execute. Since the execution of a loop is a process its...
To sort 64 elements Time required is $n*log_2{n}$ units The equivalent posteriori time is 30 sec. In 6 minutes I get 768 elements sorted. But the answer is not 768 and is instead 512, I wonder why?
Consider a circular graph $G_1$ with $n$ vertices and a complete graph $G_2$ with $m$ vertices. What is the maximum attainable ratio when determining the Minimum Spanning Tree (MST) using Boruvka, Kruskal, or Prim algorithms? I think about it in the following way: A complete graph with $v$ vertices has $\dfrac{(v-1)*v}...
Rice's theorem asserts that as soon as $f$ is non-trivial (i.e., non-constant), and extensional (i.e., $f(M) = f(M')$ as soon as $M$ and $M'$ are codes of Turing machines with the same behavior, in the sense that both halt and return the same output or both don't halt), $f$ is uncomputable. One classic way to prove thi...
Consider the following problem stated formally: You are given $n$ objects $o_1$, $o_2$, ..., $o_n$ and $k$ classes $c_1$, $c_2$, ..., $c_k$, each class containing some objects; an object is chosen. Construct queries asking about the class of the object, such that it can find the chosen object respective to the respons...
In the pumping lemma conditions for context-free grammar we have that the string can be divided into $uv^{i}xy^{i}z$, but in the case of $i = 0$, why does it still belong to the language?, is it possible to have an example with a string? Should it be $i = 1$ is one repetition and for $i = 0$? In the case $i = 0$ the wo...
Consider the simply read-write lock algorithm that allows many readers and a single writer. Why is this algorithm flawed? I was thinking about the implementation of a well-known read-write lock library and wondering why it didn't do this simpler approach. To read: atomically add 1. if the old value was less than N, pr...
Let $\cal M$ be a deterministic stack automaton ${\cal M } = (Q, \Sigma, \Gamma, \delta, q_0, F, Z_0 )$. Let $\gamma \in \Gamma^* $ a word on the stack alphabet. Is it true that the language $$L = \{ w \in \Sigma^* \mid (q_0,w,Z_0) \vdash^* (q,\epsilon, \gamma),\ q \in F \}$$ is a deterministic context free language?...
I've a set $N$ of $n$ distinct numbers of $d$-bits each; call them words ($1\leq n\leq 2^d$, with $d\geq 1$). I want to store $N$ using as least space as possible, by partitioning $N$ and factoring out the common bits within each group. The problem is finding the optimal partition, taking into account group payloads. F...
So I have a bunch of strings that represent routes in a HTTP web framework. Each string has a leading /, some /-separated path segments which can either be a string, a single-segment wildcard ?, or a trailing multi-segment wildcard *. (For this problem, we can assume that * can only be in a trailing position, but there...
A couple of years ago, I read a story about a professor of computer science, who showed his first semester students a few lines of code with a simple questions. I think it was something along the lines of this: a = 5 b = a a = b + 5 c = a + b What is c? And this professor argued, that this simple test is in some sen...
Let $L_1 = \{ a^{n}b^{m} \mid n > m > 0 \} $. Describe a non-regular language $L_2$ such that $L_3 = L_1 \cup L_2$ is regular and $L_3 ≠ A^{*}$ (where $A = \{ a, b \} $) From the trace, I cannot prove this with the simple language of $L= \{ a^{n}b^{m} \mid n,m > 0 \} $ since it must be different from $A^{*}$. I had tho...
In traditional processors one move operation can at most move one word between memory locations and optionally increment or decrement the registers which point to those memory locations. In x86 architecture it is realized with movs operation, in PDP-11 as mov with auto-increment or auto-decrement addressing. But I wond...
Is it known whether the language $L_π = \{w\in\{0,1\}^* : w\text{ appears in the binary expansion of }π\}$ is decidable? $L_π$ is easily recognizable (a.k.a. computably enumerable). A trivially decidable very classical variant of the language is $\{n:0^n\text{ appears in the binary expansion of }π\}$. There is a conje...
I'm looking at using something like Crockford Base-32 encoding in a situation where people have to manually write IDs in a very compact space. Crockford Base-32 describes a simple checksum algorithm using modulo 37 that will catch a single substitution or transposition, which helps a lot when dealing with poor handwrit...
There are simple algorithms to construct sorting networks from 2-sorters, e.g. Batcher's bitonic sorters and Pairwise sorting networks. How can one construct general sorters with a low number of $k$-sorters, $k\gt 2$? Is there a similar result for select / partial sorting, say, the $\sqrt n$th element or the top $\sqrt...
I teach a fairly advanced algorithms class to high schoolers and I accidentally presented them with a bunk reduction from Hamiltonian path to the Tripartite graph decision problem. My attempt involved creating three vertices in the transformed input $G'$ for every one vertex in the original undirected graph $G$ and con...
I read the Amazon Aurora paper and in the performance result section (i.e. 6.1.1), it says The results are shown in Figure 7 and Figure 6, and measure the performance in terms of write and read statements per second respectively. Aurora’s performance doubles for each higher instance size and for the r3.8xlarge achieve...
I'm exploring the decidability characteristics of a particular language formed by the intersection of two languages, specifically in the context of the Halting Problem. The languages are defined as follows: $\text{Special Halting Problem Language} K: K := \{ w \in \{0, 1\}^* \mid w\#w \in H \}$, where $H$ is the...
I'm trying to solve a problem from one of the older exams. Question: There's an infinite, one-dimensional board, with fields numbered consecutively $\ldots, -2, -1, 0, 1, 2, \ldots$ A move in the game consists of selecting a field and placing a token on it. If after placing the token it turns out that on two adjacent ...
Given a multiset $S$ of positive integers and a fixed positive integer $k$, can $S$ be partitioned into $k$ parts with equal sum? For $k = 2$, this is the well-known Partition problem. For general $k$, this is described on Wikipedia as the "multiway number partitioning" problem, and it's claimed there that this problem...
How many symmetric boolean functions exist that are linear? Let $f$ be a $n$-variable boolean function. $f$ is said to be symmetric if it is unchanged by any permutation of its variables, i.e. for 2-variable boolean functions $f$ is symmetric if $f(a,b) = f(b,a)$. In addition $f$ is called a linear function if it does...
I initially brought this up on the Swift Forums, and it was suggested that this might be a thing better suited for CS SE. So here goes: I had this thought that the compiler already has enough information to be able to infer an appropriate data structure to use given the rest of the usage patterns that follow. This soun...
Show how to check if n-bit number is divisible by 7 in logarithmic circuit depth. How can I construct the circuit to be able to check the divisibility?
I recently got the following question in my exam. Q1) In the banker's algorithm, if the total number of resources in the system is 20 and the maximum resource allocation for a process is 5, what is the maximum number of processes that can be running simultaneously? Options 1 4 5 20 The answer is given as 5. I believe...
Is it possible for the hyperplane method for loop parallelization, to return more than one hyperplanes whose points are scheduled to be executed at the same time? In an example I studied (Shang & Fortes, 1991), I found nine hyperplanes, parallel each other and grouped in three sets, with the three hyperplanes of the fi...
What is the complexity class of the following variant of the SSP problem: Input: set of integers $\{x_1,\ldots,x_n\}$, integer $k$ and integer $T$. Output: Yes, if there exists a subset $S\subseteq \{x_1,\ldots,x_n\}$ for which: $|S|= k$ and $\forall S'\subseteq \overline{S}$ it holds that: $\sum_{x_i \in S}x_i + \sum_...
Given CNF-SAT reduce it to the following decision problem: Given n items, m groups (and for each group a set of items) and a parameter k. The problem outputs yes/no if there exists k or less groups such that every item is at least in one of the selected groups. How can I reduce the CNF-SAT to this problem? I get stuck ...
By the winning instruction I mean a string that a deterministic polynomial time Turing machine can use in order to win the opponent in a competitive game. The difference from a certificate is that the winning instruction does not have to prove its own correctness, you just trust it. A naive winning instruction for TQBF...
Let us consider the case where $p > 0$ exists and a string $|w| ≥ p$ can be divided into $uv^{i}xy^{i}z$ for each $i ≥ 0$. When we say that $|vy| > 0$ do we mean that at least one of the two must be greater than zero? or both? is it possible to demonstrate this condition with a practical example? Similarly why $|vxy| <...
Given an input NFA, can one construct an NFA that is universal (that is, accepts all its inputs) if and only if, the input NFA isn't universal? I tried to use the fact that NFA-universality is PSPACE-complete, and the fact that PSPACE = coPSPACE. I am also interested in the details of a simple construction.
I am a soon-to-be physics graduate student with a background in theoretical and experimental cosmology. In my work, I've often found myself applying machine learning models and techniques for the purposes of performing data analysis tasks. I, as many do, find the field to be fascinating, but have little more than a sup...
Reading through https://en.wikipedia.org/wiki/Timeline_of_operating_systems to decide where to port some library software—network|crypto|archive abstracting—I'm writing in C (C89). DOS is definitely still in use today; and that takes us back to the 1980s. Perhaps V6 UNIX (1975)? - One of the early BSDs?
I am trying to find a way to automate solving for all possible numerical values in a large multivariable system of equations. By this I mean equations such as k(90)*g(-3)=434 and k(47)*g(-5)=237 Essentially I want to solve for variables such as g and k in the context of one another and all the equations (the equati...
I had the following question in an exam: Which of the following best describes the concept of concurrency in an operating system? Options: The ability to execute multiple programs simultaneously. The ability to perform multiple I/O operations concurrently. The ability to execute multiple threads simultaneously The abi...
From the wikipedia of Free variables and bound variables In computer programming, the term free variable refers to variables used in a function that are neither local variables nor parameters of that function. The term non-local variable is often a synonym in this context. Since local variables and parameters are bou...
foo: addi $t0,$zero,1 addi $v0,$zero,0 outer: beq $t0,$zero,exitout sll $t0,$t0,0 addi $t1,$zero,0 add $t2,$zero,$a0 addi $t0,$zero,0 inner: addi $t8,$a1,-1 slt $t9,$t1,$t8 beq $t9,$zero,outer sll $t0,$t0,0 addi $v0,$v0,1 lw $t8,0($t2) lw $t9,4($t2) slt $t7,$t9,$t8 beq $t7,$zero,skip sll $t0,$t0,0 lw $t8,0($t2) lw $t9,...
Exercise 14.1 of Elements of Information Theory asks us to prove that there is a constant c such that $$K(x,y)\leq K(x) +K(y)+c$$ for all binary strings $x,y$. Intuitively this seems true. Just write a program that first runs the program that $p_x$ that outputs $x$. Then the program $p_y$ that outputs $y$. Finally, out...
I am struggling to solve the following excercise: Design an assignment of a group of n students to m classes. Student i should take a minimum of $l_i$, and a maximum of $u_i$ within a set C1 of classes. Class j should be attended by a minimum of $m_j$ and a maximum of $M_j$ students in order to be activated. Design a...
In practice, it seems that many NP-hard problems "usually" lead to easy instances, in the sense that a commercial solver can handle them reasonably. A few past questions on this topic (see here and here) have been answered by saying they are not well-posed Here's a shot at a asking a question which might have a non-tri...
I'm currently preparing for a final exam in Networks and Internet Systems. I don't have a large background knowledge on the topics, so I'm attempting to use python to approach the majority of question in the exam. I had an original series of code written out but when I try to use it for this question, it runs, but give...
I am trying to understand the background literature on regular language inference in the TTT paper ("The TTT Algorithm: A Redundancy-Free Approach to Active Automata Learning" by Isberner, Howar and Steffen). In it, they say in Related Work, "Maler and Pnueli[22] suggested adding all suffixes of the counter examples to...
This is the pseudocode for insertion sort. My question is this: suppose I have the array [5,2,4,6,1,3]. key = 2 and i = 1. Then A[i+1] = A[i] is A[2] = A(1) = 5. So now isn't the new array [5,5,4,6,1,3]? Where in the pseudocode does it write the 2 into the first place, i.e: A(1) = A[2]? Edit: I think I realised my mi...
After "speaking" with ChatGPT, I decided to test Z Order Curve. The code interleaves 2D data, then search for range x: [2..4], y: [2..4] Programming code using C/C++ should be as follows: #include <cstdint> auto interleave_bits_2d(uint8_t x, uint8_t y) { using Result = uint16_t; constexpr auto size = 8; ...
I'm relatively new to computational complexity and am trying to use the time hierarchy theorem to show that $Time(n^7)$ is strictly contained in P. I understand that the time hierarchy theorem says that if the limit as n tends to infinity of $\frac{T_1(n)}{T_2(n)}=0$ then $Time(T_1(n))$ is strictly contained in $Time(T...
Question 1: L = { 0^n 1^n | n > 0 } My answer = S -> 0 S 1 | 10 Question 2: L = { 101^n0^2n | n > 0 } My answer = S -> 101 S 00 | 100 Can anyone correct this if there is any issue with this CFG?
From the round-robin wikipedia In the absence of time-sharing, or if the quanta were large relative to the sizes of the jobs, a process that produced large jobs would be favored over other processes. Isn't that obvious? I mean if burst time of $P_1 > P_2$, then $P_1$ will remain in the running $\Longleftrightarrow$ r...
I had an exam question which says how many segments the user accessible part of the 8086 memory contains? I have count it using this: Since from $00000$ to $0007F$ and $FFFE0$ to $FFFFF$ are made for a reserved and dedicated parts of the memmory we will take it out from the actual size of the memory which is $1MB$. For...
I have designed a C++ program to recognize the digits on an ID card based on OpenCV. First I preprocess the ID card image and then segment it based on contours. The segmentation results are as expected. Then I use the matchTemplate function with templates stored in the template path. However the recognition is inaccura...
I am working on parts of my master-thesis and got to a problem which I would like to solve and develop some algorithm for. Basically I am dealing with 2d-geometry which I would like to represent using a 2d grid. Task My grid represents a density of my structure which should eventually converge to my final result. My no...
How do i show that Double Dominanting Set is NP-Complete by reducing Dominating Set to it i have thought by adding a edge but my solution is not correct Input is an undirected graph and a target. The question is whether it is possible to find a subset with a maximum vertices that doubly dominate all vertices in the gra...
I'm curious about the viability of creating memory isolated processes on a processor without an MMU. While it would be inefficient I'm wondering if it's possible to basically create a virtual machine with an MMU and process each instruction on the emulator. In essence the VM would keep track of the current processes me...
In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would this situation lead to a penalty or delay in data retrieval? So far all question's I've solved involve a data or instruct...
Context: I was reading a tutorial on polyhedral optimization. But got confused while trying to translate the iteration domain (i.e. loop bound) to set builder notation. Problem Description: A code snippet from the article; for (int i = 0; i <= 2*N; ++i) S: Z[i] = 0.; The iteration domain for the statement 'S' is d...
Precedence graph of 6 processes and each number of resources they need to be fully executed is as follows: Process Resource A Resource B P1 4 2 P2 2 3 P3 3 2 P4 4 1 P5 3 2 P6 2 1 What is the least amount of each resource which prevents deadlocks? The worst case scenario for resource A is when P4,...
Let $\mathbb{F}=\mathbb{Z}/p\mathbb{Z}$ a cyclic field. Where $p$ is fixed Let $(H)_{n\in\mathbb{N}} \in \mathbb{Z}[x_1,\dots]^{\mathbb{N}}$ a family of polynomials with $H_n\in \mathbb{Z}[x_1,\dots,x_n]$ Let $\varphi : \mathbb{Z}\rightarrow \mathbb{F}$ the ring isomorphism defined by $\varphi(x)=x\bmod p$ Let $f$ a p...
I'm working on a problem where I need to find specific order statistics in a set of numbers. Given n numbers, I want to determine the k-th smallest, the 2k-th smallest, and so on, up to the ⌊n/k⌋-th smallest element. I'm looking for a method to accomplish this with a time complexity of O(n log(n/k)). My Attempt: So far...
A question I am to answer wants me to find the big O of a recurrence, I am doing it with the iteration method. For the base case, which we get after applying the recurrence $i$ times, can we make this any number as long as we assume it will be in constant time? Such as $T(5)$, $T(100)$ etc. I can't give anymore info to...
A CNF formula is Horn-renamable if you can invert variables in such a way that each clause has at most one positive literal. There is an algorithm based on a reduction to 2-SAT given in Renaming a Set of Clauses as a Horn Set. It seems, however, that by applying the standard reduction from CNF to 3-CNF, one could achie...
In most descriptions of monte-carlo tree search, I see the simulation step described as: Play out a game from the leaf node until a terminal node is reached and get the result. And the backpropagation step is described as: Use the result of the simulation to update information in the nodes on the path from the leaf ...
Under mod 2 arithmetic ($\mathbb{Z}$={0,1}), given a set $V$ of $n$x$1$ linearly independent vectors $\{x_1,...,x_n\}$ I'd like to find a $n^2$ binary matrix $M$ such that $Mv=v$ where $v \in V$ and $M\bar{v}\neq \bar{v}$ for $\bar{v}\not \in V$. I supposed it would also be helpful to know the technical term for a mat...
I know an unlabeled unrooted tree normalization algorithm that uses parentheses: label each vertex with () while there are more than two leaves repeat: remove each leaf placing its label within the ( and ) of the parent so that within the ( ) of the parent, the strings representing the children are sorted; if there...
I'm not sure if I'm posting in the correct section, but I wanted to learn about CDVs, how the weightings work, and the computation. I'm reviewing how a system is configured and looking to add a new range of numbers, but it fails validation, someone mentioned that it's probably linked to the weightings. The CDV is using...
Given an $n \times n$ matrix of integers, I would like to find the optimal dividing line that maximizes the sum of the integers on the same side as the top left corner. The dividing line should be connected and made up of only vertical and horizontal parts. For example: The complication is that the number of horizon...
Say I have N points sampled on a surface in 3 dimensions (ie. points on the surface of a sphere, 1-torus etc.). Is there an algorithm that would be able to count the number of holes in the surface formed by those point (ie. zero holes for the sphere, 1 hole for the 1-torus etc)? Edit: As a constraint, the points that m...
Could someone explain to me, through an example, how the McNaughton–Yamada–Thompson algorithm works in a way that I can understand? Thank you in advance for your helpful response!
Consider an undirected graph $G = \langle V, E\rangle$, and a set $S\subseteq V$ of vertices. We say that $S$ is a dominating set, if for every vertex $v\in V$, it holds that $v\in S$, or $v$ has a neighbor in $S$. We say that $S\subseteq V$ is a disconnected dominating set if it is a dominating set and the subgraph of...
I want to make a Galaxy schema of a Restaurant. There are 2 fact tables sales and purchases. sales are related to customer and purchases to supplier of ingredients. Now my question is how can i make galaxy schema and from where i can find large dataset for my dataware house project
I have been stuck on a task in class. I have to find a context-sensitive grammar for the language $L=\{a^{n}b^{2^{n}}|n \in \mathbb{N}\}$ and I just cannot figure it out. Any help would be very much appreciated!
I was watching a presentation related to the MuJoCo simulator (and other topics which were more relevant for the presentation itself) and at one moment in the presentation it is mentioned that MuJoCo has thread safety due to not having memory allocation in runtime. Why is thread safety ensured because of this? Memory m...
TQBF is a canonically PSPACE-complete problem. It consists of boolean formula such that all its variables are quantified. The question is whether a given TQBF instance is TRUE or FALSE. https://en.wikipedia.org/wiki/True_quantified_Boolean_formula My query is regarding the formula part. No source explicitly mentions th...
I’m definitely not a computer science expert, but I find this topic extremely interesting - due to this interest, I’ve recently enrolled in a class about Turing Machine. The lecturer assigned to us an exercise and one of the questions is: ‘Write down a program of a Turing Machine with just two states that, when given t...
I'm currently working on a problem to come up with ideas to solve a stable flow problem but unlike the traditional stable flow problem where every node has preferences on its incoming and outgoing edges, I only care about preferences on outgoing edges. The paper "Stable Flows over Time" presents a nice simple solution ...
In my PhD, I will work with ML models. However, I will only use ready-made models as a tool, but I want to delve deeper into Artificial Intelligence not just to use ready-made models, but to understand how it works and create my own AI. I noticed that most of the content I found talked more about how to use ready-made ...
Given an undirected graph $(V,E)$ with weights on edges $\in Z$ is it possible to find a negative cycle of even length (not the weight of the cycle, but the number of edges contained in the cycle) in polynomial time? Formally: Find a sequence of vertices $\{v_1,v_2,...,v_k,v_1\}$ such that For every $i$, edge $(v_i,v_...
I have a very strange (arbitrary) problem that I have been trying to wrap my head around, but have been struggling to figure out how to accomplish this. I'll use Rust but in a pseudo-code fashion, these probably won't compile. Background The library function takes a &[u64] (a slice/array/list of unsigned, 64-bit intege...
I was studying the dining philosopher problem (See problem description) and its solution using semaphores, and I came across this : **Code for the ith philosopher:** while(1) { take_chopstick[i]; take_chopstick[ (i+1) % 5] ; EATING THE NOODLE put_chopstick[i] ); put_chopstick[ ...
What is the smallest 3-CNF system of equations possible that enforces the boolean expression: a = b + c for boolean variables a, b, c? 'Smallest' can be defined as: (1) Number of 3 CNF clauses. (2) Number of new variables introduced in the clauses. We are interested in both cases.
We have shown that any comparative sorting algorithm has the worst-case complexity of $\Omega(\log (n!)) = \Omega(n \log n)$, as it has to cover all the ways a permutation can be, and according to the pigeonhole principle, there is a case where more than or equal to half of the currently unknown permutations would be u...
Consider the halting problem $HALT_{TM} = \{\langle M, w\rangle: M \text{ is a TM that halts on input } w\}$, and some undecidable Language $L$ of the form $L = \{\langle M\rangle: M \text{ does a thing} \}$. If I want to reduce the halting problem to $L$, from what I understand, I have to construct a Turing Machine $M...
You have n types work items. Each work item must be distributed to at least m processors. There are k processors (n > k > m) available. You want to distribute work as fairly as possible. Finally, you want to minimize the number of repeating pairs of work items across processors. I don't know how to express it well, nee...
Context: While exploring the fundamentals of polyhedral optimization and attempting to explore a connection from the input Static Control Part (SCoP) to the iteration domain from birds eye view, I am confused about whether I am making the correct connections or not. Explored connection map: Example case: Let's see a c...
Having a complete bipartite graph with parts $A$ and $B$, which is edge-weighted, is there a way to compute a subgraph with the maximum sum of all weights and: Only a constant number $n$ of vertices from $A$ are used. At most one edge points to each of the vertices in $B$. In essence, which nodes from $A$ and which r...
To borrow part of a description from a similar but distinct question: there exist 2^(2^N) different functions which accept N binary inputs and return a 1 bit output. For the purposes of my question I am calling these N-input-gates. I want to know if there exists a general algorithm which can always describe an optimal ...
I have a function $f$ such that is the sum of big O terms, such as $$f=\left[\sum_{i=1}^x \frac{1}{i}\right] +O\left(\frac{\ln^4 x}{x}\right)+O\left(\frac{\ln^4 x-1}{x-1}\right)+O\left(\frac{\ln^4 x-2}{x-2}\right)+\ldots$$ where $x$ is a positive integer. Am I correct in that I can simply write $$f=\left[\sum_{i=1}^x \...
Given an undirected graph $G=(V,E)$, and a parameter $k\in \mathbb{N}$ such that $k\geq 2$, how can I show that if $|E|\geq |V|^{1+\frac{1}{k}}$, a cycle $C$ exists in $G$ such that $|C|\leq 2k$? The only initial idea I have is that as $|E|\geq |V|^{1+\frac{1}{k}}$, I know that the maximal degree of a vertex is at leas...
I need to show that assuming $NP \neq coNP$ then there are 2 non-trivial languages $A$ and $B$ ($A,B \neq \emptyset, \Sigma^*$) in $NP \cup coNP$ such that there's no polynomial time reduction from A to B and there's no polynomial time reduction from B to A. I tried doing this: Let $A$ be non-trivial language such that...
The binary extension field, usually denoted as $\textsf{GF}(2^n)$ or $\mathbb{F}_{2^n}$, is a finite field of characteristic 2. Are there any applications of $\textsf{GF}(2^n)$ (or more broadly, $\textsf{GF}(p^n)$), for $n>1$, in computer science? My impression is that most applications only require a sufficiently la...
This is the question: 1.7. Give state diagrams of NFAs with the specified number of states recognizing each of the following languages. In all parts, the alphabet is {0,1}. a. The language {w| w ends with 00} with three states This is how my professor answered it: But this is the answer I found on web: But I thin...
Okay, so I understand implicitly why we might write f(n) = log 3n = O(log n) but I don't really understand why lets say f(n) = log 3n^2 = O(log n). Then what am I suppose to do with f(n) = log n! does this also just equal O(log n)? Or do I need to write it out explicitly like with f(n) = 2^(2n^3 + log_2 n) = O (2^(2n^3...
I have the following two resuts taken from the book "The Classical Decision Problem". How does Corollary 6.3.28 follow? How can I derive PSPACE-hardness from non-membership in $NSPACE(cn / \log(n))$?
I need to prove if the following Language is or is not semi-decidable. A := {w ∈ {0,1}^* | there exists an input x on which M_w produces the output 0} Where A is the language of all the encoding w ∈ {0,1}^* of all Turing machines which at least halts on at least one input x (might also accept it) and produce the output...
I need to use logic gates to calculate the floor of binary logarithm of a binary number $x_{n-1}, ..., x_0$. I know that this can be computed when I find the position of the most significant bit set to 1. So how do I find this bit and return it's position using only binary logic gates (AND, OR, XOR, NOR, NAND, NOT)?
The following problem has made me ask this question: Given a boolean formula $\varphi(X)$ decide if there exists a quantification of $\varphi(X)$ with $k$ $\forall$ quantifiers that holds true. Assume that $k$ is bounded with $\mathcal O(\log n)$. To clarify, the order of the quantifiers is arbitrary. I.e. the result...
I just need some clarification regarding the different terms we use in theoretical computer science, especially regarding decidability. Decidable: A language $L$ (a set of strings) is decidable if there exists a Turing machine $M$ that, for any input string $w$, halts on w and correctly decides whether $w$ belongs to ...