## Reductions from non decision problems

I want to show a minimization problem $$Y$$ has no approximation factor of 1.36. To be more specific the problem $$Y$$ is the exemplar distance problem between two genomes. Could I reduce from the min vertex cover problem instead of the decision version of the vertex cover problem. The problem I am having with reducing from the decision version is that a vertex cover of size k maps to the $$Y$$ of size $$\leq ck$$, where $$c$$ is a constant. A decision version for problem $$Y$$ for me makes no sense, as there will always be a brekpoint distance between two genomes. I tried to research on the internet but I always only find reductions from decision problems. Could we reduce from non-decision problems.

Also when doing reductions from the vertex cover problem. I can’t assume the given instance $$G,k$$ is such that k is the size of the optimal vertex cover right? $$k$$ is just any size of a Vertex cover.

## In a content security policy header: Should the url’s be quoted or not, and is there any security implication to this decision?

So in a CSP like the below:

content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com

Should the url part be quoted like this (example from mozilla security) – even though this example has both styles:

# Disable unsafe inline/eval and plugins, only load scripts and stylesheets from same origin, fonts from google, # and images from same origin and imgur. Sites should aim for policies like this. Content-Security-Policy: default-src 'none'; font-src 'https://fonts.googleapis.com';              img-src 'self' https://i.imgur.com; object-src 'none'; script-src 'self'; style-src 'self' 

Or unquoted like this:

# Disable unsafe inline/eval, only load resources from same origin except also allow images from imgur # Also disables the execution of plugins Content-Security-Policy: default-src 'self'; img-src 'self' https://i.imgur.com; object-src 'none' 

[1] Examples from here: https://infosec.mozilla.org/guidelines/web_security#content-security-policy

## Black Box Decision problem for NFA

Suppose we are given an NFA $$M$$ that we only know the alphabet $$\Sigma$$ and the size of states $$|Q|$$ but we do not know any other details of the NFA. We want to develop a black box algorithm that can test if $$L(M)=\Sigma^{*}$$. My idea is that we can feed every string up to size $$|\Sigma|^{|Q|-1}$$, if every strings are accepted, then $$L(M)=\Sigma^{*}$$. Since all strings up to size $$|\Sigma|^{|Q|-1}$$ must go through every reachable state in $$M$$, if all of them get accepted then no matter what string is input, it will be accpetted. Am I correct?

## Decision Tree for searching an element in an n*n matrix

I just learnt decision tree concept in class. I have a question for homework. It says to prove that for searching an element in n*n matrix the lower bound is logn and prove it using decision tree.

My question here is using comparison based model, how can we have the lower bound as log n. what if the matrix is unsorted?

## Decidability of decision problems

Can somebody give intuition how to answer those questions? From one side I can say that most of them are undecidable because we can reduce the halting problem to them (or halting problem can appear because we don’t know about given TM anything so it can behave unpredictably, can simply loop on any input), but on another hand in question 2. we don’t know much about machine, however I can hardcore all words into my TM as far as given language is finite. Also, for question 1. I’m able to create TM which checks if the output of M is even-length (I would classify this problem as semi-decidable).

What type of the following decision problems are: decidable, partly decidable, or even undecidable:

1. Does the language of the given machine M contain only even-length words?

2. Does the given M machine accept a finite language size of which is less than 2019?

3. We say that language A is prefixless if no word belonging to A is a prefix of any other word from A. For example, language A = {0, 10, 110, 1110, …} is prefixless, while language B = {0, 1, 00, 11, 000, 111, …} does not have this property (for example, because 0 is the prefix 00). Consider the following language (decision problem): L = {⟨M⟩ | L (M) is prefixless}.

4. Is the given recursive function a surjection?

5. Is the given recursive function an injection?

6. Does the machine M stop at bb?

7. Does the machine M accept the empty language?

## Is using a hyperlink to close a modal a poor design decision?

so I’m having a bit of back and forth with our UX designer who I obviously bow to has superior knowledge of the field. However, part of his design does not sit well with me and I’m unable to swallow it, so I’m seeking opinions from brighter minds than myself.

In essence, we have a sidebar modal appear when a certain button is clicked, this sidebar contains various fields the user can enter text into. When the sidebar is activated, the background is greyed out and clicking anywhere results in no action. At the bottom of this modal, there is a ‘Close’ hyperlink, when clicked, the modal will disappear and not retain any information.

The fact this ‘Close’ is a hyperlink doesn’t sit well with me, to me, a hyperlink means I will be taken somewhere. A button feels more appropriate in this case as I will be returning to my original context. However, as mentioned, I’m perhaps completely outdated in my opinions.

## Breadcrumb history decision

Imagine that we have the following example:

We have a customer that has documents and accounts and we provide two ways to reach the documents or accounts, either from:

MAIN -> CUSTOMER -> Documents -> View Document with ID

MAIN -> CUSTOMER -> Accounts -> View Accounts with ID

and

MAIN -> View all Documents -> View Document with ID

MAIN -> View all Accounts -> View Accounts with ID

My question is, shall we use different breadcrumbs for each view in order for the user to be able to go back to the previous view without using the browser’s back button?

e.g.

Main / Customer / Customer ID / Document / Document ID for the first case and

Main / Document / Document ID for the second case?

Is this correct?

## DDD – how to model an aggregate using data from 2 other aggregates to make a business decision

I’m stumbling trying to find a proper way to model this scenario: I have 3 different aggregates within same Bounded Context:

1. A Student
2. A University
3. A University of Interest

public class Student : Entity, IAggregateRoot {     public string Name { get; }     public string StateAbbreviaiton { get; }     ... }  public class University : Entity, IAggregateRoot {     public string Name { get; }     public string StateAbbreviaiton { get; }     ... }  public class UniveristyOfInterest : Entity, IAggregateRoot {     public Guid StudentId { get; }     public Guid UniversityId { get; }     public ResidencyType ResidencyType { get; }     ... } 

A UniveristyOfInterest is an entity that happens when a student selects a University they are interested in attending. UniveristyOfInterest is an Entity because it will ultimately contain a lot more information about the experience the user could have with the University including financial data, ROI calculations, etc. Each UniveristyOfInterest for a Student will be saved in some repository.

UniveristyOfInterest has an Enumeration called ResidencyType. ResidencyType has 3 possible values: InState, OutState, and Unknown. The business rule is if StateAbbreviation value of Student is same as StateAbbreviation value of University, then ResidencyType is InState, otherwise OutState (assuming we have valid values for both Student and University).

The UniversityOfInterest aggregate must contain the business rules for determining ResidencyType. All of the research I’ve done recommends Aggregates only know of other aggregates based on the aggregates Id value (no references to foreign aggregates). My UniversityOfInterest constructor is passed StudentId and UniversityId. How do I reach back and get their respective StateAbbreviation values so I can properly administer the business rule for determining ResidencyType inside the UniversityOfInterest aggregate?

I thought about also passing stateAbbreviation for both Student and University in constructor of UniversityOfInterest, but that seems klunky.

Any suggestions on how to properly administer business rule determining ResidencyType requiring data from foreign aggregates within the same Bounded Context?

## Terminology: Difference between decision variables, features and attributes?

Could there be a difference between the words “feature”, “attribute”, and “decision variable” when used in the same paper? The one I am specifically thinking about is about an optimization method for clustering, but I am also wondering if there generally are any scenarios for which it could be.

I can’t manage to google up an answer that either confirms or denies that these are the same thing, and I have no formal training in data science.

## Intersection of decision problems?

Say we have two problems $$\Pi_1\in NP$$ and $$\Pi_2\in coNP$$. Where does $$\Pi_1\cap\Pi_2$$ live?