instruction
stringlengths
35
29.1k
Many text books state that for a binary floating point representation in a computer byte, that if the mantissa is normalised, then a positive number must start with 01 from the left or a negative number with 10 from the left.This is nothing to do with IEEE standard but a common statement in English A level computing b...
From low OS-level function calls, to memory allocated to an application, all will primarily take a stack to perform LIFO operations. Why don't we use queues and FIFO operations? It's just a matter of moving pointers anyway.
If you have byte addressable memory, does it matter if you have a 32 bit or 64 bit databus for the range of the memory addresses for the words of the memory? E.g. : Assume a 32-bit word. If you have a processor connected to a byte addressable $2^{32}$ byte memory, Would the address of the lowest word be 0 and the addr...
In "TILING SIMPLY CONNECTED REGIONS WITH RECTANGLES" by Igor Pak and Jed Yang, they show there is a set of "no more than $10^6$ rectangles" such that the problem of tiling an arbitrary simply connected region with these rectangle shapes is NP-complete. However the number of rectangle shapes $10^6$ seems pretty extreme....
I see the two used interchangeably. Is one the subset of the other or are they both the same thing?
I am studying cryptography and having some trouble with the PRFs How do I show that $f_{k}(x) =x+k^2$ mod $2^n$ is not a Psuedo Random function? I know that I need to show that the distignuisher can tell this is not random with a better then $\frac{1}{2}$ probability but how would it do that? (I don't just want an al...
A simple counting argument shows most strings can't be compressed to shorter strings. But, compression is usually defined using Kolmogorov complexity. A string is compressible if its Kolmogorov complexity is less than its length, $K(s) < |s|$. The Kolmogorov complexity of a string is defined as the size of the smallest...
I am trying to build models of consumer behavior (especially investigating the impact of advertising on purchase decisions) using multi agent systems but I wonder are there already available some open source models? I checked available models in the model libraries of the most popular MAS simulation tools (NetLogo, Rep...
I did a research project in which I seek to move a car through zones from origin to destination. This allows for the formulation of a bipartite graph because only adjacent zones can be connected. Each edge has a non-negative weight of time. I look to find the shortest path between source and sink, given the weights and...
I have this problem: I'm building an integer linear program, which I'm going to give to an ILP solver. I have a binary variable Y which can be either 1 or 0 and an integer variable MONTH which takes integer values 1-12. I have to give restrictions such that Y = 1 if MONTH = 1, and Y = 0 otherwise. I don't know how to...
What is the difference between complexity theory and computability theory? Is there any overlap between the two or are they completely different? Or is one a subset of the other?
In Elementary Cellular Automata, rules can show one pattern, but i am wondering if there is something where a cellular automata structure can simulate another structure? Is there a category for this in Cellular Automata?
This was asked in the (very) recently concluded Hackerrank Worldcup. Paraphrased: Given a permutation $a$ of integers from $1$ to $N$, how can I minimize the number of inversions by a single swap of any two integers? An inversion is a pair of indices $(i, j)$ such that $i < j$ but $a[i] > a[j]$. I think that t...
The classic knapsack problem is maximize $P^T X$ subject to $W^T X\le M$ for $P, W\in \mathbb{R}^d$ and $M\in \mathbb{R}$ and $X\in \{0, 1\}^d$. Is there any research into algorithms that find the top $X_1, X_2, \cdots X_N$ such that $P_T X_1$, $P^T X_2, \cdots, P^T X_N$ are the top $N$ possible knapsack values subject...
I first constructed a symmetric matrix as the Laplacian operator, and its eigenvectors are a series of harmonics functions as expected. I programmed it and convinced myself. The matrix looks like: $$ \left(\begin{array}{ccc} 1& -1 & 0 & 0 & 0 \\ -1& 2 & -1 & 0 & 0 \\ 0& -1 & 2 & -1 & 0 \\ 0& 0 & -1 & 2 & -1 \\ 0& 0 & 0...
I'm working on a research about Elementary Cellular Automata (ECA), and i found a method to build a system that can solve mathematical equations by using a specific cellular automaton structure. The system is about encoding the equation into numbers and by applying some rules, these numbers are transferred to a Cellula...
I have a grid that shows the world and its coastlines. An excerpt from the area around the UK is shown here From an arbitrary origin point anywhere in the ocean, I want to find those coastline points that are in line of sight of the origin without having to cross another coastline point. For example, if the origin is ...
The proof for the $\Omega(n\log n)$ lower bound for calculating the convex hull by using order-type predicates that I have come across uses the fact that if there was possible to calculate the convex hull in time better than this, then we could do sorting using the same technique, but as it is known that sorting has an...
I know this is a very common question. But I have a different angle in my mind. I will just try to articulate it here. From what I know, every instruction that a CPU executes, is in machine language and all CPU can do is do some arithmetic operations thanks to ALU and to its transistors (if we go at hardware level). Ho...
I was wondering: is there an algorithm to decompose any regular expression, provided it doesn't use complementation, into one or more regular expressions which don't use Kleene star (only catenation and union). Right now I'm reading On the Decomposition of Finite Languages by A. Mateescu, A. Salomaa and S. Yu, but this...
This is just a question for fun and specifically for those who have read the reference pervasively. I have been reading the work of Knuth's The Art of Computer Programming and struggling and having a lot of fun with its exercises. I was very impressed that Fermat's Last Theorem had a difficulty of 45 in Knuth's difficu...
I am trying to put things in places on the use of Hamming Distance (HD) in error detection and correction in Computer Networks. I'm looking for correction/verification on the following: HD is a measure of how well the error-detection/correction can/did perform. It is not an error detection or correction method by its...
I was looking at the following wikipedia article on the RP complexity class: https://en.wikipedia.org/wiki/RP_(complexity) In its definition it states: If the correct answer is NO then it always returns NO If the correct answer is YES then it returns YES with a probability of 1/2 At the end of the introduction it say...
hi I'm having difficulty in Designing a DFA binary string with exactly 2 occurrences of 010?
I'm trying to figure out a variation to the knapsack problem. The major difference is all objects have a type. For an example we can call them type A, B, C, D, and E. In addition to this we have to have a specific amount of each type. For example get the most value in the knapsack as possible while using 1 item of ...
It is given graph. It isn't ordinary graph, it is ladder. We say that our ladder has order $n$, because of number of nodes. Look at picture: My problem is: Let's start DFS on node number $1$. How many different DFS tree exist? From my point of view I should count number of possible adjency lists. For example, for ...
The problem of finding a solution for functional equations can be defined as: Let $A_0, A_1, A_2, \dots, A_n, B_0, B_1, B_2, \dots, B_n, X$ be terms of the $\lambda$-calculus, where all terms are known except for $X$. Given a set of $N$ equations in the form $X A_n \to B_n$ (that is, $X$ applied to $A_n$ strongly norm...
I am reading an article on algorithms for parallel computing and came across the following sentence. What do they mean by a swap-with-memory instruction? Our algorithm provides reasonable latency in the absence of contention, requires only a constant amount of space per lock, and requires no hardware support other th...
Suppose $\varphi: X \rightarrow Y$ is a function between feature spaces that I want to model. I want to produce two easily computable functions $\phi_X: X \rightarrow \mathbb{R}^m$ and $\phi_Y: Y \rightarrow \mathbb{R}^n$ so the distance $|\phi_X(x) - \phi_X(x')|$ for $x, x'$ in $X$ is correlated as well as possible wi...
If I have a DFA with only one state that is not an accept state, it accepts only the empty set. I get confused when if the DFA of one state is an accept state. Does this mean it accepts everything? Or could you have it only accept "a" and not "b". I guess I don't understand if not having an arrow out implies there is a...
I come across this definition but it's not so clear for me ! An array is partially sorted if the number of inversions is less or equal a constant times the array length. if array length is N then (number of inversions) <= c*N, with c constant. For me c should be <= 1 is this what they meant ? For more context : i...
Is there any possibility of improvement in the result of count-min-sketch algorithm if we will use Map Reduce approach? Improvement in performance can be in terms of accuracy, time complexity or the work done needed.
How does one compute the simplified form of a rational function where the coefficients of the polynomial are floating point numbers (real, though I expect using complex numbers would be the same). Wikipedia says it is possible using SVD, but I'm unsure about how to represent the polynomial so as to do use this.
I am currently working on an integer lattice problem, called the "most similar vector problem," and wondering if can be solved correctly by a simple "zig-zagging" algorithm. Given a real vector $u \in \mathbb{R}^n$, the most similar vector problem is to find a discrete vector $v$ from a bounded integer lattice $L \in \...
Suppose I have a video in which there are two objects $A$ and $B$. Object $A$ appears suddenly at time $Ta1$, and then disappears suddenly at time $Ta2$. Object $B$ appears suddenly at time $Tb1$, and then starts to fade gradually at time $Tb2$, and at $Tb3$ the object $B$ completely fades away. The background intensit...
If we take Solomonoff's prior $m$, defined here and normalize it we get a probability mass function on all finite words. But, the pmf isn't completely determined until we fix a universal Turing machine (UTM) $U$. Say $m_U$ is the normalized prior with respect to a UTM $U$. Is there a $U$ such that $m_U$ has maximum ent...
Obviously binary trees are great because of $O(\log_2 n)$ search, inserts, and deletes in best case. To "maximize" occurrence of best case, we can use self-balancing trees like red-black trees, AVLs, splay trees, etc. If we use a $k$-ary tree, we can get $O(\log_k n)$ searches, inserts, and deletes in best case. Simila...
Fix an alphabet $\Sigma$, and a set of words, $W = \{w_1,\dots,w_n\} \subseteq \Sigma^*$. I have a randomized model that works like this: Alice generates a random sequence of words, using some probability distribution over the words, and then I get to see their concatenation -- but I don't see where the word boundaries...
In RL, in a game situation, usually the agent is trained by playing against itself. When we should not depend on this self-training, and switch to train the agent with a real or different player agent other than the agent it self? I mean is there any characteristics of the environment that would make self-play worse c...
I have some questions about something that I'm working on in an assignment for my database class. Here is the schema for the questions I'm working on, so that you know what to refer to: Category(class, function, country, num_guns, max_altitude, max_fuel) Planes(pname, class, year) DogFights(dname, date) Outcomes(pname,...
I came across this paper which gives bounds on coupon colloector problem. Page 451 contains a table where reference to U1 is given as 'folklore'. I presume this is trivial to follow from the definition but I can't see the logic behind this. Does anyone have hints for me? I tried to get this bound by taking the limit of...
I'm wondering if there is a standard corpus that people use to evaluate their part-of-speech taggers. I am implementing my own tagger, and would like a meaningful way to measure its performance, which would ideally be against the same corpuses that other people are using.
Given an two sorted arrays X and Y, both of size n. Determine if there is an element x of X and an element y of Y such that x = 3y. The algorithm needs to run in linear time in the worst case. At the moment, the algorithm runs in O(n^2). I am unsure how to leverage the fact that the algorithm is sorted to have a scena...
I have the following problem, and I want to show that it is NP-hard (or NP-complete). Consider a clause which can have OR and XOR relationship between literals, e.g. $c_1=y_1 \lor y_2 \lor (y_3\oplus y_4)$. Will the assignment of literals such that the equation given by the conjunction of such clauses, e.g. $c_1\wedge ...
A zero-knowledge proof system for a language $L$ is an interactive proof system where a prover $P$ (a Turing machine) tries to convince a verifier $V$ (a polynomially bounded Turing machine) in a sequence of message exchanges that $x \in L$ so that $V$ learns nothing from the interaction except whether $x \in L$ or not...
I've recently read a really interesting blog entry from Google Research Blog talking about neural network. Basically they use this neural networks for solving various problems like image recognition. They use genetic algorithms to "evolve" the weights of the axons. So basically my idea is the following. If I was suppo...
The Computer Science text book I own describes how an interrupt is handled in an operating system: At some point at the end of an instruction the processor checks if there are any outstanding interrupts If there are, the priority of the present task is compared with the highest priority interrupt If there is a higher ...
I wrote a custom hash table for a project I'm working on. The core functionality was pretty simple rolling table: In each table there is a memory section for HashItemReference(integer SecondHash, integer ItemN) which is the actual table part and a list of HashItem(integer Value, string Key) Each HashItemReference woul...
I just had a course on algorithm, we just started to study graph traversal. the teacher wrote analgorithm but I think there is a mistake: I'm a bit shy so I didn't asked her why so... EXPLORE (s:sommet, D:dictionnary of the following vertexes or ahed of vertexes, var visited:tab) var: LIST:list; i,j: vertexes; visited[...
I'm new here, so I apologize if this is not the appropriate place to ask this question. I just started a graduate level course on approximate algorithms, and I am falling behind fast. The class is very theoretical and we are asked to prove approximation problems. We've covered traveling salesman problems, greedy algori...
I have a finite alphabet Σ and Σ* refers to the set of all finite strings over Σ. 1) Given x, y ∈ Σ* we say that x is a prefix of y if ∃z ∈ Σ* y = xz. If x is a prefix of y and y is a prefix of x what is the relationship between x and y? I'm assuming it is a direct relationship because as x goes up so does y, but I'm n...
Ok, lets assume we have sequence of 1000 bytes. So the possible number of value variations is 2^100. Is there a way to "index" each variation with letters and decimal numbers (A-Z, 0-9), having as shortest length as possible? So the person can dictate sequence of letters and numbers by phone and it can be recreated...
(7,4) Hamming Code (HC) detects all 2-bit errors and corrects all 1-bit errors. However, there can be 2-, 3- or 4-bit errors that come with the same parity bits as that of 1-bit errors. Eg.: Let the data be $1011$. So - the parity bits are $P_1=0$ $P_2=1$ $P_4=0$ , the message transmitted is $0110011$ and the messag...
I am studying Crypto and am trying to understand why discrete log creates is useful for creating a PRG. More specifically, I want to prove via reduction that $B(x)=(x<p/2)$ is a hardcore bit for the one-way function $f_{p,g}(x)=g^x \bmod p$. So far, I have shown that if there is a polynomial-time algorithm $D$ that co...
I have implemented N-grams by constructing a tree (or a trie, technically) that stores frequencies of each N-gram. Each path in the tree represents an N-gram and its frequency: the path consists of N nodes (each node containing a word), followed by a leaf node containing the frequency. So, each path in the tree is of l...
Problem: Given an undirected, weighted, complete graph $G = (V, E, w, c)$. $w$ is the time weight function on edges, $w:E \to \mathbb{N}^{+}$; $w(e)$ represents the time it takes to travel along edge $e$. $c$ is the time deadline function on vertices, $c:V \to \mathbb{N}^{+}$. Given a source vertex $s$, the question is...
int R(int n) { if(n<=1) return 1; else { int sum=0; for(int i=1;i<=n;i=i*2) for(j=1;j<=i;j=j*2){ sum=sum+i; sum=sum*R(n/2); } } return sum; } I try to explain T(1) = 1 T(2) = 2 T(4) = 6 T(8) = 36 T(16) = 360 T(32) = 5400 so, the gr...
I have written an in-place merge algorithm for forward iterators. My goal was to write an in-place merge algorithm to merge two sorted parts of a singly linked list without allocating extra memory to perform the merge. However, I have no clue how to determine its complexity. Here is the corresponding pseudocode algorit...
I was recently looking at the article on the P complexity class on Wikipedia. In the section on relationships to other classes, it mentions that P is known to be at least as large as L, giving this explanation: A decider using $O(\log n)$ space cannot use more than $2^{O(\log n)} = n^{O(1)}$ time. The article sadly f...
If $\mathbf{P} = \mathbf{NP}$, then is $\mathbf{L} = \mathbf{NL}$? I am asking this question because, for other non-deterministic classes, it seems $\mathbf{P} = \mathbf{NP}$ always establishes that they are equal to their deterministic counterparts.
Consider the non-regular language $L_1$ = {$a^n$b$a^n$: $n \geq 0$} and its super-set language L = Language of strings with equal number of trailing and leading a's, or in other words, $$L = \{a^n b w b a^n : n \ge 0, w \in \{a,b\}^*\} \cup \{a^n b a^n : n \ge 0\}.$$ How would we prove that L is also non-regular? I h...
Given a finite alphabet, there are well-specified formal languages that can not be recognized by regular expressions, FSAs or regular grammars True/False I am studying for my exam and I am unsure about this question. From my understanding, you generate formal languages from regex, FSA. For i.e. for a* our formal ...
If we have a computational function $f(x)=g(f(x-1)^2)$, where $g(y)$ is a floating point operation, mapped onto a given number of bits say 32 bits (thus leading to loss of a given number of precision bits every time), is the function a one-way function?
Can someone explain the working of the GHS algorithm using the graph given below. GHS is a distributed algorithm for finding the Minimum Spanning tree of a graph. The description of which can be found here https://en.wikipedia.org/wiki/Distributed_minimum_spanning_tree What I think is that the fragments(the nodes in a...
Knuth, Donald E. (1971), "Optimum binary search trees", Acta Informatica 1 (1): 14–25,doi:10.1007/BF00264289 Please have a look at this paper, specifically page 18 in which he tries to prove his lemma that $R_{0,n-1} \leq R_{0,n} $ here $R$ refers to the minimal optimal node which will be the root of the binary tree co...
From what I have found, a very large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS, IRC. In fact, some of these protocols jump through some hoops whenever they ...
I am taking a course in algorithm analysis and the professor is arguing that using the negation of the definition for Big O, it can be argued that, for practical computing purposes, both the running time and the memory usage of every algorithm is O(1). How is this possible? How can it be proven?
I'm learning about paging. My book says that the logical addresses generated by the CPU are in the form |p|d|(page number, page offset) and the physical addresses are in the form |f|d|(frame number, frame offset). It is also specifically mentioned that d i.e. the offset is copied directly to generate the physical addre...
Here i want to discuss about Linear Voronoi game. The game consists of two players, and a finite set of users placed along a line. Each player has 2m facilities, where m>0 is a fixed integer. The game starts by the first player, placing 2 facilities on the line, followed by which the second player places 2 facilities...
We usually see examples of languages contained in $P^A$ for some language $A$, or cases where $P^A=P^B$ (or $P^A\subseteq P^B$) for two languages $P^A$ and $P^B$. However, there is any explicit example of two languages $A$ and $B$ such that $P^A\not\subseteq P^B$ and $P^A\not\supseteq P^B$? I was thinking in something ...
The following theorem is (in the context of languages) known as Arden's Lemma: Given a linear system $X = B+AX$ and the matrix A is quasiregular, then we have a solution which is unique and which preserves rationality. In the next lemma we show the converse: For every rational series we can find a linear syste...
I know that we can have 0 accepting states in a DFA, it would just recognize the empty language. What about the case of all states being accepting? Would that mean it would recognize all of the strings in the DFA's particular alphabet? Thanks
Given a set of irregular polygons with the same number of points, where $polygon_i$ is completely contained within the boundary of $polygon_{(i+1)} $. I need to find a set of vertices (one vertex from each polygon) such that the pairwise distances between all of the points selected are maximized. What kind of algorithm...
I'm stumped on what exactly to search for; so here is a non-scientists description of the topic. I've got multiple sensors of different types that are measuring the same physical value in different ways. The sensors are all subject to significant error or temporary unavailability, but in greatly different ways. I want ...
I designed this transition graph, seen below. The alphabet contains {a, b, c}, and the goal of this machine is to accept any strings (no limitations on length of string) that ends with a letter that is already in that string. Example: abba, aaa, bb, ababababacc, cabc are accepted. Example: abc, bccba, a, b, c, cccab,...
So I was able to show that: $\log(n!) = O(n\log n)$ without any problems. My question is when trying to prove that $\log (n!) = \Omega(n\log n)$. I was able to show that: $$\begin{align*} \log n! &= \log(1 \cdot 2 \cdot 3 \cdots n )\\ &= \log 1 + \log2 + \log3 + \dots + \log n \\ &= \log 1 + \dots + \log\tfrac{n}...
In this essay (and others) by Djikstra, he refers to "formal techniques" a number of times. ... for the computing scientist, formal techniques would play a much more important rôle than they had done so far for the mathematician. ... The practical reason was that formal techniques are indispensable for dealing in a su...
I am trying to find a way to compare two real numbers (actually floating-point) with a tolerance, i.e. test $|r-s|\le\epsilon$. Without loss of generality, $\epsilon=1$. I want to do this by replacing the numbers by a discrete key computed on them in such a way that when two keys differ, they map two significantly dist...
I am reading the paper Measuring the hardness of SAT instances by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (PDF) and I would like to know what the square symbol in the following means Lemma 3 The space satisfies the following three properties: $s(\Gamma \cup \{\Box\})$ = 0 For...
Take for example the following sentence: Computing a hash for a message is "easy"; retrieving the message from the hash is "hard". Intuitively, I can perfectly understand what's written there. But, in mathematical terms, when is a problem considered hard and when is it considered easy? I know that easy/hard should no...
I'm totally new to DFA's and automata in general – this is the first week or two of class that I've actually seen this – and I'm curious as to a pattern to match the following: "Match the set of all strings on the alphabet $\{a, b\}$ that have at most two $b$'s and 1 or more $a$'s."
The problem is to select the minimum number of nodes from a graph such that, the selected nodes and their neighbors consists of all the nodes of the graph. Any straight forward algorithm for this? Repeatedly selecting the node with highest degree centrality doesn't work. Thank you.
I'm trying to find out how many circuits exist in a graph $G$, given its adjacency matrix. Yet, the only thing I know is how to find out if there is a circuit in a graph $G(X,U)$ given a list of out-neighbours for each vertex. To do that, you just delete every vertex with no out-neighbours, and update the adjacency li...
According to CLRS, When the edges of the graph are static—not changing over time—we can compute the connected components faster by using depth-first search. However, I tried to do some runtime analysis, and in a graph $G(V, E)$ on which we have to answer $Q$ connectivity queries. DFS would take $O(V+E)$ asymptotic ...
I know that, in imperative programming languages, a while-do loop is sufficient as a control flow construct to make the language Turing-complete (as far as control flow goes - of course we also need unbounded memory and certain operators...). The gist of my question is: does a do-while loop have the same computational ...
From what I understood, the Active Shape Model (ASM) is used in facial recognition. I figured out how the ASM works but I don't get why we use it. How this shape is suppose to be interpreted for facial recognition? Should it be compared directly to the database? I have read many research papers about ASM and facial rec...
I was given in a lecture the following algorithm that wwas said to be a graph-traversal algorithm. The algorithm given during the lecture The algorithm EXPLORE (s:sommet, D:list of the following vertices of the vertices ahead, var visited:tab) var: LIST:list; i,j: vertexes; visited[s]←_true_; LIST←{s} While LISTE ≠ ...
I am reading the paper Measuring the hardness of SAT instances by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (PDF).I have two questions the first one is I would like to undersatnd the demonstration for the last claim. Specifically I need an example of the proof tree of $[x\rightar...
This might seem very simple but it's been giving me lots of headaches. For example if I run f(12345) the result is 5310135. I understand why it would return 5310, the rest of 135 is what is giving me troubles. Sorry if the question sounds dumb, I am a newbie seeking for help:). function f (integer n) { print n%10; ...
I have a matrix of logicals (TRUE, FALSE) and I need to count the number of rows that contain only TRUE values. My current algorithm: For every row: initialize counter reduce each col by + (take the sum of all the values in that row) if the result from 1. == the number of total columns, increment counter. Is there a ...
I need to extract all tree-like refutations of this formula $$(a+b)(a+ b')(a'+c)(a'+c')\,.$$ I get understand this one but how do I get the other ones?
I have something of this kind: $$(n-1) d m + m + 2m*v+2v^2 + v$$ Where all n,d,m,v are variables. My little knowledge of computational complexity leads to do this kind of approximation: $$ O( (n-1) d m + mv + v^2 )$$ However I feel I could further simplify into $$ O( n d m + mv + v^2 )$$ and $$ O( n d m + v^2 )$$ hence...
Is 17x+11 a function of O(x^2)? My steps so far: 17x+11 < c.x^2 where x>k 17x+11/x^2 < C Im not too sure what to do next so I'd really appreciate if it someone could guide me. This question was not answered. The link that was provided exceeds what we have to know to solve this problem.
I am confused in finding RAW dependencies whether we have to find only in adjacent instructions or non-adjacent also. consider the following assembly code I1: ADD R1 , R2, R2; I2: ADD R3, R2, R1; I3: SUB R4, R1 , R5; I4: ADD R3, R3, R4; FIND THE NUMBER OF READ AFTER WRITE(RAW) DEPENDENCIES IN THE Above Code. I am get...
I am stuck on trying to understand how to solve the following question. Could someone please explain for a beginner to average-case analysis? Considering the following algorithm A which takes as input a bit string b = b_1, b_2, ... , b_n (each b_i is either 0 or 1) and does the following: A(b,n) k = 0 FOR i = 1 TO n DO...
Given a $n \times m$ grid $G$, with each grid square having a value 0 or 1, find a rectangle $R$ in $G$ that maximizes $R_1 - R_0$, where $R_0,R_1$ are defined as follows: $R_0$ = the total number of 0's in $R$ $R_1$ = the total number of 1's in $R$ The brute force solution is to compute the value $(R_1 - R_0)$ for ...
. Imagine two disks on the xy plane. Each disk is represented by three numbers (the radius, the x coordinate of the center and the y coordinate of the center). All values for this problem are real numbers. Your task is to determine if the two disks intersect.
I want to do image segmentation. In (Li, C. et al, 2011) article about A Level Set Method for Image Segmentation I saw that the authors use bias field estimation. I searched a lot but I couldn't understand the meaning of bias field...What is the appropriate mean of bias field?
Consider the following algorithmic task: Input: a positive integer $n$, along with its prime factorization Find: positive integers $x,y,z$ that minimize $xy+yz+xz$, subject to the restriction that $xyz=n$ What is the complexity of this problem? Is there a polynomial-time algorithm? Is it NP-hard? This problem basica...
Say I have the interprocedural control flow graph (ICFG) of a program. Now I am only interested in the control flow between two functions f1 and f2. What is the most straight-forward way to remove the non-relevant part of the ICFG? Is there a standard performance-optimized algorithm for this task? Does the result, tha...