## How to draw tangents to a curve and obtain the corresponding angle?

I’m trying to solve an equation and plot the solutions in the complex plane:

``   Solve[Rationalize[E^(-b (1.365)) + E^(-b (-0.350)) + E^(-b (-0.378)), 0] == 0, b]    ListPlot[ReIm[b /. % /. C[1] -> 0], ImageSize -> Large] ``

Here is the plot:

Now, I need to draw tangent lines on the middle curve at the point where it is crossing the real axis, and obtain the angle. It is possible to do it by hand on the paper, but can one also do it by Mathematica?

## Is it safe to disable SATA ports in the BIOS to isolate the corresponding hard drives from malware?

I have three SATA hard drives that I use every day. Suppose I disable the corresponding SATA ports of these hard drives through my BIOS, add another storage device to my PC, install another instance of Windows 10 and run unsafe executables on it – would my three SATA hard drives be completely isolated and safe?

As I understand it, unmounted partitions are at risk, but not partitions that I exclude by disabling the corresponding SATA ports.

Is this correct?

## NP-Complete problem whose corresponding optimization problem is not NP-Hard

For this question I will refer to$$\ NP-hard$$ problems as those that are at least as hard as$$\ NP-complete$$ problems. That is, a problem$$\ H$$ is$$\ NP-hard$$ if there is an$$\ NP-complete$$ problem$$\ G$$, such that$$\ G$$ is reducible to$$\ H$$ in polynomial time.$$\ NP-hard$$ problems are not restricted to decision problems and are not necessarily in$$\ NP$$.

Considering the above, is there any optimization problem$$\ L$$ such that$$\ L \notin NP-hard$$ and whose corresponding decision problem is$$\ NP-complete$$?

For example, consider the case for the travelling salesman problem. (TSP)

Optimization problem: Given a list of cities and the distances between each pair, what is the shortest path that visits each city and returns to the original city?

Decision problem: Given a list of cities, the distances between each pair and a length$$\ L$$, does there exist a path that visits each city and returns to the original city of length at most$$\ L$$.

It is well known that the decision problem of TSP is$$\ NP-complete$$ and its corresponding optimization problem is$$\ NP-hard$$.

To sum up, what is an example of a$$\ NP-complete$$ problem whose corresponding optimization problem lies outside the class$$\ NP-hard$$? Perhaps, it is$$\ EXPTIME$$.

## Does the increase of a stat also induce the increase of corresponding skill?

If for some reason the EDU stat of a character is increased (for example they get a university diploma during a long downtime period) or (in a less likely event) the DEX stat is altered, does that also impose a change of, respectively, Language (OWN) and Dodge skills?

## Finding corresponding node in a duplicate binary-tree

Given two duplicate binary trees (see the embedded picture), you are given a node in Tree A, find the same corresponding node in Tree B.

I believe the optimal approach should be traversing both trees at the same time, and when you reached the node in Tree A, you would know you have also reached the same node in Tree B.

## I have a list of PDFs on google drive and a website on WordPress, I want to know how can I assign each PDF for its corresponding user automatically

So I have a wordpress site where I want users to be able to log in and find their corresponding PDF file (it’s a certificate) without seeing another user’s files. I generated the certificates on google drive using apps script, so I have a folder that holds every PDF file (certificate) and the name of the file is the ID of the user.

Btw, I have used Elementor and WP login for the user login. I don’t know if I can use whichever or if this is relevant to the question…but I will leave the info here just in case 🙂

Is there a plugin or a way to assign the PDF files to the corresponding user automatically? I have done it manually, but I’m going to have more than 100 users…so it’s not really practical. Thanks!

## Python: Compares elements of each list of lists to corresponding ones in different list

Goal: To reduce processing time significantly (if possible) by making this working code more efficient. Currently 50k row by 105 column data taking about overall 2 hours to process. Share of this piece is 95%.

This piece is a key part of my python 3.6.3 script that compares two set of list of lists element by element regardless of datatype. Spent long hrs but seems I reached my limits in here. Running in Win 10.

“””
Sorry about lots of variables. Here is description:
Ap, Bu – list of lists. Each list within list:
a) may contain any datatype (usually String, Number, Null, Date).
b) 1st element of list within list is always unique string.
c) has equal number of elements as other lists
d) each list in Ap has corresponding list in Bu (if 1st element of a element list of Ap matches that of Bu, that’s considered there is corresponding match)

prx – is index of a list within Ap
urx – corresponding/matching index of a list within Bu, as evidenced by urx=l_urx.index (prx)

cx – is index of an element in a single list of Au ux – is a corresponding element index of an element in a matching list of Bu, as evidenced by ux = l_ux.index(cx)

rng_lenAp – is range(len(Ap))
rng_ls – is range(individual list within Ap)

To visualize (just example):
Ap = [[‘egg’, 12/12/2000, 10, NULL], [‘goog’, 23, 100, 12/12/2000]]
Bu = [[‘goog’, ‘3434’, 100, 12/12/2000], [‘egg’, 12/12/2000, 45, NULL]]

“””

``for prx in rng_lenAp:     urx = l_urx.index (prx)     if Ap[prx][0] == Bu[urx][0]:         for cx in rng_ls:             ux = l_ux.index(cx)             #If not header, non-matching cells get recorded with their current value             if cx!=0 and Ap[prx][cx] != Bu[urx][ux]:                 output[prx].append (str(Ap[prx][cx] + '^' + str(Bu[urx][ux]))             #Unless it is row header or ID in column, matching cells gets 'ok'             elif cx!=0 and prx!=0 and urx !=0 and Ap[prx][cx] == Bu[urx][ux]:                 output[prx].append ('ok' +'^' + 'ok')             # Anything else gets recorded with their current value             else:                  output[prx].append (str(Ap[prx][cx] + '^' + str(Bu[urx][ux])) ``

There must a way to reduce processing time drastically. Currently it is taking cell by cell comparison of 50k row by 100 column data to 50k row by 100 column data about 2 hrs. Expected under 30 min. 3.1 Ghz, 4 cpu (8196MB RAM).

## Count unique values in second column corresponding to unique value in first column

I have a Google sheet with cities corresponding to countries like this. Notice that neither countries nor cities are unique and there can be duplicates.

``|    A    |      B     | ------------------------ | UK      | London     | | UK      | Manchester | | UK      | Manchester | | UK      | Birmigham  | | Ireland | Dublin     | | Norway  | Oslo       | | Norway  | Trondheim  | ``

Now I want to count the number of unique cities for each unique country. The result should look like this.

``|    C    | D | --------------- | UK      | 3 | | Ireland | 1 | | Norway  | 2 | ``

I got column `C` using `UNIQUE(A1:A)`. But how do I get column `D`?

## Given a randomised algorithm for a problem, is there a corresponding deterministic algorithm?

Does every randomised algorithm have a corresponding deterministic algorithm solving the same problem?

I’m going to guess that the deterministic algorithm will take more time, while the randomised algorithm although it has errors will generally be faster. This is from what I have seen of them so far. Let me know if this is wrong.