Using undecidability of the halting problem to show that the function also calls recursively in $2i$ if $i$ halts

Let $ \{P_i|i = 1, 2, . . .\}$ be list of all computable functions. For example, $ P_i$ might be the $ i$ th program and $ P_i(x)$ would be the output given by that program on input $ x$ .

Suppose that there is an algorithm to decide whether or not a given procedure calls itself.

Consider the procedure $ FUNC(x)$ :

PROCEDURE FUNC (INTEGER X);       BEGIN INTEGER 1, J;       I ← X DIV 2;       J ← X MOD 2;       IF J = 0 AND Pi(i) halts THEN FUNC (X + l); END 

How do I use Undecidability to show that $ FUNC(2 ∗ i)$ calls $ FUNC$ recursively if and only if $ P_i(i)$ halts?

Is there a way to add a featured image for the product to show in the product listings, but display another image as the product image?

I want to show a different image of products listing on the home page of the site, not the featured image but when customers click on the products then it should show the featured image on the product page. The site is on woocoommerce is there any way to do this. Thanks

Twitter: Why does it not show to whom the tweet was directed to in my profile?

I don't use Twitter much; so I am still figuring out things, as I go along.

I went into my profile, but nowhere do I see on whose page I had tweeted.

All I see is my name and my handle all the way down. For eg:

Bahala Tharle
@BahalaTharle
·
Nov 29
<Content>

Bahala Tharle
@BahalaTharle
·
Nov 29
<Content>

and so on all the way down (please see attached). Can someone please tell me what I am missing? I would like to see whom I directed the tweets to.

TIA.

Show that SQUARED-SUM-PARTITION is NP-complete

Consider the following problem SQUARED-SUM-PARTITION. You are given positive integers $ x_1, \dots, x_n$ , and numbers $ k$ and $ B$ . You want to know whether it is possible to partition the numbers $ \{ x_i \}$ into $ k$ sets $ S_1, \dots, S_k$ so that the squared sums of the sets add up to at most $ B$ : $ $ \sum_{i=1}^k \left( \sum_{x_j \in S_i} x_j \right)^2 \leq B $ $ Show that this problem is NP-complete.

My solution:

We know that the PARTITION problem (Partition a set of numbers into two sets with equal sum) is NP-complete. Let $ S = \{ x_1, \dots, x_n \}$ be an instance of PARTITION. Let $ T$ be the sum of all elements in $ S$ . Then we construct instance of SQUARED-SUM-PARTITION by setting $ B = (T/2)^2$ and $ k=2$ and $ S$ remains the same. Then there is a solution for this instance of SQUARED-SUM-PARTITION if and only if there is a solution for PARTITION.

Can I check if this solution is correct? Does anyone have other interesting ways to solve this?

CNF2 = { φ | φ is a satisfiable CNF-formula in which each variable appears at most 2 times}. Show CNF2 is in P


CNF2 = { φ | φ is a satisfiable CNF-formula in which each variable appears at most 2 times}. Show CNF2 is in P.

I found this solution:

We use the method of resolution to take the variables out one by one. First, observe that if the variable x appears only as x or only as ¬x in the formula, or if it appears only once, we can satisfy whatever clauses it takes part of and thus exclude x and these clauses. On the other hand, if x and ¬x are both clauses for some variable, we know our formula is not satisfiable. So the interesting case is when we have x in one clause, c+, and ¬x in another, c−, such that (c+, c−) 6= (x, ¬x). Call the remaining part of the formula r. We claim that c+ ∧ c− ∧ r is satisfiable if and only if c ∧ r is satisfiable, where c is the disjunction of all literals from c+ and c− that are not x or ¬x. Indeed, given a satisfying assignment of c+ ∧ c− ∧ r, some literal in either c+ or c− has to be satisfied, because we can’t have both x and ¬x be satisfied. Thus, forgetting the assignment of x, we get a satisfying assignment of c ∧ r. Conversely, given a satisfying assignment of c ∧ r, some literal different from x and ¬x will be satisfied in either c+ or c−; the other one can be satisfied by assigning x in an appropriate way. Thus, we have a procedure to decide satisfiability of a CNF2 formula φ efficiently: reduce the number of variables by the methods described above; if there is no contradiction along the way and you get to the empty formula, then φ is satisfiable. Otherwise, it is not.

Why is there not a control about to check if each variable appears at most 2 times?

Which version of A/B do i show if you happen to get different versions in two instances?

Let’s say I’m doing A/B testing, and this one particular user gets randomly assigned into group B for example. I have a choice right away to either store that on their account in my database, or on their browser. Then tomorrow, that same person visits the website from another device, and randomly gets group A assigned, and sees the A-version of the website. And then, from this new device where they were viewing version A so far, they now sign into their account.

Would it be correct to now load everything B, which has potentially been stored on their account? Or would it be correct to persist the current visit, and keep showing A in this local browser? Or, go so far with persisting the new visit to actually store this new version A onto their account for any further page renders from their first device.

This is all assuming that the different versions of the site differ visually, and significantly, so, what the user expects is therefore quite important.

Show that this language L’ is regular

I’m not even sure where to begin with this. The language given is:

L’ = { x∈Σ* | ∃y∈Σ*, |x|=|y| and xy ∈ L}.

Basically, L’ consists of the first halves of the strings in L, where L is a regular language over an alphabet Σ.

To show that the language is regular, I’m supposed to create a DFA and then modify that into an NFA. But I don’t know how to make a DFSA for this.

Does Juniper have an equivalent of ‘show security pki local-certificate’ for remote certificates?

On a Juniper Firewall, the command show security pki local-certificate will give all sorts of detail for a local certificate. (The sort of certificate you would use to stand up an IKE connection)

My question is, is there an equivalent command for the certificate being used by the remote peer to validate themselves?

Or, is the remote peer’s certificate also considered by Juniper to be a ‘local certificate’, even though it’s for the remote peer?

I can see that there is a command ‘show security ike active-peer’ that can be used to get the security associate details.

And that there’s a command show security ipsec security-associations that gives a lot of details, but not, it appears, the details of the remote certificate (I don’t have access to enough equipment to check for myself, I’m afraid)

The page IKE Policy for Digital Certificates on an ES PIC suggests that it’s possible to assign a name to the remote certificate.

To define the remote certificate name, include the identity statement at the [edit security ike policy ike-peer-address] hierarchy level:

[edit security ike policy ike-peer-address]

identity identity-name;

It’s not clear to me if that name can then be used in the same way that the name of a locally stored certificate can be.

Juniper’s introduction to PKI does talk about a “Remote server local certificate”, which suggests that maybe for some purposes, local doesn’t strictly mean local but also includes “remote local certificates”. (Odd concept.)

Suggestions for show how many days? Passing the International Date Line

Little background Let’s say you fly from the United States to Japan and suppose you leave the United States on Tuesday morning. Because you’re travelling west, the time advances slowly thanks to time zones and the speed at which your aeroplane flies. But as soon as you cross the international dateline, it’s suddenly Wednesday.

Below image from google flight, which is +2 means taking 2days gap. this +2 doesn’t make a sense for me.

enter image description here

Does the Detect Magic spell show a glowing outline around an Invisible Stalker?

We were playing a game, and I had cast Detect Magic to more easily find which coffins to loot. Within the 10 minutes, our party was attacked by an Invisible Stalker. I used my action to try to see the invisible attacker, and the DM allowed him to be shown by an outline. I could yell out to my party to attack him and follow him wherever he ran.

The description of the Detect Magic spell (PHB 231) says:

For the duration, you sense the presence of magic within 30 feet of you. If you sense magic in this way, you can use your action to see a faint aura around any visible creature or object in the area that bears magic, and you learn its school of magic, if any.

The description of the Invisible Stalker (MM 192) says:

When it is defeated or the magic that binds it expires […]

And also:

[…] the magic that created the invisible stalker ends and the elemental is released.

This implies that the stalker is actively bound by magic. I think this was a good call on his part because of the nature of the Invisible Stalker.

If the Invisible Stalker was only invisible, would Detect Magic still show an outline around it?