Help understanding a theorem Kleinberg proves related to sequence alignment

This is from Kleinberg’s Algorithm Design text (Theorem 6.14)

Let $ M$ be an alignment of $ X$ and $ Y$ . If $ (m, n) \notin M$ , then either the $ m^{\text{th}}$ position of $ X$ or the $ n^{\text{th}}$ position of $ Y$ is not matched in $ Y$ .

The theorem does not state that $ m, n$ must be the last elements of $ X$ and $ Y$ respectively, but earlier, when introducing the topic, he uses $ m, n$ to denote the last entries of the two strings. Which of these is correct?

Unrelated applications like games accessing ‘webcache’ related files

As title suggests im wondering if a game ,for example, has any business accessing ‘webcache_counters’.

After attempting to clean my webcachev01 file due to its oddly large filesize given the fact i dont use IE or Microsoft Edge at all, I noticed in processexplorer that alot of my random applications were accessing a file with the suffix ‘webcache_counters’ followed by a string of numbers I’d imagine to be a registry key.

Strange thing about this handle is that i cant view its properties nor close the handle. With the first saying that it is ‘Unable to query’ and the latter saying i lack administrative rights. To clarify I am the sole user and administrator on this machine.

All this is having me increasingly worried, ive been having recent fears of malware on my PC and this has appeared in my rigourous inquiry of my files and processes. How can an innocuous sounding file/handle bar me from even closing it in process explorer?

Create dynamic sql query to select all related data in DB based on entry table and ID

Hope all is well. I am hoping you can help me.

Problem Statement – I’m tasked to create a dynamic SQL statement which will select all related data from a given table where the Identifier is passed. For each table where the relevant data is found i would like the data to be exported onto a separate tab of within excel

If i was doing this manually done this i would perform the following queries and export the data onto each tab;

Select * from  Mason where id = 12345 Select * from  MasonContacts where Companyid= 12345  Select * from  MasonOpportunities  where Comid = 12345  

However given the sheer volume of tables this isn’t viable.

Step 1 : Type in my identifier (in this case my identifier is a field called "Id" in the Table "Mason") The query will always start from this table.

Table Name : Mason Field : Id = "12345"

Step 2 : Search against table "MasonContacts", search against the field "Companyid". Return all columns & records where the field "Companyid = 12345"

Table Name : MasonContacts Field : Companyid

Step 3 : Search against table "Mason Opportunities ", search against the field "Comid". Return all columns & records where the field "Company = 12345"

Table Name : MasonOpportunities Field : Comid

Looking forward to your help

Spam Mail Related to my Browsing

I was searching google to find a good printer to buy. To my horror, the next day I got a spam mail with theme "Print smarter at low price". Is this a coincidence or is my PC breached? What should I do? No alerts from Anti-Virus. Or can that webpage I opened install some malware? I didn’t click on anything there.

Databases and B-Trees: What are Keys and how are they related

I confused about the description & definition of "key" occuring as terminology for databases and b-trees.

In first case dealing with theory of databases a key is defined as a choice for a in certain sense minimal (see below) subset $ K \subset A := \{A_1,A_2,…,A_n\}$ of a fixed set of attributes $ A_i$ parametrizing a data table (consisting of relations; a single relation is abstraction of a row in the table), where each attribute is literally a column specifying a property of objects = relations.

A key is characterized by property that there exist no two different relations (a relation is a row) which have exactly the same values for all attributes which belong to the key. And a key is a minimal subset with this property, ie there not exist a proper smaller subset of attributes contained in the key and having the property described in last sentence. Clearly keys are not unique. So the set of a keys is certain subset of the power set of the set attributes $ A_i$ . See also here:

On the other hand the key concept occures as well for b-trees:

Here keys are a priori numbers or integers and different knots of b-tree contain different totally ordered subsets of keys where the total order on the space of keys is inherited from the order "$ \ge$ " for integers $ \mathbb{Z}$ . Especially the set of keys is a totally ordered subset of integers.

Question: How are the two concept of ‘key’ related to each other? My first idea was that if we consider in light of for definition (as elements of power set of attributes), we can simply randomly enumerate all the keys (that is associate to each key an number; formally speaking to specify an injection $ f:\mathcal{K} \to \mathbb{Z}, K \mapsto f(K)$ where $ \mathcal{K} \subset \Omega(A)$ )

and then treat them as numbers when working with b-trees. Is this exactly the correct connection or is there another deeper one and my approach is wrong?

Help with performance and speed-up question related to number of cores and their areas

There is a question in my exam that said:

Consider the following three processors (x, y, and z) that are all of varying areas. Assume that the single-thread performance of a core increases with the square root of its area.

  1. Processor X, core area = A

  2. Processor Y, core area = 4A

  3. Processor Z, core area = 16A

You are given a workload where S fraction of its work is serial and 1 – S of its work is infinitely parallelizable.

a. If executed on a die composed of 16 Processor X’s, what value of S would give a speedup of 4 over the performance of the workload on just Processor X?

b. Given a homogenous die of area 16A, which of the three processors would you use on your die to achieve maximal speedup? What is the speedup over just a single Processor X? Assume the same work load as in part b.

My progress with this part so far:

In an area of 16A, 4 cores of Y would fit. The square root of its area is $ 2\sqrt{A}$ , which each of the four cores’ performance would increase by a factor of two? Using Amdahl’s law,

Overall speed-up for this choice $ =\dfrac{1}{\dfrac{1 – S}{4(2)?} + S}$

And likewise, the overall speed-up for choosing 1 core of Z $ =\dfrac{1}{\dfrac{1 – S}{1(4)?} + S}$

I am assuming that 1 core of area 4A is like 2 cores of area A, is this a valid assumption? For S = 0.2, 4 cores of Y would yield a higher speedup than one core of Z. Is this reasoning correct?

Operating systems memory management: help understanding a question related to segmentation

There is this question in my textbook (Operating Systems: Internals and Design Principles by William Stallings):

Write the binary translation of the logical address 0011000000110011 under the following hypothetical memory management schemes, and explain your answer:

a. A paging system with a 512-address page size, using a page table in which the frame number happens to be half of the page number.

b. A segmentation system with a 2K-address maximum segment size, using a segment table in which bases happen to be regularly placed at real addresses: segment# + 20 + offset + 4,096.

I am having trouble with understanding part b. I’m not a native English speaker. Initially, I assumed that “using a segment table in which bases happen to be regularly placed at real addresses” means that the segment number in the logical address is the number of the physical segment, but then I read this “segment# + 20 + offset + 4,096”, and I am not sure what to make of it. So does this mean that the base number in the segment table contains segment# (in the logical address) + 20 + offset (in the logical address) + 4,096?

Problem related to set partitioning

Let $ A_j=\{(a^i_j,b^i_j)~:~ 0 \leq i \leq n,\text{and } a^i_j,b^i_j \in \mathbb{Z}^+\}$

Given sets $ A_1,\ldots, A_{p}$ and a positive integer $ k$ , the problem is to check whether there exists one element $ (a^{i_j}_j,b^{i_j}_j)$ from each $ A_j$ such that $ \sum_{j}^{} a^{i_j}_j \geq k$ and $ \sum_{j}^{} b^{i_j}_j \geq k$ .

It looks like the problem is related to set partitioning problem, however, I am not sure how to get a reduction from set partitioning problem. Can someone help me to find the algorithm to solve this problem?