instruction
stringlengths
35
29.1k
Inspired by this StackOverflow question: https://stackoverflow.com/questions/63346135 (it was not clearly presented, and got closed) Let's say I wanted to enumerate all the 3D points on the integer lattice, within a sphere, in order of the angle between the vector to the point and the up vector (say z). Could I do this...
I know that an ASCII character needs 1 byte of memory for storage, but if a computer uses a 64-bit word addressable memory does it mean that the character actually takes 8 bytes even when only 1 byte was needed? Does being a 64-Bit word addressable memory mean the same as being a 64-Bit machine?
In simple CPU architectures, such as the one discussed here https://youtu.be/zltgXvg6r3k?t=109, an instruction loaded from RAM is executed exactly one clock cycle after it is loaded into the instruction register. This fact is key to the whole architecture working. However, I am told that in real/modern architectures it...
Here I am given 2 hash families and I need to prove the universality of the double hash, but I am stuck as to how to prove this. I know the properties of an epsilon-universal family is that the probability of collision is at most epsilon, but how could I relate this to prove the universality of the double hash?
$L=\{w \in \{0,1,a\}^* | \#_0(w) = \#_1(w) \}$ We show that L is not regular by pumping lemma. We choose w=$0^p 1^p a$ |w| = 2p+1 Now |xy| has to be $\leq p$ So x and y could only contain zeros. And $z=1^p a$ $xy^iz= 0^p 1^p a$ Now let i = 0 $xy^0z=0^{p-|y|} 1^p a$ Now hence $p-|y| \neq p$ this choice of i would lead t...
I came to know through some examples that DFS and Backtracking aren't exactly the same ( A misconception I had since a long time). So now my question is, since Backtracking visits nodes backwards step by step while DFS on a graph may directly jump some nodes backwards, is DFS a faster algorithm? If so, only in terms of...
I know for factoring we have the RSA Numbers, in which factoring one of them quickly (usually) indicates a breakthrough in the field. However, I want to know if there's something similar for SUBSET-SUM, in which there are hard instances that if solved, would be a "big deal"? I found this, but they don't seem to be unso...
My basic problem includes a graph where each node $i$ is associated with a weight $c_i$, and the problem is to find a minimum (or maximum) weighted independent set with a fixed cardinality $p$. This is I believe a well-known problem in graph theory that is well-studied for different types of graphs. Now, suppose I am d...
I would like to compute the adjoints $\bar x$ and $\bar y$, from a reverse automatic differentiation perspective, of the expression $x^y$. The adjoint $\bar{x^y}$ is already known; and we can assume $x \geq 0$ and $y \geq 1$. The "easy" solution consists of rewriting the expression $x^y=e^{y \ln x}$, and proceed piece-...
Pardon my ignorance on the matter but, Verifying passwords = Polynomial (linear) Guessing passwords = Exponential Since each guess has nothing to do with one another, exponential time is best possible time (but verifiable in linear time).
Mahaney's theorem states that the existence of $\mathsf{NP}$-complete sparse language would lead to $\mathsf{P = NP}$. Is there any result result regarding the same for the complexity class $\mathsf{PSPACE}$, like "if there is a $\mathsf{PSPACE}$-complete sparse language, $\mathsf{PP = PSPACE}$" or the same for any oth...
Let's say we have five packets p1 p2 p3 p4 p5 to be sent sequentially: and for some reasons, p3 got delayed so it the the last packet to arrive recevier. so below is the receiving order on the receiver's end p1 p2 p4 p5 p3 and according to the Go-Back-N Protocol, the receiver will only send acknowledge of p2 when i...
I am preparing for a programming exam on probability theory and I stumbled across a question I can't solve. Given a bag, which contains some given amount of white stones $w$ and some given amount of black stones $b$, two players take turns drawing stones uniformly at random from the bag. After each player's turn a ston...
We can define a reader/environment monad on the simply-typed lambda calculus, using the following three equations, where $r$ is some fixed type, $\alpha$ is any type (I subscript some terms with their types), $\mathbb{M}$ is the proposed monadic type modality), $\eta$ is the unit of the monad and $\mu:\mathbb{M} \mathb...
I came across the following question while practising for my final algorithms exam, but I am unsure how to get a linear time complexity for this problem. I assumed it would require checking which tiling patterns are compatible with each other, but get a bit stuck on how to proceed. Thanks!
There are several data structures in which the number of elements uniquely determines the shape. Examples would be binary heaps, arrays, lists, Braun trees, and Merkle mountain ranges. Are there any such data structures that can be used to efficiently implement a binary search tree with good insertion/deletion performa...
I was reading a textbook describing the Go-Back-N (GBN) protocol with Finite State Machines as pictured below: $\Lambda$ just means "initial state" or "no action", depending on the context. My questions are This is the interactive animations link to GBN https://media.pearsoncmg.com/aw/ecs_kurose_compnetwork_7/cw/con...
In the context of a discussion of Haskell https://stackoverflow.com/questions/62509788/the-intuition-behind-the-definition-of-the-co-reader-monad, I was told that There is no terminating implementation for the polymorphic type $(e \to a) \to a$ and that we couldn't have a function of type $((e \to a) \to a) \to e$ or...
The bounty above should read 'I would like to know whether the example I discuss is a com-monad and why (why not).' Suppose we set $\mathbb{M} \alpha := r \to \alpha$, where $r$ is some fixed type, and $\alpha$ an arbitrary type, of the STLC (Simply-Typed Lambda Calculus) Suppose we want to define a co-monad, which con...
In Comparing Mathematical Provers (section 4.1), Wiedijk classifies logics and type systems of different proof assistants? I do not see what he means by type system of the assistant. He only says: A system is only considered typed when the types are first class objects that occur in variable declarations and quantifie...
I have a problem and want to know if there is any combinatorial optimization that is similar in nature to this problem or how to solve this special version of the max weight matching problem. I have a general graph $G(\mathcal{V},\mathcal{E},\mathcal{W})$. I want to find a maximum weight matching of the graph $G$ that ...
Suppose I have a term $a :\alpha$ of the Simply-Typed Lambda Calculus (in the following, $\alpha, \beta, \gamma$ stand for arbitrary types) and I want to lift it to a term $\lambda x_{\beta}. \;(x, \, a)$ I could use a function $\lambda z_{\alpha}, x. \;(x,\, z)$. Suppose we then form $(b, a) : \beta \times \alpha$, by...
What are the applications of homotopy type theory to everyday programming? I know of only two applications, neither of which I understand: "Homotopical Patch Theory" "HoTTSQL: Proving Query Rewrites with Univalent SQL Semantics" Is there a capsule summary of how HoTT is relevant to these problems? Is there a general ...
Consider a language $L_1$ that is recursively enumerate, $L_2$ that is regular, and $L_3$ that is context-free. Are the following problems algorithmically decidable? Is $L_1 \cap L_2 = L_3$? Is $L_1 \cap L_3 = L_2$? I think problem 1 is undecidable since $L_1 \cap L_2$ is a recursively enumerable language it can be e...
Task I want to approximate the median of a given distribution $D$ that I can sample from. A simple algorithm for this, using $n$ samples, is: samples = [D.sample() for i in range(n)] # generate n samples from D sort(samples) return samples[n/2] However, I am looking for an algorithm that requires less than $O(n)$ spac...
By giving an Huffman coding tree and the total frequency of the characters. how can I find the most unoptimal frequencies for each character such that the size of the code will require the most possible of bits?
I'm trying to find out the most efficient way of turning a list of path strings into a hierarchical list of hash maps tree using these rules: Node labels are delimited/split by '/' Hash maps have the structure: { label: "Node 0", children: [] } Node labels are also keys, so for example all nodes with the sa...
So, I understand how binary arithmetic works, and I understand how an adder-subtractor works for signed numbers. There is only one thing I am not sure about: All the cases work ok in the circuit I have, except if the result of a subtraction is negative, I need to take the two's complement of the output byte to get the ...
The definition of approximation factor preserving reduction from the book by Vijay V. Vazirani, page 365: Let $\Pi_1$ and $\Pi_2$ be two minimization problems, an approximation factor preserving reduction from $\Pi_1$ to $\Pi_2$ consists of two polynomial-time algorithms, $f$ and $g$, such that: for any instance $I_1...
I've been playing around with prolog and realised something. You can do everything without predicate names. e.g. Just change all predicates $$a(b,c,d,e,..)$$ into $$prop(a,b,c,d,e,..)$$ Where $prop$ is some character that you can use for all function names. So $isRed(X)$ becomes $prop(isRed,X)$. Which makes me wonder i...
I understand that computer memory data is sequential; It is one long line organized in one or more address/es, each of which containing one or more fixed size word/s which contain raw data (in an initial manner, just offset value/s, I would assume). Why does memory data isn't organized in two or more lines (why it's ju...
Decision Problem: Is $2^k$ + $M$ NOT a prime? $K$ and $M$ are our inputs represented as integers. Function Variant: Output the result of $2^k$ + $m$ We can consider, $M$ = $0$. Proof that calculating 2^n requires an exponential amount of digits as the result Question Is it true that a non-deterministic machine cannot o...
I am reading about embedding/automation of modal logics in classical higher order logic (http://page.mi.fu-berlin.de/cbenzmueller/papers/C46.pdf) and Goedels proof of God's existence is prominent example here https://www.isa-afp.org/entries/GoedelGod.html (as encoded for Isabelle/HOL). This embedding has embedding for ...
I want to add two IEEE 754 numbers. I followed the steps to add two 754 numbers. However the result it not correct. Number 1: S:0 E:01111111 M:11111111111111111111111 Number 2: S:0 E:01111111 M:00000000000000000000000 Here is my calculation: The site http://weitz.de/ieee/ gives this result: S: 0 E: 10000000 M: 1000000...
In https://www.seas.harvard.edu/courses/cs152/2019sp/lectures/lec18-monads.pdf it is written that A type $\tau$ list is the type of lists with elements of type $\tau$ Why must a list contain elements of the same type? Why can't it contain elements of different types? Is there a way of defining a list polymorphically ...
I am kind of confused which function $f:\mathbb{N}^2\longrightarrow\mathbb{N}$ is presented by $F(x,y,z)\Longleftrightarrow (x+z)=y \lor (y+z)=x$ I know that $f(x,y)=y-x$ is represented by $F(x,y,z)\Longleftrightarrow (x+z=y)\lor ((z=0)\land \exists w(x+w)=y)$ But the or symbol confuses me ... My guess was $f(x,y)=max\...
The biconditional operator $\iff$ of Propositional Logic can be defined by the identity $p \iff q \equiv (\lnot p \lor q) \land (\lnot q \lor p) \quad (1.1)$ Use the identity $(1.1)$ and identities from the list on page 2, to show algebraically that $p \iff q \equiv (\lnot p \land \lnot q) \lor (q \land p)$ State which...
I need an algorithm to determine the best itinerary for a series of events. Each event has a time, location, and reward. Arriving at an event in time yields the reward; too late means no reward. Each event is at a physical location thus it takes time to travel from event to event. It is not necessary to attend every ev...
I know that the most basic (and least abstract) code for programming is machine code (with binary of 0s and 1s being the typical machine code). I also know that computers can save data even if they are turned off, by different types of computer memory (storage device memory, RAM and other computer system devices which ...
I received this problem on an exam a few months ago, and have kept thinking about how to solve it with no luck. Given a binary tree where each node in the tree can either be selected or unselected, implement a function k_away() which returns the minimum number of nodes that need to be selected so that every node in th...
I've got this problem on my last exam, which I struggle to deal with. Let's say we have array of $N$ integers (it can be float too, but let's say integers for sake of simplicity. We need to sum those numbers, but we can only use operation of summing two adjacent numbers. Goal of algorithm is to sum this sequence, so m...
I understand "escaping data" as making an exception when matching data; for example, if a program can't match data wrapped in some character/s (such as single and/or double quotes) without an exception, than we make an exception when "escaping" such character/s to be matched. Is escaping a concept in CS? Is it "part of...
First, I learned this based on these facts: Turing machine (TM) will be define with 7-tuple Notation, $M=\langle Q,G,b,S,d,q_0,F\rangle$. Any computation rules that can use to simulate any possible TM is called Turing-Complete. Universal TM (UTM) is TM that is Turing-Complete. Then, the question begins: If we have 7...
This is an interview question. Interviewer wanted a scalable solution Goal is to find value of shopping cart. Cart could have 3 different types of items(Physical,Digital,URL). Only Physical Items have a shipping address. Only Digital items have a redeemable code that is used in a merchant site. Only URL items have a UR...
I want to create a new way of representing floating point. In standard IEEE floating point, we have 1 bit to represent sign, 8 bits to represent exponential and 23 bits to represent significand. In the new floating point system, I keep the breakdown of sign/exp/significand but there is no implicit 1 (assume there is no...
My task is to input a given list of size N, then process N queries that remove an item from the list and then print it to the screen. The input 5 2 6 1 4 2 3 1 3 1 1 would represent having a list {2 6 1 4 2}, then outputting and removing the third, then first, then third, then first, then first elements of the list, i...
I was looking an algorithm to solve a problem of finding whether and array contains a quadruple with sum = k,(k is input) mentioned at GeeksforGeeks. In one solution the approach mentioned is below,which i think i not correct: Store all possible two elements pairs of array in some another auxiliary array and also stor...
This question is related to the epsilon- (or delta- if you prefer) test for floating point equality. But my question is not how to do it. Instead I have a related algorithm for testing equality, and I would like feedback as to what might be wrong with it. The idea is to take the quotient of two floating point numbers a...
Steven Skiena's "Algorithm Design Manual" has the following code for the backtracking algorithm: #include "backtrack.h" #include "bool.h" bool finished = FALSE; /* found all solutions yet? */ /* a[] is the array representing a partial solution. k is the integer representing the current position i...
I was reading a textbook which describe general organization of cache as: Then an exercise is, given m=32, C = 1024, B = 8,E = 4, S = 32, so s = 5, b = 3, therefore t = 32-5-3 = 24 I am a little bit confused here, since E = 4, we only need 2 bits to differentiate it, so t should be 2, if t is 24, isn't that we waste ...
Given an undirected graph G(V,E), find the minimum number of vertices to remove so that the Edge Set of the graph becomes empty. In other words: If we remove one vertex we remove that vertex along with all edges connected to that vertex. Find the minimum number of vertices to remove so that there are no edges left in G...
Do we consider functions like printf part of C language even if it's not a keyword in it.
I came across this question about showing that the language $L = \{w \epsilon \{a, b, c\}^*: n_a(w) + n_b(w) = n_c(w)\}$ is context-free but not linear in the book by Peter Linz. That is easily doable by the separate pumping lemma for linear languages (as given in Linz's book), but my question is different. Evidently t...
Problem input: undirected graphs $G$, $H$ and a bijection $f: E(G) \to E(H)$ Question: Is there a Eulerian path $p: \{1,\dots,|E(G)|\} \to E(G)$ in $G$ such that $f \circ p$ is a Eulerian path in $H$? Is this problem in $P$, $NP$-complete or maybe equivalent to some other well-known problem that isn't known to be eithe...
Paulson et alii. From LCF to Isabelle/HOL say: Resolution for first-order logic, complete in principle but frequently disappointing in practice. I think complete means they can proof any true formula in first-order logic correct. In the Handbook of Automated Reasoning I find: Resolution is a refutationally complete ...
I'm having difficulty understanding when can we know if the time complexity of an algorithm is n+m or n*m Is the time complexity of the following algo O(n+m) or O(n*m) Can you please point me to a resource that can give some sample examples of code patterns for different variations of time complexity? For example: for(...
I have a large database containing coordinates along with an elevation number. If I am a person looking in some direction (0-360) with an n degree field of view, and located at some coordinate and at some elevation, how can I generate an image representing the horizon? What algorithm should I use?
I recently came across these books: Differential Geometry and Lie Groups: A Computational Perspective Differential Geometry and Lie Groups: A Second Course Their subject matter really intrigues me, as I really enjoy topology/geometry/analysis, but had not planned to pursue them since I also want to work in an area wi...
In MDK, we have a vector $W = \{W_1, W_2, ..., W_d\}$ where each element corresponds to the maximum weight for the respective dimension in the knapsack. I want to add a conditional constraint: $V = {V_1, V_2, ..., V_d}$, where each $i$-th dimension in the knapsack must have a value sum greater than threshold $V_i$. I a...
We know that each component has different frequencies, but what happens when a fast component directly comunicates with a slow one?
When thinking about diagonalization, I've always glossed over whether or not the enumeration, or the diagonal is computable or not. When does it matter? Say for example, that have an enumeration of the rational numbers in an uncomputable order, then we would have to assume that either an uncomputable enumeration of the...
On this Wikipedia article, they claim that given $A, B, C \geq 0, \; \in \mathbb{Z}$, deciding whether there exist $x, \,y \geq 0, \, \in \mathbb{Z}$ such that $Ax^2+By-C=0$ is NP-complete? Given by how easy I can solve some (with nothing but Wolfram), it doesn't seem right. I'm sure it's either written incorrectly or ...
Let $p$ and $q$ be prime numbers and $\phi$ Euler's totient function. Is there an efficient way of computing $\phi(\phi(p\cdot q)) = \phi((p-1)(q-1))$, that is not simply based on factoring $p-1$ and $q-1$? Obviously, if $p$ and $q$ do not equal two, $p-1$ and $q-1$ are even and consequently their prime factorization i...
Can anyone explain nicely what Simple Uniform Hashing is, and why searching a hashtable has complexity Θ(n) in the worst case if we don’t have uniform hashing (where n is the number of elements in the hashtable)
I have multiple linear programming problems of the form: $$ Minimize\{c^{T}\cdot x\} s.t. Ax = b, x \ge 0 $$ Where $c$ and $A$ are fixed for all the problems. Is there any way to utilize that for a more efficient solution than solving each problem from scratch? Currently I'm using scipy's linprog but the performance is...
This is a similar question to How 2d cellular automata rules works? However, the answer there did not provide me what I am looking for. Specifically, I want to be able to render these 2d cellular automata forms: https://www.wolframscience.com/nks/p173--cellular-automata/ I cannot find any reference anywhere that explai...
Say you have a grid of pixels. And there are 20 overlapping red rectangles on a blue background. I want to find an algorithm to count the minimum number of rectangles that are needed to form the image. And also the maxium extent of these rectangles. Any good algorithms for doing this? It is easier said then done. Perha...
Is there any conceptual generalization of higher-order functions like map and reduce but for N-dimensional objects (e.g. arrays or tensors)? For mapping, I guess it would be a point-wise generalization. In the case of reduction, I have more doubts because the iteration is not trivial. Perhaps it would take an additiona...
The loss function of each expert in the expert advice problem(or any online learning problem) depends on the time($t$) and expert advice at that time($f_{t}(i)$). suppose in this problem, loss function depends on the previous prediction of the algorithm. $$ l _{t} (i) = p_{1} p_{2} \cdots p_{t-1}f_{t}(i)$$ such that $...
It looks like most of today's algorithm analysis is done in models with constant-time random access, such as the word RAM model. I don't know much about physics but from popular sources I've heard that there's supposed to be a limit on information storage per volume and on information travel speed, so RAMs don't seem t...
I tried to solve this problem but could not do it better than $O(n^2)$. My Algorithm: 1. Calculate prefix sum 2. for i in 1..n: for j in 1..i: if presum[i] - presum[j-1] > k: ans = max(ans, i - j) Edit: I have found a solution which works in $O(n\log n)$. This solution does a binary search on th...
From wikipedia on lock convoy: A lock convoy occurs when multiple threads of equal priority contend repeatedly for the same lock. Unlike deadlock and livelock situations, the threads in a lock convoy do progress; however, each time a thread attempts to acquire the lock and fails, it relinquishes the remainder of its s...
Say I have an array a[1..n], and I want to output an array s[1..n] with s[i] = a[1]+...+a[i]. What is the best (or at least standard) way to do so in parallel? The way I can think of doing it, given m processors, is to split the array a into m blocks of equal size M, compute b[j] = a[floor((j-1)/M)*M+1]+...+a[j-1]+a[j]...
Given a co-graph like the one attached as an input what are the steps that I have to follow in order to generate its co-tree? Is there a step-by-step algorithm to do that?
I read a few years ago in this book that NP problems are tractable in the space of cellular automata in the hyperbolic plane. What does this mean? Does P = NP according to these books/papers? Some excerpts from the paper: It is well known that if we have binary trees at our disposal “for free”, it is possible to solve...
I have a robot with two motors A and B connected to wheels 21.6mm in diameter. The motors move in steps, and there are twenty steps for each complete revolution of the wheel. To make the robot move forwards, I turn on A and B in the forward direction and have it rotate a number of steps. To make it move backwards, I tu...
The task is to record a histogram from a streaming data source. One data point is, say, a 16 bit integer. The maximum multiple of one data point before the stream ends, is < 2^32. The main restriction is that there isn't enough memory to have an array of counters which completely covers the range of the data points (65...
So, I'm currently studying Newton method used for finding the 0's of a function, however my professor has only announced that the speed of this algorithm can be more than quadratic, however I'm wondering when this happens, since in the demonstration used by him to explain the quadratic case, there is no evidence about...
It's my first time to make a question here. I have a curious problem about algorithm, in the center of Cartesian plane (0,0) I need to go to another point (x,y) -x and y are belong to Z numbers - but I only can use horizontaly and verticaly steps and this steps increases one by one units, a unit is a distance from (0,0...
I am just reading about perceptrons in more depth, and now onto Sigmoid Neurons. Some quotes: A small change in the weights or bias of any single perceptron in the network can sometimes cause the output of that perceptron to completely flip, say from 0 to 1..... That makes it difficult to see how to gradually modify t...
Suppose that there are a set $P$ of $n$ points on the plane, and let $P_1, \dots, P_k$ be distinct subsets of $P$ such that all points in $P_i$ fits inside one unit disk for all $i$, $1\le i\le k$. Moreover, each $P_i$ is maximal, i.e., no unit disk can cover a subset of $P$ that is a strict superset of $P_i$. Visually...
I have been studying a streaming algorithm to determine if there is a majority element in a stream. But am confused by a proof for it. The algorithm works as follows. You keep one counter $c$ and a store for one item called $a^*$. When a new item arrives, first you check if $c == 0$. If so you set $c=1$ and $a^*$ store...
I was familiar with the approach of first coming up with an algorithm, and then proving the loop invariant to come up with an algorithm as elucidated in CLRS (Introduction to algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein). Lately, on reading Udi Manber's introduction 'A creati...
Formulating standard Sudoku as an exact cover problem is easy and well documented. All of the constrained groups contain every digit which makes it natural to express the problem this way. Wikipedia claims without citation that: Although other Sudoku variations have different numbers of rows, columns, numbers and/or d...
I'm trying to solve this problem, but without success. Problem: You're given a binary string where some of the bits are replaced by ?. You're also given several intervals [$l_i$, $r_i$] ($l_i < r_i$). Find a binary string S with ? replaced by 0 or 1, such that in each interval [$l$, $r$], s[$l..r$] includes both 0 and...
Pardon my ignorance, but after just learning about Sigmoid and Tanh activation functions (and a few others), I am wondering why they choose functions that always go up and to the right? Why not use all kinds of crazy input functions, those that fluctuate up and down, ones that are directed down instead of up, etc.? Wha...
I have a fixed array: [a,b,c], I wanna loop through this 3-items-sized array for 7 times in order to find what I would get at that exact step. The "value stack" for 7 would look like a b c a b c a. Question is, how can I find what value would be at step 10, for example? Input: getValueForStep( [a,b,c], 7 ) Output: a
I'm trying to analyze Bubble Sort runtime in a method similar to how to it's done in "Introduction to Algorithms 3rd Ed" (Cormen, Leiserson, Rivest, Stein) for Insertion Sort (shown below). I haven't found a line by line analysis like the Intro to Algorithms line by line analysis of this algorithm online, but only mul...
This article says the following: Deciding between the sigmoid or tanh will depend on your requirement of gradient strength. I have seen (so far in my learning) 7 activation functions/curves. Each one seems to be building on the last. But then like the quote above, I have read in many places essentially that "based on...
I am curious as to the overhead cost of spawning child processes using fork in a Linux environment. Suppose I have a C program such as void run_computation(int x); int main() { for (int k=0; k<10; k++) { if ( fork() == 0 ) { run_computation(k); break; } } return 0;...
During burst mode in a DMA access, the DMAC has control over the bus for the whole transfer session which includes DATA PREPARATION time as well as DATA transfer time, after the transfer is over, the DMA relinquish the system bus. So in the mean time, the cpu can neither fetch any instruction from the MAIN MEMORY, nor ...
I have the following two CFL: $A =\{a^m b^n c^n\}$ and $B = \{a^m b^m c^n\}$. I don't understand why the intersection of this languages is $\{a^n b^n c^n\}$: can anyone explain to me why the power is to the $n$ and not to the $m$ or something else? Thank you in advance.
I'm looking to minimize the length of an expression in boolean algebra that has been given in disjunctive normal form and is free from redundancy. To remove redundancy from the original expression I have applied the Espresso Hueristic Logic Minimizer as implemented through the PyEDA library. Now, I would like to expres...
My question is the following: Is it possible to compute a string given that after applying a SHA256 function the result is the same string? Edit for clarification: If my string A is a neutral element of SHA256, then: A == SHA256(A) is true. Does A exists?
I need help with the following question - There is a set S of n integers. Given a black box which returns three integers a,b,c in S such that a+b+c = 0 if they exist. One needs to devise an algorithm that makes only one call to the black box to find out if S contains three integers such that a+b=c The question also had...
I have a computational problem that I want to solve. I'm not sure if it has already been studied in literature, or if so under what name. I'd appreciate any pointers to literature or suggestions for an algorithm. Input: A connected, undirected graph G = (V, E) in which certain edges are labelled "bad". Output: The mini...
I'm reading "Introduction to Algorithms" 3rd edition by Cormen, Leiserson, Rivest, Stein Page 46. The authors place formal upper and lower bounds on a function which is quadratic. Can anyone explain where the values for $c_1$, $c_2$ and $n_0$ are taken? I'm also confused why the $max$ function is used and it's para...
I am new to theoretical cs and am working through it slowly. I have completed a simple question and was wondering if my answer is correct or not. Thank you kindly for any feedback. The question is: Given the alphabet $\{a, b\}$ Construct a regular expression that defines the language $M$ containing all words beginning ...
ALL_TM = { TM | A valid TM } This was a question on my exam. As my choice of answer I went with yes, since the set of all Turing Machines is countable, ( you can produce a binary string for each and every new Turing Machine ) my take on the answer that yes it does contain all Turing machines. But apparently my answer ...
This question is sequel from How to understand quantifier without predication " ∀(λφ. (φ x m→ φ y))"? which further explains the notation and context. So - I have anonymous Boolean-valued function F(y)=λx.Φ(x) (of course, y and x point to the same variable, I just used different syntactic names, to point out, that x is...