How to compute the convex hull in linear time of the number of points on it?

I must construct 2 functions. The first function is used to add a point passed to it to an arraylist. The second function must take this arraylist, find out the set of points that lie on the convex hull formed from them, and return a linked list of those points.

How can I achieve this in a O(h) time (worst case), given that h is the number of points on the convex hull, NOT n which is the number of points originally present in the arraylist.

The two functions can have different worst case running time but most importantly, non should have a worst case that takes more than O(h).

I made it to O(n), not further though!

Polynomial-time Compute the Number of States resulting from the NFA to DFA (greedy) conversion?

The canonical NFA to DFA conversion, starting with an NFA with $ n$ states, can result in a DFA with $ 2^n$ states. However, in many cases, there are states that are “unnecessary,” such as when minimizing the resulting DFA.

I am interested in the following question: if we have an NFA with $ n$ states and $ q$ symbols, is there a $ \mathrm{poly}(n, q)$ -time algorithm to output the number of states that the standard conversion (and minimizing, if possible) to a DFA would produce? Note that producing the DFA itself can take exponential time.

Compute cache miss rate for the given code

Problem Description:

We consider a 128-byte data cache that is 2-way associative ($ E=2$ ) and can hold 4 doubles in every cache line. A double is assumed to require 8 bytes.

For the below code we assume a cold cache. Further, we consider an array A of 32 doubles that are cache aligned (that is, $ A[0]$ is loaded into the first slot of a cache line in the first set). All other variables are held in registers. The code is parameterized by positive integers $ m$ and $ n$ that satisfy $ m*n = 32$ (i.e., if you know one you know the other). Recall that the miss rate is defined as $ \frac{\text{number of misses}}{\text{number of accesses}}.$

// Code:  float A[32], t = 0; for(int i = 0; i < m; i++)   for(int j = 0; j < n; j++)       t += A[j*m + i]; 

Problem: Determine the miss rate for when $ m=1,2$ and $ 16.$

My Attempt:

When $ m=1$ we access the elements, $ $ A[0],A[1],A[2],\cdots,A[31]$ $ and since each block in the cache can hold $ 2$ doubles, this means that for every miss we get one hit and so the miss rate is $ 1/2.$

When $ m=2$ we access the elements, $ $ A[0],A[2],A[4],\cdots,A[30].$ $ Here we first miss $ A[0]$ but then we load the block with $ (A[0],A[1]).$ However, this does not help since we need to access $ A[2]$ and therefore we miss every time and thus the miss rate is $ 1.$

When $ m=16$ we access the elements, $ $ A[0],A[1],A[2],\cdots,A[31].$ $ And so like before this should have a miss rate of $ 1/2.$

However, the answers are: $ $ m=1, \text{miss rate} = 1/4$ $ $ $ m=2, \text{miss rate} = 1/2$ $ $ $ m=16, \text{miss rate} = 1/4.$ $

I am not sure how to obtain these answers and so any help will be much appreciated.

Remove directory from Google Cloud Compute Engine using serial console [on hold]

The storage on my Google Cloud Compute Engine Instance (inadvertently) got completely used up. I can no longer SSH into my instance. I have increased the space on my instance, but it still will not allow me to SSH. My VM operating system is Ubuntu.

I have tried two things:

1.) I have tried creating a start script to remove a large directory to clear up some space. Under “custom metadata” I have set the key as “startup-script” and the value as

#! /bin/bash

rm /home/myusername/dir-to-rm

I save and reset the instance, click “connect to serial console”, but I still cannot SSH.

2.) I have tried to use a startup script to set a login username and password for the serial console by using the same method, but with the following script:

#! /bin/bash

sudo useradd tmpuser

echo 'tmpuser:password' | chpasswd

Neither of these methods have allowed me to SSH back into the VM.

Any help would be greatly appreciated.

How can I upgrade the openGL version on a compute engine VM on GCP? [on hold]

GCP Compute Engine Machine info – Windows server 2016 – Xeon (R) 2Ghz 8 cores – RAM 7.2 GB – 1 Nvidia Tesla T4 Virtual workstation GPU – Connection using RDP

I’m trying to install Blender (3d app) which needs a minimum openGL 2.1 but my compute engine has openGL 1.1

Google compute engine VM screenshot:

enter image description here

I’ve installed nvidia drivers for Tesla T4 GPU from the nvidia website as well as updated windows server 2016, still the openGL error.

Please tell me how can I update the openGl version in my compute engine VM.

P.S. If I missed any info, please let me know.

Randomized algorithm to compute cover radius?

I have self-studied the book “Geometric Approximation Algorithms” by Sariel Har-Peled. I am stuck on a problem and don’t know how to start it.

The problem statement:

Let $ C$ and $ P$ be two sets of points in the plane, such that $ k = |C|$ and $ n = |P|$ .

Let $ M_P=max_{p\in P}$ , and $ m_C=min_{ c \in C }$

Let $ r = \|m_C-M_P\|$ be the cover radius of $ P$ by $ C$

Give a $ \mathcal{O}(n+k\log n)$ expected time algorithm that outputs a number $ \alpha$ such that $ r \leq \alpha \leq 10r$

Any hints for that?

How can I find (or compute) a client MAC address when using the strongSwan DHCP plugin?

Server strongswan.conf

libtls {   suites = TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA } charon {   plugins {     dhcp {       # Always use the configured server address.       force_server_address = yes        # Derive user-defined MAC address from hash of IKE identity.       identity_lease = yes        # Interface name the plugin uses for address allocation.       interface = eth0        # Whether to load the plugin. Can also be an integer to increase the       # priority of this plugin.       load = yes        # DHCP server unicast or broadcast IP address.       server = 10.0.2.255     }   } } 

Client ipsec.conf

conn %default     ike=aes256gcm16-sha384-modp3072!     esp=aes256gcm16-sha384-modp3072!  conn ikev2     auto=start     leftid=client@my-vpn.com     leftsourceip=%config     leftauth=eap-tls     leftcert=vpn-client.crt     right=my-vpn.com     rightid=my-vpn.com     rightsubnet=0.0.0.0/0     rightauth=pubkey 

The client is getting a dynamic IP from isc-dhcp-server but I would like to assign a static one using the following in dhcpd.conf.

host client {   hardware ethernet a1-b2-c3-d4-e5-f6;   fixed-address 10.0.2.2; } 

According to https://wiki.strongswan.org/projects/strongswan/wiki/DHCPPlugin, the client MAC address can optionally be based on the IKEv2 identity of the client.