Wednesday, March 31, 2021

Recent Questions - Server Fault

Recent Questions - Server Fault


Tracking TCP Connection in background

Posted: 31 Mar 2021 10:14 PM PDT

I am looking for a daemon utility to track all non local TCP connections and which binaries establish the TCP connections (actively and passively) with which IPs and ports.

auditd seems like a great tool.

Following this post, I notice that the following rule captures all connections: auditctl -a exit,always -F arch=b64 -S connect -k MYCONNECT

I see many entries like these:

type=SOCKADDR msg=audit(04/01/2021 10:54:23.327:397) : saddr={ fam=local path=/dev/log }   type=SYSCALL msg=audit(04/01/2021 10:54:23.327:397) : arch=x86_64 syscall=connect success=yes exit=0 a0=0x4 a1=0x7fc64b29a6c0 a2=0x6e a3=0x20656c62616e6520 items=1 ppid=3116 pid=3156 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=2 comm=sudo exe=/usr/bin/sudo key=MYCONNECT   type=SOCKADDR msg=audit(04/01/2021 10:54:23.328:403) : saddr={ fam=local path=/var/run/dbus/system_bus_socket }   type=SYSCALL msg=audit(04/01/2021 10:54:23.328:403) : arch=x86_64 syscall=connect success=yes exit=0 a0=0x4 a1=0x55e28814cac8 a2=0x21 a3=0x7fff6e3462d0 items=1 ppid=3116 pid=3156 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=2 comm=sudo exe=/usr/bin/sudo key=MYCONNECT   

I wonder whether there is a way to filter by the AF family, limiting to IPv4 and IPv6.

I can add a filter to capture socket system call with AF family = IPv4 or IPv6. But for connect system call, I am not sure how to do so.

Thanks.

systemd raspbian wpa_supplicatant access point not working

Posted: 31 Mar 2021 09:44 PM PDT

Moving on from my prior question about identifying source of a wireless SSID, I am now ready to move on to the next challenge. Most of the documentation I found for wpa_supplicant and creation of a new access point revolved around a change from dhcpcd networking to systemd networking. Though I feel it was a mistake to do so, I have done this.

Problems: No IP address on wlan0 at boot; my SSID does not show up on wifi devices. I'm sure these are related.

I have the following configuration:

(DNS and DHCP provided by dnsmasq)

/etc/systemd/network/04-wired.network

[Match]  Name=eth0    [Network]  Address=10.158.54.3/24  Gateway=10.158.54.1  DNS=127.0.0.1 75.75.75.75  MulticastDNS=no  

/etc/systemd/network/08-wifi.network

[Match]  Name=wlan0    [Network]  DHCP=yes  

/etc/wpa_supplicant/wpa_supplicant-wlan0.conf (some values masked)

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev  ctrl_interface_group=wheel  update_config=1  p2p_disabled=1  country=US  ap_scan=1  #arris24 is the main router's SSID  #cfg2021 is the SSID I want to create  network={          ssid="arris24.xx.com"          #psk="xx"          psk=xx  }  network={          ssid="cfg2021.xx.com"          psk="xx"          mode=2          key_mgmt=WPA-PSK          }  

I have done the appropriate systemctl enable magic, and on reboot, eth0 has its static address, but wlan0 does not get a DHCP address.

> ifconfig  eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet 10.158.54.3  netmask 255.255.255.0  broadcast 10.158.54.255          inet6 fe80::dea6:32ff:fe47:16c2  prefixlen 64  scopeid 0x20<link>          inet6 2601:c7:8400:f870:dea6:32ff:fe47:16c2  prefixlen 64  scopeid 0x0<global>          ether dc:a6:32:47:16:c2  txqueuelen 1000  (Ethernet)          RX packets 1837912  bytes 2596534251 (2.4 GiB)          RX errors 0  dropped 41  overruns 0  frame 0          TX packets 871080  bytes 285375665 (272.1 MiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536          inet 127.0.0.1  netmask 255.0.0.0          inet6 ::1  prefixlen 128  scopeid 0x10<host>          loop  txqueuelen 1000  (Local Loopback)          RX packets 3506  bytes 305045 (297.8 KiB)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 3506  bytes 305045 (297.8 KiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet6 fe80::dea6:32ff:fe47:16c3  prefixlen 64  scopeid 0x20<link>          ether dc:a6:32:47:16:c3  txqueuelen 1000  (Ethernet)          RX packets 2234  bytes 257504 (251.4 KiB)          RX errors 0  dropped 9  overruns 0  frame 0          TX packets 566  bytes 78118 (76.2 KiB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  

This is the dnsmasq.conf minus all the dhcp-host and comment entries

t> egrep -v '^ *#|dhcp-host|^ *$' /etc/dnsmasq.conf  interface=eth0  listen-address=10.158.54.3  listen-address=127.0.0.1  log-queries=extra  bind-interfaces  domain-needed  bogus-priv  cname=songs,pi-in-the-sky  cname=hpmicro,hpmicro1  dhcp-range=10.158.54.101,10.158.54.200,25h  server=10.158.54.3  server=8.8.8.8  server=75.75.75.75  dhcp-option=option:router,10.158.54.1    # Default gateway  dhcp-option=6,10.158.54.3                # DNS (Hey, that's me!)  domain=xx.com  expand-hosts # Add domain also to any simple names in /etc/hosts  

I can see that wpa_supplicant began running at startup:

> ps -ef|grep wpa|grep pli  root       373     1  0 00:09 ?        00:00:00 /sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0  

When other devices connect via ethernet, they receive an IP address, so I believe dnsmasq is OK. Supporting that, if I do killall wpa_supplicant and then run it locally :

/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0 -d -f /tmp/wpa-debug.txt  

then wlan0 gets an IP address (10.158.54.162) from dnsmasq. But I never see the cfg2021.xx.com network in the list of SSIDS on my wireless devices. (/tmp/wpa-debug.txt is a 36KB file by the time I kill the process.

I'm way out of my league when it comes to systemd networking. (Again, I think it was a mistake to go that route since originally the networking was more traditional - and it worked. For a long time. But here we are.)

I'd appreciate your guidance. There are two problems I perceive:

-- wlan0 not getting network IP address at startup  -- cfg2021 network SSID never shows up on wifi devices  

Can Google Cloud Organization be used for internet uptime?

Posted: 31 Mar 2021 07:31 PM PDT

Maybe I'm barking up the wrong tree! I just want to be able to monitor our internet connection (i.e. ping every 15 sec) and get a notification (email or preferably text) when it goes down for more than a minute. I have the NetUptime Monitor installed on one PC and it works great, keeps a log, but does not notify me. I've just spent hours trying different (Spiceworks, Zabbix, PRTG) solutions but they either had issues or seemed like overkill. Does Google have a solution?

DNS VIEW not working for any

Posted: 31 Mar 2021 04:42 PM PDT

I have configured a dns view configuration

view "local-lan" {

match-clients { 192.168.0.0/24 };

zone "localtesting.com" {

type master;

file "internal/internal.localtesting.com";};};

view "any" {

match-clients { any };

zone "betatesting.com" {

type master;

file "external/betatesting.com";

};

};

When i tried to access betatesting.com domain from 192.168.0.0/24 network server it matches with only local-lan view and returned NXDOMAIN. I hope it suppossed to match any if the zone is not present in local-lan. Anybody please give me some details on it.

Change time in Xampp Apache

Posted: 31 Mar 2021 04:38 PM PDT

I want to know if there is a way to change Apache time to another time. for example, we are in 2021,31, March. but I want to set time in Apache to 2021,1, March to test my applications.
Let me know if it is possible?

apache reverse proxy to main domain on one port and subdomain on another port

Posted: 31 Mar 2021 04:04 PM PDT

I am trying to add a subdomain to an existing configuration using a different port than the main domain. The existing config looks like this:

<VirtualHost *:80>      ServerName example.com      ServerAdmin webmaster@localhost      UseCanonicalName On      RewriteEngine On      RewriteCond %{HTTPS} off      RewriteRule ^(.*)$ https://example.com%{REQUEST_URI} [L,R=301]  </VirtualHost>    <VirtualHost *:443>      ServerName example.com      UseCanonicalName On      ProxyPass / http://127.0.0.1:5001/      ProxyPassReverse / http://127.0.0.1:5001/      LogLevel warn      ErrorLog ${APACHE_LOG_DIR}/example_error.log      CustomLog ${APACHE_LOG_DIR}/access.log combined      SSLEngine on      SSLCertificateFile /etc/ssl/certs/server.crt      SSLCertificateKeyFile /etc/ssl/private/server.key      SSLCACertificateFile /etc/ssl/certs/ca.crt      SSLVerifyDepth 2  </VirtualHost>  

I have tried adding another config file with essentially the exact same information, but replacing example.com with sub.example.com, and changing the port, but that did not work. What is the best way to add a subdomain to this configuration?

My certificate is for *.example.com, if that is important.

Need to deploy Laps via GPO cant use computer configuration or user configuration

Posted: 31 Mar 2021 11:17 PM PDT

I am trying to deploy Laps to all my users via GPO but issue i am having is nobody has local admin rights on their machines so obviously the install wont work with user config and i cant really use computer configuration as most of my users are now working from home and are not logged into the vpn at startup/shutdown so the policy never triggers. Is there another way to achieves this?

Back up arbitrary config files on linux servers in RANCID

Posted: 31 Mar 2021 08:37 PM PDT

I use RANCID to back up router and switch configurations.

I'd also like to be able to have it take automatic backups of configuration files on my servers so I can easily see when changes occur and if something breaks, revert to the last known config.

There are a number of approaches to this, but RANCID has everything I'm looking for in terms of features and I already use it, so it would be ideal if I could have it built in to that.

I see this question from 9 years ago asking the same thing and the top answer pretty much just says "build your own module" - I've had a look at the RANCID modules and I can't wrap my head around how to do that, so looking to see if in the past 9 years if anyone knows of a module that's now out there for this.

Edit: Not yet a complete solution, but I found this repository which seems to have the basics for what I'd need to be able to grab files by SCP and load them into RANCID: https://github.com/drewbeer/rancid-scp

SSSD integration with Ldap Error 'Could not start TLS encryption. TLS: hostname does not match CN in peer certificate'

Posted: 31 Mar 2021 11:09 PM PDT

We are currently using Wildcard certificate with SAN. I can successfully run ldapsearch from my client machine when I added TLS_REQSAN allow in openldap configuration.

Now i'm trying to integrate SSSD with secure LDAP but getting the below error

'Could not start TLS encryption. TLS: hostname does not match CN in peer certificate'

How can I force SSSD to check for Subject Alternate Name(SAN) instead of CN.

Is there a property I could set in SSSD configuration.

ldapsearch fails with TLS: hostname does not match CN in peer certificate

Posted: 31 Mar 2021 11:09 PM PDT

I'm trying to configure secure LDAP client using the certificates (RootCA, IntermediateCA, IssuingCA and Server certificate) and created the truststore. openssl s_client works successfully but when I run ldapsearch I get the below error:

ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)  additional info: TLS: hostname does not match CN in peer certificate  

ldap.conf:

SASL_NOCANON    on  #Configration for LDAP  URI ldaps://ldapserver.abc.example.com/  BASE dc=ldapserver,dc=abc,dc=example,dc=com  TLS_CACERTDIR /etc/openldap/cacerts  TLS_CACERT /etc/pki/tls/certs/ca-bundle.crt  

LDAP server FQDN: ldapserver.abc.example.com
Client FQDN: centos7.xyz.example.com

Do I need to create a new certificate for the client using the provided certificates, if yes how?

Apache 2.4 LDAP lookup sllow

Posted: 31 Mar 2021 04:53 PM PDT

Server is running RHEL 7 and Apache 2.4.6; this is a pretty new (about a week old) problem. My department Intranet uses authentication against the university's Active Directory environment, and authentication for end-users takes over 30 seconds. Subsequent page loads are nearly-instant, and after some time (timeout, I assume), the problem is back.

<Directory /var/www/html/intranet>    AuthType Basic    AuthName "Restricted files"    AuthBasicProvider ldap    AuthLDAPBindDN CN=dept-binder,OU=Generic-Logon,OU=Generic,DC=example,DC=edu    AuthLDAPBindPassword lamepassword    AuthLDAPURL ldaps://ldap-ad.example.edu:636/dc=example,dc=edu?sAMAccountName?sub      <RequireAny>      require ldap-group CN=ug-dept-intranet,OU=Deoartment,OU=Dept-Groups,DC=example,DC=edu    </RequireAny>  </Directory>  

Here are some relevant lines from error_log:

AH02034: Initial (No.1) HTTPS request received for child 36 (server dept.example.edu:443)  AH01626: authorization result of Require ldap-group CN=ug-psy-employees,OU=Dynamic,OU=Psychology,OU=FSU-Dept-Groups,DC=fsu,DC=edu: denied (no authenticated user yet)  AH01626: authorization result of Require ldap-group CN=ug-dept-intranet,OU=Dept,OU=Dept-Groups,DC=example,DC=edu: denied (no authenticated user yet)  AH01691: auth_ldap authenticate: using URL ldaps://ldap-ad.example.edu:636/dc=example,dc=edu?sAMAccountName?sub  AH02001: Connection closed to child 11 with standard shutdown (server dept.example.edu:443)    # 37 seconds pass    AH01697: auth_ldap authenticate: accepting jsmith  AH01713: auth_ldap authorize: require group: testing for group membership in "CN=ug-dept-intranet,OU=Department,OU=Dept-Groups,DC=example,DC=edu"  AH01714: auth_ldap authorize: require group: testing for member: CN=jsmith,OU=PEOPLE,DC=example,DC=edu (CN=ug-dept-intranet,OU=Department,OU=Dept-Groups,DC=example,DC=edu)  AH01715: auth_ldap authorize: require group: authorization successful (attribute member) [Comparison true (adding to cache)][6 - Compare True]  

Cheapest way to setup a domain controller with AD-DS for a small business with multiple locations

Posted: 31 Mar 2021 10:04 PM PDT

I work for a small business with little IT infrastructure. We want to be able to join all computers throughout the company to a single domain to push group policies and conduct other management functions, however, we have 15 offices with 1-2 employees at each office and 10 at corporate with a total of 36 employees. To me, it doesn't make sense to invest in the infrastructure to setup a domain controller with a firewall at each location.

Based on my research it seems like moving everything to the cloud (Azure) or doing a hybrid approach with our on-premise server would make more sense. Is my thinking correct here? Would there be a cheaper way?

Deploy MSI via GPO to specific users "Admin right issue"

Posted: 31 Mar 2021 07:01 PM PDT

I'm trying to deploy an MSI via GPO to specific users (120 users) from different departments and sites, the problem is that they don't have admin rights so the application cannot be installed due to insufficient privileges.

Can anyone have an idea to get around this problem? Thanks

How to find source of inherited permission on Exchange online mailbox?

Posted: 31 Mar 2021 09:02 PM PDT

Example:

Get-MailboxPermissions -Identity "<user>"  

Shows permissions with IsInherited=True Where would this permission be inherited from in Exchange online?

In on premise exchange I would use Get-MailboxDatabase and/or Get-ADPermission but these are unavailable in Exchange online.

There is a permission we want to remove, but can't because it's inherited:

WARNING: An inherited access control entry has been specified: [Rights: ReadControl, ControlType: Allow]  and was ignored on object "CN=<user>,OU=<organization>,OU=Microsoft Exchange Hosted Organizations,DC=<server>,DC=PROD,DC=OUTLOOK,DC=COM".  

Port accessing error for a docker app on google compute engine VM instance

Posted: 31 Mar 2021 05:04 PM PDT

I'm trying to deploy an web app in a VM instance at Google Compute Engine (GCP). I connect to instance via ssh and deployed docker-compose orchestrated app. Which runs two docker containers as below.

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                 6824c19fad9b        wordpress:latest    "docker-entrypoint.s…"   3 hours ago         Up 22 seconds       0.0.0.0:8065->80/tcp     3079c9872e3d        mysql:5.7           "docker-entrypoint.s…"   3 hours ago         Up 3 hours          3306/tcp  

As per my previous experiences I mapped host instance's port 8065 to the wordpress container's port 80 (which works fine on my local machine and some other machines) So as you could see above docker has properly done the mapping I assume.

To test the setup from the instance, when I run curl http://localhost:8065
the terminal responds curl: (52) Empty reply from server

Since I can't make the internal mapping work, its useless to map from outside also. However I've made new ingress and egress firewall rules to enable tcp:8065 for this instance. However still no luck.

I'm aware that GCP recommends to use their Kubernates Engine to deploy containerized apps. However switching to that option is not the solution I'm expecting here. I just want to make sure what went wrong and how to make the current setup work in the same platform.

AWS Windows EC2 instance does not recognize assigned IAM role

Posted: 31 Mar 2021 07:09 PM PDT

Initially I launched a brand-new Windows Server 2016 server EC2. I assigned a S3 full admin IAM role to this instance when launching it. I installed CLI on it. I started a CMD window, and typed in "aws s3 ls". It lists all my buckets. All working fine.

I then created an AMI from this instance. I launched a new instance from this instance with that S3 full admin IAM role. "aws s3 ls" still works.

Then, after a number of days, when I repeat the above process (launching an instance from the same AMI), "aws s3 ls" will stop working, with the following error:

Unable to locate credentials. You can configure credentials by running "aws configure".  

It happened many times. Every time I rebuilt a new Windows Server, install CLI, assign the S3 full admin role to the instance, it works. After a number of days, when I launch a new instance from the exact same AMI, "aws s3 ls" will stop working.

It is so mysterious! Can someone shed some light on this please?

mod_evasive doesn't do anything on Ubuntu server 16.04

Posted: 31 Mar 2021 05:04 PM PDT

I set up mod_evasive on Apache/2.4.18 using this guide: https://komunity.komand.com/learn/article/server-administration/how-to-configure-modevasive-with-apache-on-ubuntu-linux/

I only changed email@yourdomain.com to root@localhost.

The first time I used test.pl it worked, but every remaining time it only shows HTTP/1.1 400 Bad Request. I'm not sure if I accidentally changed anything, but here's my test.pl.

#!/usr/bin/perl    # test.pl: small script to test mod_dosevasive's effectiveness    use IO::Socket;  use strict;    for(0..100) {      my($response);      my($SOCKET) = new IO::Socket::INET( Proto   => "tcp",                                          PeerAddr=> "127.0.0.1:80");      if (! defined $SOCKET) { die $!; }      print $SOCKET "GET /?$_ HTTP/1.0\n\n";      $response = <$SOCKET>;      print $response;      close($SOCKET);  }  

Because it worked the first time, shouldn't there be a log of it? I checked /var/log/mod_evasive/ and it's empty. In syslog there is also no mention of mod_evasive. There is only root in /var/mail/ which hasn't received a mail of mod_evasive either.

Could it be because I'm redirecting http to https? I setup a Redirect permanent / https://mydomain.example in 000-default.conf.

Https on iis not working with domain name of ip address

Posted: 31 Mar 2021 06:03 PM PDT

Using Windows 2012 R2 Standard server with IIS. Windows firewall has preset rules World Wide Web Services (HTTP Traffic-In) and World Wide Web Services (HTTPS Traffic-In) enabled. The server has one web with the following bindings:

http - empty value / any domain - 80
http - example.com - 80
https - example.com - 443
https - empty value / any domain - 443

Urls tried from external machine:
http://example.com - works
http://my.ip.address - works
https://example.com - not working
https://my.ip.address - not working

Urls tried from local server
http://example.com - works
http://localhost - works
http://my.ip.address - works
https://example.com - not working
https://localhost - works
https://my.ip.address - not working

So http works for all addresses from all locations. Https works when run on local machine with address localhost but https does not work in any other way. What am I missing? Do I need to open other firewall rules/ports other than 443?

Chef Private Key Could Not Be Loaded from /user.pem

Posted: 31 Mar 2021 11:07 PM PDT

I just finished the install chef-server tutorial at Chef's website, using an ec2 instance for my chef-server (t2.medium Ubuntu 16.04 AMI), and my laptop for my workstation, which also runs Ubuntu 16.04.

It appears that I succeeded in setting up a chef-workstation and chef-server. However, my 'user.pem' key is not being located. This is bazaar because my pem keys were successfully pulled from my chef-server to my chef-workstation using 'scp'. I can see them in my chef-repo directory on my workstation.

Might anyone be kind enough to help figure out why my pem key is not being located?

From my chef-workstation at:

~/chef-repo/  

I run:

knife ssl fetch  

I get:

WARNING: Certificates from ec2-XX-XX-XXX-XXX.us-west-1.compute.amazonaws.com will be fetched and placed in your trusted_cert  directory (/home/user/chef-repo/.chef/trusted_certs).    Knife has no means to verify these are the correct certificates. You should  verify the authenticity of these certificates after downloading.    Adding certificate for ec2-XX-XX-XXX-XXX_us-west-1_compute_amazonaws_com in /home/user/chef-repo/.chef/trusted_certs/ec2-XX-XX-XXX-XXX_us-west-1_compute_amazonaws_com.crt  

So now I have a:

 '/chef-repo/.chef/trusted_certs/ec2-52-53-255-252_us-west-1_compute_amazonaws_com.crt'   

file as expected.

Next I run:

knife ssl check  

I get:

Connecting to host ec2-XX-XX-XXX-XXX.us-west-1.compute.amazonaws.com:443  Successfully verified certificates from `ec2-XX-XX-XXX-XXX.us-west-1.compute.amazonaws.com'  

But when I run:

knife client list  

I get:

WARN: Failed to read the private key /user.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /user.pem>    Your private key could not be loaded from /user.pem  Check your configuration file and ensure that your private key is readable  

My 'knife.rb.' settings are:

log_level                :info  log_location             STDOUT  node_name                "user"  client_key               "#{current_dir}/user.pem"  validation_client_name   "myorg_shortname-validator"  validation_key           "#{current_dir}/myorg_shortname-validator.pem"  chef_server_url          "https://ec2-XX-XX-XXX-XXX.us-west-1.compute.amazonaws.com/organizations/myorg_shortname"  syntax_check_cache_path  "#{ENV['HOME']}/.chef/syntaxcache"  cookbook_path            ["#{current_dir}/../cookbooks"]  

On my chef-server, my /etc/hosts, and /etc/hostname settings are both:

ip-XXX-XX-XX-XX.us-west-1.compute.internal  

Strangely enough, I had to set 'chef_server_url' in 'knife.rb' to:

ec2-XX-XX-XXX-XXX_us-west-1_compute_amazonaws_com  

as opposed to:

ip-XXX-XX-XX-XX.us-west-1.compute.internal  

or else it wouldn't fetch my keys

What I am missing?

How to change sites-available configurations in NGinx

Posted: 31 Mar 2021 11:00 PM PDT

I am new to Linux. I want to deploy my asp.net core application on Ubuntu 16.04 LTS virtual machine. I installed asp.net core on Ubuntu and managed to run a simple asp.net core web application on Ubuntu. In addition, I want to setup Nginx web server as the reverse proxy for my application. I followed this article in order to install Nginx. Eventhough Nginx server successfully installed I cannot change following configurations on default file of Nginx Sites-Available section as above article explained since the whole directory is read only.

server {      listen 80;      location / {          proxy_pass http://localhost:5000;          proxy_http_version 1.1;          proxy_set_header Upgrade $http_upgrade;          proxy_set_header Connection keep-alive;          proxy_set_header Host $host;          proxy_cache_bypass $http_upgrade;      }  }  

enter image description here

What have I done wrong and please tell me how to edit this file.

Apache returns invalid Content-Length for gzip compressed 204 response

Posted: 31 Mar 2021 08:06 PM PDT

When apache returns a gzip compressed response with 204 response code and empty body server returns invalid header Content-Length: 20 instead of Content-Length: 0.

Without gzip compression (without Accept-Encoding header) server returns valid header Content-Length: 0.

Request and response with compression:

0 % curl -v http://mta.dev/api/wtf/\?id\=09102 --compressed  * Hostname was NOT found in DNS cache  *   Trying 172.17.0.2...  * Connected to mta.dev (172.17.0.2) port 80 (#0)  > GET /api/wtf/?id=09102 HTTP/1.1  > User-Agent: curl/7.38.0  > Host: mta.dev  > Accept: */*  > Accept-Encoding: deflate, gzip  >   < HTTP/1.1 204 No Content  < Date: Thu, 09 Jun 2016 15:44:53 GMT  * Server Apache/2.4.7 (Ubuntu) is not blacklisted  < Server: Apache/2.4.7 (Ubuntu)  < X-Powered-By: PHP/5.5.9-1ubuntu4.17  < P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"  < X-Powered-CMS: Bitrix Site Manager (d04cd2b3dbab106e7537af3767043172)  < Set-Cookie: PHPSESSID=8arlnd14t1k97bri56clb2qhh1; path=/; HttpOnly  < Expires: Thu, 19 Nov 1981 08:52:00 GMT  < Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0  < Pragma: no-cache  < Set-Cookie: BITRIX_SM_GUEST_ID=2328047; expires=Sun, 04-Jun-2017 15:44:53 GMT; Max-Age=31104000; path=/  < Set-Cookie: BITRIX_SM_LAST_VISIT=09.06.2016+18%3A44%3A53; expires=Sun, 04-Jun-2017 15:44:53 GMT; Max-Age=31104000; path=/  < Content-Encoding: gzip  < Content-Length: 20  < Content-Type: application/json  <   * Excess found in a non pipelined read: excess = 20 url = /api/wtf/?id=09102 (zero-length body)  * Connection #0 to host mta.dev left intact  

Request and response without compression:

0 % curl -v http://mta.dev/api/wtf/\?id\=09102  * Hostname was NOT found in DNS cache  *   Trying 172.17.0.2...  * Connected to mta.dev (172.17.0.2) port 80 (#0)  > GET /api/wtf/?id=09102 HTTP/1.1  > User-Agent: curl/7.38.0  > Host: mta.dev  > Accept: */*  >   < HTTP/1.1 204 No Content  < Date: Thu, 09 Jun 2016 15:38:43 GMT  * Server Apache/2.4.7 (Ubuntu) is not blacklisted  < Server: Apache/2.4.7 (Ubuntu)  < X-Powered-By: PHP/5.5.9-1ubuntu4.17  < P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"  < X-Powered-CMS: Bitrix Site Manager (d04cd2b3dbab106e7537af3767043172)  < Set-Cookie: PHPSESSID=ceqsuv4ie3fkq497uvk6e2gki1; path=/; HttpOnly  < Expires: Thu, 19 Nov 1981 08:52:00 GMT  < Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0  < Pragma: no-cache  < Set-Cookie: BITRIX_SM_GUEST_ID=2328047; expires=Sun, 04-Jun-2017 15:38:43 GMT; Max-Age=31104000; path=/  < Set-Cookie: BITRIX_SM_LAST_VISIT=09.06.2016+18%3A38%3A43; expires=Sun, 04-Jun-2017 15:38:43 GMT; Max-Age=31104000; path=/  < Content-Length: 0  < Content-Type: application/json  <   * Connection #0 to host mta.dev left intact  

Setting Content-Length: 0 header in PHP application manually has no effect because apache recalculates length after gzipping.

I found this bug in Apache bugtracker https://bz.apache.org/bugzilla/show_bug.cgi?id=51350 where developer says that this bug fixed in 2.4.1 version. I have 2.4.7 version installed and this bug still occurs.

How i can disable gzip compression for 204 responses, or for responses with empty body? Or maybe there is a way to disable overwriting Content-Length header by apache?

Dovecot dict: Can't open configuration file, Permission denied

Posted: 31 Mar 2021 04:00 PM PDT

I'm trying to set up a dovecot mysql dict for quota in a FreeBSD jail.

This is the log I'm getting:

an 13 10:03:23 mail dovecot: dict(71120): Error: Failed to initialize dictionary 'sqlquota': dict mysql: Can't open configuration file /usr/local/etc/dovecot/dovecot-dict-sql.conf: Permission denied  

These are my file permissions:

5 -r--------   1 root  mail    353 12 Jan 16:41 dovecot-dict-sql.conf  5 -r--------   1 root  mail    526 12 Jan 17:04 dovecot-sql.conf  5 -r--r-----   1 root  mail   5531 13 Jan 09:58 dovecot.conf  

This is /var/run/dovecot:

9 drwxr-xr-x   5 root     wheel     37 13 Jan 10:02 ./  9 drwxr-xr-x  11 root     wheel     20 13 Jan 09:42 ../  1 srw-------   1 root     wheel      0 13 Jan 09:42 anvil  1 srw-------   1 root     wheel      0 13 Jan 09:42 anvil-auth-penalty  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-client  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-login  1 srw-rw----   1 vmail    mail       0 13 Jan 10:02 auth-master  1 -rw-------   1 root     wheel     32 13 Jan 09:42 auth-token-secret.dat  1 srw-rw-rw-   1 dovecot  wheel      0 13 Jan 10:02 auth-userdb  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 auth-worker  1 srw-------   1 root     wheel      0 13 Jan 10:02 config  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 decode2text  1 srw-rw----   1 root     mail       0 13 Jan 10:02 dict  1 srw-------   1 root     wheel      0 13 Jan 10:02 dict-async  1 srw-------   1 root     wheel      0 13 Jan 10:02 director-admin  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 dns-client  1 srw-------   1 root     wheel      0 13 Jan 10:02 doveadm-server  1 lrwx------   1 root     wheel     35 13 Jan 09:42 dovecot.conf -> /usr/local/etc/dovecot/dovecot.conf  1 drwxr-xr-x   2 root     wheel      2 13 Jan 09:42 empty/  1 srw-------   1 root     wheel      0 13 Jan 10:02 imap-hibernate  1 srw-------   1 root     wheel      0 13 Jan 10:02 imap-master  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 imap-urlauth  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 imap-urlauth-worker  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 indexer  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 indexer-worker  1 srw-------   1 root     wheel      0 13 Jan 10:02 ipc  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 lmtp  1 srw-------   1 root     wheel      0 13 Jan 10:02 log-errors  9 drwxr-x---   2 root     dovenull   7 13 Jan 10:02 login/  1 -rw-------   1 root     wheel      6 13 Jan 09:42 master.pid  1 srw-------   1 root     wheel      0 13 Jan 10:02 replication-notify  1 prw-------   1 root     wheel      0 13 Jan 10:02 replication-notify-fifo  1 srw-------   1 dovecot  wheel      0 13 Jan 10:02 replicator  1 srw-rw-rw-   1 root     wheel      0 13 Jan 10:02 ssl-params  1 srw-------   1 root     wheel      0 13 Jan 10:02 stats  1 prw-------   1 root     wheel      0 13 Jan 10:02 stats-mail  1 drwxr-x---   2 root     dovenull   4 13 Jan 10:02 token-login/  

And this is my dovecot.conf:

[…]  dict {    sqlquota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf  }    service dict {    unix_listener dict {      mode = 0660      group = mail    }  }  […]  

What am I missing?

htaccess - redirect based on the request origin

Posted: 31 Mar 2021 07:01 PM PDT

Please help me out here. I would like to use .htaccess to redirect based on request origin, for example:

User requests:

http://www.domain.com/subfolder/  

And should be redirected to:

http://www.domain.com/  

This is very simple to accomplish BUT on the homepage there is a link to:

http://www.domain.com/subfolder/   

And it should work just WHEN the request comes from that link.

In other words my goal is to force all users through the homepage BEFORE other URLs even if they know the page URL (bookmarked or otherwise) and it is a valid one.

Is it possible?

How to debug 403 error on Cent OS?

Posted: 31 Mar 2021 06:03 PM PDT

I'm trying to install phpMyAdmin and I'm getting a 403.

/etc/httpd/conf/httpd.conf

<Directory /usr/share/phpMyAdmin/>          Order Deny,Allow          Allow from all  </Directory>  

/etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>     AddDefaultCharset UTF-8       <IfModule mod_authz_core.c>       # Apache 2.4       <RequireAny>         Require ip 99.232.55.0/24       </RequireAny>     </IfModule>       <IfModule !mod_authz_core.c>       # Apache 2.2        AllowOverride All       Order Deny,Allow       Deny from All       Allow from 99.232.55.96     </IfModule>  </Directory>  

This is running on CentOS 6.6 on Apache 2.2

I've tried a ton of combinations and none of these files seem to make a difference. I have a feeling there is another file having effect but the logs say nothing about how to find it.

The Apache ErrorLog and AccessLog give nothing of use.

I am running a Django site inside of Virtual Env at the domain root.

Active Directory control client hyper-v permissions

Posted: 31 Mar 2021 09:02 PM PDT

I've done lots of googling and the only thing I find relates to, I believe, Hyper-V server and not client Hyper-V.

The scenario is that we have a domain here at the college and we are trying to use client Hyper-V on the win8 pro machines. The students are part of the Hyper-V Administrators group and we tried using Authorization Manager, but nothing has worked to allow students to run Hyper-V Manager without being an Administrator or having an administrator use their credentials to run Hyper-V Manager with elevated permissions. The administrator walking around running Hyper-V Manager with elevated privileges is not really convenient, so what we are looking for is a way to control the ability of students to run Hyper-V Manager and load their Win2012r2 VMs and create new VMs without the administrator's credentials and without making the students administrators. The students very specifically only need administrative privileges for client Hyper-V or for client Hyper-V not to require administrative privileges.

Make an error page folder serve a 403 error to external requests

Posted: 31 Mar 2021 08:06 PM PDT

I'm fiddling about with a server, and I've made one of the subdomains a proxy for a service that isn't always up. The server block looks like:

server {      server_name servlet.example.org;      error_page 502 /error/down.html;        location / {          proxy_pass http://127.0.0.1:12510;          proxy_redirect default;          proxy_intercept_errors on;      }        location /error/ {          root /path/to/servlet;          autoindex off;      }  }  

This serves /path/to/servlet/error/down.html to any request when the service is down and that's great.

My issue is that I would like to make any external request to /error/ return a 403 status code, with a custom error page of its own—say forbidden.html, also to be found in the /error/ folder. The internal directive sounds like it's what I want, but that returns 404s. I can't just override 404 errors on the whole server to a 403 with error_page, because the service may return 404s of its own and I'd like to preserve that.

Is this possible? How would I go about it? I have tried seemingly meaningful combinations of internal and error_page but can't get anywhere.

Barring that, can I at least serve a 403 to anything that would otherwise 404 in /error/? I.e. down.html and forbidden.html show up normally, but anything else gets a 403 and displays forbidden.html.

vmware thin disk usage powercli

Posted: 31 Mar 2021 10:04 PM PDT

I want to ask a question about thin provisioning. get-vm commandlet can easly give us real space used by a vm totally. Assume that you have a virtual machine which has more than one thin disk. If we want to get more detail so as to calculate each disk real used space which powercli command does this? I do not prefer getting it by datastore browser for performance issues.

Apache forces Cache-Control: private automatically for HTTPS requests

Posted: 31 Mar 2021 11:00 PM PDT

I'm trying to get browsers to cache assets over HTTPS. I am using MD5 fingerprinting method to allow long-term caching and I have this part working OK.

What doesn't work is setting the Cache-Control headers in Apache.

My config for both regular and SSL vhost contains:

ExpiresActive On  ExpiresByType text/css "now plus 1 year"  

HTTP request to /test.css produces headers:

Cache-Control: max-age=31536000  Content-Type: text/css  Date: Wed, 15 May 2013 10:33:01 GMT  Etag: "7e572-19-4dcbdc8c04529"  Expires: Thu, 15 May 2014 10:33:01 GMT  Last-Modified: Wed, 15 May 2013 08:46:21 GMT  Server: Apache/2.2.15 (Oracle)  Vary: Accept-Encoding,User-Agent  

But HTTPS request to same file produces headers:

Cache-Control: private, must-revalidate, no-cache, no-store  Content-Type: text/css  Date: Wed, 15 May 2013 10:33:58 GMT  Etag: "7e572-19-4dcbdc8c04529"  Expires: Thu, 01 Jan 1970 00:00:00 GMT  Last-Modified: Wed, 15 May 2013 08:46:21 GMT  Server: Apache/2.2.15 (Oracle)  Vary: Accept-Encoding,User-Agent  

BTW, Adding this right after the ExpiresByType:

Header unset Expires  Header unset Cache-Control  

removes these headers from HTTP, but not from HTTPS request.

Also, I have verified that any other header I set gets passed, but not cache related headers like Cache-Control or Expires - these get overwritten somewhere.

Is this normal Apache behavior or some Oracle or Red Hat patch that aims to security?

Can this be turned off somehow?

System info:

OS: Oracle Linux 6.4 (RHEL 6.4 based)  Apache: 2.2.15 (from rpm)  

Preferred format of file names which include a timestamp

Posted: 31 Mar 2021 06:28 PM PDT

As we all know "unix" can have anything in a file except '/' and '\0', sysadmins however tend to have a much smaller preference, mainly due to nothing liking spaces as input ... and a bunch of things having a special meaning for ':' and '@' among others.

Recently I'd seen yet another case where a timestamp was used in a filename, and after playing with different formats a bit to make it "better" I figured I'd try to find a "best practice", not seeing one I figured I'd just ask here and see what people thought.

Possible "common" solutions (p=prefix and s=suffix):

  1. syslog/logrotate/DNS like format:

    p-%Y%m%d-suffix = prefix-20110719-s  p-%Y%m%d%H%M-suffix = prefix-201107191732-s  p-%Y%m%d%H%M%S-suffix = prefix-20110719173216-s  

    pros:

    • It's "common", so "good enough" might be better than "best".
    • No weird characters.
    • Easy to distinguish the "date/time blob" from everything else.

    cons:

    • The date only version isn't easy to read, and including the time makes my eyes bleed and seconds as well is just "lol".
    • Assumes TZ.
  2. ISO-8601- format

    p-%Y-%m-%d-s = p-2011-07-19-s  p-%Y-%m-%dT%H:%M%z-s = p-2011-07-19T17:32-0400-s  p-%Y-%m-%dT%H:%M:%S%z-s = p-2011-07-19T17:32:16-0400-s  p-%Y-%m-%dT%H:%M:%S%z-s = p-2011-07-19T23:32:16+0200-s  

    pros:

    • No spaces.
    • Takes TZ into account.
    • Is "not bad" to read by humans (date only is v. good).
    • Can be generated by $(date --iso={hours,minutes,seconds})

    cons:

    • scp/tar/etc. won't like those ':' characters.
    • Takes a bit for "normal" people to see WTF that 'T' is for, and what the thing at the end is :).
    • Lots of '-' characters.
  3. rfc-3339 format

    p-%Y-%m-%d-s = p-2011-07-19-s  p-%Y-%m-%d %H:%M%:z-s = p-2011-07-19 17:32-04:00-s  p-%Y-%m-%d %H:%M:%S%:z-s = p-2011-07-19 17:32:16-04:00-s  p-%Y-%m-%d %H:%M:%S%:z-s = p-2011-07-19 23:32:16+02:00-s  

    pros:

    • Takes TZ into account.
    • Can easily be read by "all humans".
    • Can distinguish date/time from prefix/suffix.
    • Some of the above can be generated with $(date --iso={hours,seconds})

    cons:

    • Has spaces in the time versions (which means all code will hate it).
    • scp/tar/etc. won't like those ':' characters.
  4. I love hyphens:

    p-%Y-%m-%d-s = p-2011-07-19-s  p-%Y-%m-%d-%H-%M-s = p-2011-07-19-17-32-s  p-%Y-%m-%d-%H-%M-%S-s = p-2011-07-19-23-32-16-s  

    pros:

    • basically a slightly nicer syslog/etc. variant.

    cons:

    • Lots of '-' characters.
    • Assumes TZ.
  5. I love hyphens, with extensions:

    p.%Y-%m-%d.s = p.2011-07-19.s  p.%Y-%m-%d.%H-%M.s = p.2011-07-19.17-32.s  p.%Y-%m-%d.%H-%M-%S.s = p.2011-07-19.23-32-16.s  

    pros:

    • basically a slightly nicer "I love hyphens" variant.
    • No weird characters.
    • Can distinguish date/time from prefix/suffix.

    cons:

    • Using '.' here is somewhat non-traditional.
    • Assumes TZ.

...so anyone want to give a preference and a reason, or more than one (Eg. don't care about TZ if it's 95+% to stay machine local, but care a lot if it isn't).

Or, obviously, something not in the above list.

Recent Questions - Mathematics Stack Exchange

Recent Questions - Mathematics Stack Exchange


Prove that a zero divisor in $Z_n$ does not have a multiplicative inverse

Posted: 31 Mar 2021 09:14 PM PDT

so for this question, I assume $x$ and $y$ to be zero divisors in $Z_n$ such that $x \neq 0, y \neq 0$ .Assume that $x$ has a multiplicative inverse $a$ Since $x \times y=0$, $a * x * y = a * 0$, or $(1)*y=0$ (since a * x = 1 ) But y should be non-zero. So we arrive at a contradiction, and thus a zero divisor in $Z_n$ does not have a multiplication inverse. Does this proof make sense?

An upper bound for $\{r_n\}$ which satisfies $r_n = r_{n-1} + \frac{K}{r_{n-1}}$

Posted: 31 Mar 2021 09:13 PM PDT

I have a sequence $\{r_n\}$ of positive numbers defined recursively by $$\tag{1} r_n = r_{n-1} + \frac{K}{r_{n-1}}.$$ for some positive $K$. The sequence is clearly strictly increasing and tends to $+\infty$ as $n\to \infty$.

Question: Does there exists positive $K_1, K_2$ depending on $r_1, K$ such that $$\tag{2} 2nK - K_1 \le r_n^2 \le 2nK + K_2$$ for all large $n$?

Squaring (1) on both sides give $$ r_n^2 = r_{n-1}^2 + 2K + \frac{K^2}{r_{n-1}^2},$$

If I prove (2) using induction, the induction hypothesis gives

$$ \frac{K^2}{r_{n-1}^2} \le \frac{K^2}{ 2(n-1)K - K_1},$$ which is not very helpful, since $\sum \frac{1}{n-1}$ is not summable.

Wave Packet Decay Estimates

Posted: 31 Mar 2021 09:09 PM PDT

In Tao's notes on time frequency analysis, the following theorem is stated (Theorem 5.5 of Part 1 of https://www.math.ucla.edu/~tao/254a.1.01w/).

Fix $\xi_0 \in \mathbf{R}$, and positive values $\delta_1,\delta_2$ with $\delta_1 \cdot \delta_2 \geq 1$. Fix a bump function $\psi \in C_c^\infty(\mathbf{R})$ supported on $[-1,1]$. Then define the kernel

$$ K(x) = \int e^{2 \pi i \xi \cdot x} \psi((\xi - \xi_0)/\delta_2)\; d\xi $$

and consider the convolution operator $T$ defined by the formula

$$ Tf(x) = \int K(x-y) \psi(y/\delta_1) f(y)\; dy. $$

One can see this operator as the composition of a spatial cutoff by a smooth function on $[-\delta_1,\delta_1]$, and then considering a smooth frequency cutoff on $[\xi_0-\delta_2,\xi_0+\delta_2]$. The result stated is that for $f \in L^2(\mathbf{R}^d)$, and any $n > 0$,

$$ |Tf(x)| \lesssim_n \| f \|_{L^2(\mathbf{R})} \delta_1^{1/2} ( \delta_1 d(x,[\xi_0-\delta_2,\xi_0 + \delta_2] )^{-n}. $$

The proof idea that Tao gives is relatively simple, assuming that $\delta_1 = 1$, then applying Cauchy-Schwartz to conclude that

$$ |Tf(x)| \lesssim \| f \|_{L^2(\mathbf{R})} \left( \int |K(x-y)|^2 |\psi(y)|^2\; dy \right)^{1/2}. $$

I assume the idea then is to use decay estimates for $K$ to obtain the required bound, but I'm not sure how to find these. Via this method, I was able to show that

$$ |Tf(x)| \lesssim_n \delta_1^{1/2} \delta_2^{1-n} \| f \|_{L^2(\mathbf{R})} d(x,[-\delta_1,\delta_1])^{-n}. $$

Is there a typo that makes what is meant to be proven equivalent to this bound, or am I missing something?

Differences in book definitions of $\beta$-reduction leading to confusion on when an abstraction needs to be $\alpha$-converted

Posted: 31 Mar 2021 09:00 PM PDT

I've been learning Lambda Calculus in my free time recently to try and learn how to make programming languages & interpreters. I am struggling a little bit with some inconsistencies on different texts on when to use $\alpha$-conversion to avoid capture in $\beta$-reduction.

For example, in Lectures on the Curry-Howard Isomorphism, it makes no mention of any capture restrictions in its definition of $\beta$-reduction. $$ \label{1}\tag{1} (\lambda x.P)\, Q \rightarrow_\beta P[x := Q] $$

However, in Write You A Haskell, it does

The fundamental issue with using locally named binders is the problem of name capture, or how to handle the case where a substitution conflicts with the names of free variables. We need the condition in the last case to avoid the naive substitution that would fundamentally alter the meaning of the following expression when y is rewritten to x.

$\label{2}\tag{2}[y/x](\lambda x.xy) \rightarrow \lambda x.xx$

By convention we will always use a capture-avoiding substitution. Substitution will only proceed if the variable is not in the set of free variables of the expression, and if it does then a fresh variable will be created in its place.

$\label{3}\tag{3}(\lambda x.e)\,a \rightarrow [x/a]e \quad\text{if}\quad x \notin fv(a)$

Which this piece makes sense to me that if you're substituting a free variable in the body of a lambda expression it can become captured, however the second part is what is throwing me off. The first part appears to be dealing specifically with substituting in lambda abstractions, where the second part dealing with "capture-avoiding substitution" is for any lambda expression.

So I'm not sure I understand why you would need to rename in the following case $$ \label{4}\tag{4} (\lambda x. x\ y)(\lambda y. y x) \rightarrow_\beta [x/x](x y) $$ According to $\ref{3}$, this wouldn't be allowed because $x \in FV(\lambda y. y x)$, but I don't see the problem with it and it seems pretty straightforward to reduce this to $y x$.

When I plug into a lambda calculus interpreter online with steps (such as this one), it agrees and reduces it down to $y x$ with no renaming.

Renaming seems to only apply if the body of the abstraction of the $\beta$-redex is itself another lambda abstraction, such as $$ \label{5}\tag{5} (\lambda x.\lambda y. x y)(\lambda x. x y) \rightarrow_\beta [x/(\lambda x.x y)](\lambda y. x y) $$ which seems to me also according to $\ref{3}$ would not require an alpha conversion because $x\notin FV(\lambda x.x y)$, however when I plug that into the same lambda calculus interpreter it does alpha convert.

One example that I worked out that makes perfect sense to me is the following (using the other notation/definition from Lectures on the Curry-Howard Isomorphism, side note: the differing notations confuse me also): $$ \label{6}\tag{6} \begin{align*} (\lambda y.\lambda x.x y)(\lambda z.x z) &\rightarrow_\beta (\lambda x.x y)[y := (\lambda z. x z)] \\ &\rightarrow_\alpha (\lambda a. (xy)[x := a][y := (\lambda z. x z)] &\text{if}\quad x\in FV(\lambda z. x z)\,\text{and}\, y\in FV(x y) \\ &\rightarrow (\lambda a.(a y)[y := (\lambda z. x z)] \\ &\rightarrow (\lambda a.a (\lambda z. x z)) \end{align*} $$

and the condition makes sense because you need to rename $x$ if it's in the free variables of the substitution to avoid capture, and $y$ needs to be in the free variables of the body because you can only substitute free variables.

But then when I go back to the other examples I end up re-confusing myself on when I need to rename because it seems inconsistent.

In total, the question is

  1. What am I doing wrong in the examples that are confusing me using the Write You A Haskell ($\ref{3}$) definition?
  2. Am I correct that the renaming only applies when the $\beta$-redex abstraction body is itself another abstraction?

How to solve this indefinite integral by hand? $\int \sqrt{1+\cos^2 x}\ dx$

Posted: 31 Mar 2021 09:06 PM PDT

I tried it with some substitutions and none of them has worked... So I am just wondering if it is solvable by hand?

Prove that $f_n(x) = cos^{n} x$ is not uniformly convergent on $[0, \pi]$

Posted: 31 Mar 2021 08:56 PM PDT

Prove that $f_n(x) = cos^{n} x$ is not uniformly convergent on $[0, \pi]$

Intuitively I can see that if $x=0$ or $x = \pi$ then $\lim_{n\to \infty} f_n (x) = 1$ but if $x \in (0,\pi)$, then $\lim_{n\to \infty} f_n(x) = 0$.

I tried to explain that $lim_{x\to 0^+}\{ \lim_{n\to\infty} f_n(x)\} = 0$ but $f_n(0) = 1$ so the limit does not exist which would imply that there is also no possible uniform convergence.

What is the right approach?

What are the ideals of $\mathrm{Map}(S,R)$?

Posted: 31 Mar 2021 08:53 PM PDT

Let $R$ be a commutative ring and let $S$ be a nonempty set. Let $\mathrm{Map}(S,R)$ be the set of maps $S\to R$. Then it is a ring under pointwise addition and multiplication, i.e. $$(f_1+f_2)(s)=f_1(s)+f_2(s),(f_1* f_2)(s)=f_1(s)* f_2(s)$$Then what are the ideals of $\mathrm{Map}(S,R)$? I can see that if $\mathfrak{a}$ is an ideal of $R$, then $\mathrm{Map}(S,\mathfrak{a})$ is an ideal of $\mathrm{Map}(S,R)$, but I do not know if the reverse is true, i.e. is every ideal of $\mathrm{Map}(S,R)$ of the form $\mathrm{Map}(S,\mathfrak{a})$? Thanks for your help.

I need help solving this question

Posted: 31 Mar 2021 08:54 PM PDT

$\displaystyle \text{Var} ~\left(\sum_{i=1}^n w_iX_i\right)$

[enter image description here][1] [1]: https://i.stack.imgur.com/q3CkV.png The summation applies to both w and x, not just w

It is given that:

$\displaystyle ~\left(\sum_{i=1}^n w_i\right) ~=~ 1.$

[enter image description here][2] [2]: https://i.stack.imgur.com/zJnRU.png

and expectation of x is μ, variance is σ2

I'm not too sure how they reached this answer:

$\displaystyle ~\sigma^2 \left(\sum_{i=1}^n (w_i)^2\right)$

[enter image description here][3] [3]: https://i.stack.imgur.com/gXdjW.png

Does radix 1 exist?

Posted: 31 Mar 2021 08:43 PM PDT

Hypothetical: Radix 1 has one digit, namely zero (0).

Since one could write any number in any other base with an infinite number of zeros in front of it and not change it, am I then right in assuming that radix 1 can only represent one value, which is zero as well, because that value would basically be an infinite string of zeros?

Or what is the real story behind radix 1?

Proving a commutative ring is isomorphic to Cartesian product of sets

Posted: 31 Mar 2021 08:43 PM PDT

I'm having trouble finding a starting point for this problem:

Let $R$ be a commutative ring containing elements $a, b$, both $\neq 0_R$ such that: $$ a + b = 1_R,\ a^2 = a,\ b^2 = b,\ and\ a · b = 0_R $$ Show that the ideals $Q := R · a$ and $S := R · b$ are rings, but not subrings of $R$, and that the ring $R$ is isomorphic to the ring $Q×S$.

Given the $Q×S$ ring follows $(r,s) + (r', s') = (r+r', s+s')$ and $(r,s)·(r',s') = (rr', ss')$

I understand that if $R$ is isomorphic to $Q×S$, then that would mean that $a = (1_R, 0_R)$ and $b = (0_R, 1_R)$ satisfies all of the conditions, and by extension how they are not subrings.

I just can't for the life of me determine how to use that information to prove that $R$ is isomorphic to $Q×S$ without circular reasoning.

Rewriting higher powers in $K[x]/(p)$

Posted: 31 Mar 2021 09:00 PM PDT

Suppose $p = \sum a_i x^i \in K[x]$ is a polynomial of degree $n$ over some field $K$. Assume WLOG that $a_n = -1$, so we can rewrite the equation $p = 0$ as

$$x^n = \sum_{i=0}^{n-1} a_i x^i$$

Working now in the ring $K[x]/(p)$, this equation allows us to rewrite higher powers $x^m$, $m \geq n$ uniquely as a linear combination of $1,x,x^2,\ldots,x^{n-1}$, i.e. a polynomial of degree at most $n-1$. Is an explicit formula known for this representation? I worked out (might be some mistakes):

$$ x^{n+1} = \sum_{i=0}^{n-1} (a_{i-1} + a_{n-1}a_i) x^i $$

$$ x^{n+2} = \sum_{i=0}^{n-1} \big( a_{i-2} + a_{n-1} a_{i-1} + (a_{n-2} + a_{n-1}^2)a_i \big) x^i $$

but couldn't see an obvious pattern to prove inductively.


More generally, it seems that for any $p \in K[x]$ of degree $n$, $K[x]/(p)$ is canonically $K$-vector space of dimension $n$, having a canonical basis $\{ 1,x,x^2,\ldots,x^{n-1} \}$. Here, the "multiplication by $x$ map" $q \mapsto xq$ seems to be an interesting linear map - is anything known about this?

Partial derivative of composite function of multivariate gaussian

Posted: 31 Mar 2021 09:14 PM PDT

I would like to find the partial derivative of $f(y)$ with respect to c where $y$ follows multivariate normal/Gaussian density $N(x(t),\sigma^2I_n)$ i.e.

$f(y)=(2\pi)^{-\dfrac{n}{2}}|\sigma^2I_n|^{-\dfrac{1}{2}}exp[-\dfrac{1}{2}(y-x(t))^T|\sigma^2I_n|^{-1}(y-x(t))]$

Here, $x(t)=\dfrac{\exp(z(t))}{\int_a^p \exp(z(s))\,\text{d}s}$ and $z(t)=b(t)^Tc + b(t)^TAu$. I could do it if $x(t)$ is a function of $c$, but I am kind of lost at the very beginning since $x(t)$ is a composite function of $c$ i.e $x(t)=g(h(c))$.

N.B. Here the dimensions: $A$ is $p*p$, $b(t)$ is $p*n$, $c$ & $u$ is $p*1$, so $z(t)$ is $n*1$. And $\sigma^2I_n$ is the $n*n$ variance-covariance matrix.

Using the chain rule $\frac{\partial f(y)}{\partial c}= \frac{\partial f(y)}{\partial x(t)} *\frac{\partial x(t)}{\partial z(t)}*\frac{\partial z(t)}{\partial c}$ I have got ,

$\frac{\partial z(t)}{\partial c}= b(t)^T$

$\frac{\partial x(t)}{\partial z(t)} = x(t) - x(t) \frac{\int_a^p exp({z(s)})\frac{\partial z(s)}{ \partial z(t)}ds}{\int_a^bexp(z(s))ds}$

$\frac{\partial f(y)}{\partial x(t)} = N(x(t),\sigma^2I_n)|\sigma^2I_n|^{-1}(y - x(t)) $

Is using the chain rule is right path? If not, what else? If yes, is the partial derivatives are correct? It's looks too complicated, I thought the final result would be comparatively simple.

Probability a given markov chain is in two different states at two different times

Posted: 31 Mar 2021 08:46 PM PDT

Let us say that our state space $S = \{1, 2, 3, 4\}$

Now let us say our transition matrix $P$ is given by: \begin{bmatrix} 1/2 & 1/2 & 0 & 0 \\ 1/3 & 0 & 1/3 & 1/3 \\ 1/6 & 1/6 & 2/3 & 0 \\ 1/2 & 1/4 & 1/4 & 1/2 \end{bmatrix}

Given that a Markov chain $X_n$ is in state 3 at time 0 (i.e $X_0 = 3$), what is the probability that it is in state 1 at time 4 and state 2 at time 5? To rephrase the question, given that $X_0 = 3$, what is the probability that $X_4 = 1$ and $X_5 = 2$ both occur

Originally, the way I thought to go about answering this question was to take the row matrix $\pi_0$:

\begin{bmatrix} 0 & 0 &1&0 \\ \end{bmatrix}

which gives the probability distribution of the Markov chain at time 0, and take the first entry of the row matrix given by $\pi_0P^4$, (the probability of the Markov chain being in state 1 at time 4) and the second entry of the row matrix given by $\pi_0P^5$ (the probability of the Markov chain being in state 2 at time 5, and multiplying these two entries together to get our final answer. However, this would require the two events to be independent, which, due to the definition of Markov processes, I am not sure they are. Is this approach correct? If not, how would you solve this problem?

Show that $[L : Q(t)]$ is dependent on the choice of inclusion map $\phi$

Posted: 31 Mar 2021 08:58 PM PDT

Let $Q(t)$ denote the field of rational functions. And let $\phi: Q(t)\to L $ denote an inclusion map to some field $L$. Give an example such that $[L : Q(t)]$ is dependent on the choice of $\phi$.

I'm thinking of the evaluation map $f_\pi(q)= q(\pi)$, which must be injective because $\pi$ is not algebraic. And then work on comparing the index $[\mathbb{R} : f_\pi(Q(t))]$ and $[\mathbb{R} : f_e(Q(t))]$ to get an counterexample. However, it seems $Q(t)$ is countable so any inclusion map to $\mathbb{R}$ will have an infinite index. Any suggestions for other examples?

How to describe these combinatorial sets in general and prove their cardinality

Posted: 31 Mar 2021 08:56 PM PDT

The sets I am looking at are defined as follows: for $k=1$ the set is defined as:

$\Sigma_1:=\Big\{ \frac{1}{1},\frac{1}{3}\Big\}$

whereas for $k=2$ we have

$\Sigma_{2}:=\Big\{ \frac{1}{1},\frac{2}{1},\frac{3}{1},\frac{1}{2},\frac{1}{3},\frac{1}{5},\frac{3}{5},\frac{1}{7} \Big\}$

and for $k=3$ we have

$\Sigma_{3}:= \Big\{ \frac{1}{1},\frac{2}{1},\frac{3}{1},\frac{5}{1},\frac{1}{2},\frac{3}{2},\frac{1}{3},\frac{2}{3},\frac{5}{3},\frac{1}{4},\frac{1}{5},\frac{3}{5},\frac{1}{7},\frac{3}{7},\frac{5}{7},\frac{1}{9},\frac{1}{11} \Big\}$

I struggle finding a general rule for this. However, I am quite sure that the cardinality of each $\Sigma_{k}$ is equal to three times the triangular number minus one i.e.

$\frac{3k(k+1)}{2}-1$

since from above we may observe that

$|\Sigma_1| = 2$, $|\Sigma_2|=8$, $|\Sigma_3|=17$.

Edit: $\Sigma_4$ would be defined as

$\Sigma_4 := \Big\{ \frac{1}{1},\frac{2}{1},\frac{3}{1},\frac{4}{1},\frac{5}{1},\frac{7}{1},\frac{1}{2},\frac{3}{2},\frac{1}{3},\frac{2}{3},\frac{4}{3},\frac{5}{3},\frac{1}{4},\frac{3}{4},\frac{1}{5},\frac{2}{5},\frac{3}{5},\frac{7}{5},\frac{1}{7},\frac{3}{7},\frac{5}{7},\frac{1}{9},\frac{5}{9},\frac{7}{9},\frac{1}{11},\frac{3}{11},\frac{1}{13},\frac{1}{15} \Big\}$

Is there any way of deriving a general formula for each $\Sigma_k$ and proving this cardinality? Notice that in each set $\Sigma_k$ for each $\frac{n}{m}$ you want to have $\text{gcd}(n,m)=1$.

Each set corresponds to positive slopes found in $1$, $2$ and $3$ layered hexagons divided by $\sqrt{3}$. For instance, the first set describes positive slopes in a single regular hexagon divided by $\sqrt{3}$, in particular, $\frac{1}{\sqrt{3}} \rightarrow \frac{1}{1}$ and $\frac{\sqrt{3}}{3} \rightarrow \frac{1}{3}$. The set $\Sigma_3$ would correspond to the positive slopes found in the given image minus $0$ and $\infty$. For example, the points 13 and 32 in the given image would define the slope $\sqrt{3}$ which corresponds to $\frac{1}{1}$ and 20 and 24 define the slope $\frac{\sqrt{3}}{5}$ which corresponds to $\frac{1}{5}$.

enter image description here

How do I do Fourier decomposition in non-sinusoidal basis of even polynomial functions.

Posted: 31 Mar 2021 09:10 PM PDT

I've been studying atan(x)/x approximations and using infinite series to help me adjust coefficients of approximating formulas.

One of the approximations elements I use is the function $x^2/(1+|x|)$ which is supposed to produce a graph similar to a hyperbola but should produce a Taylor series with all even powers. (eg: it's symmetrical across x=0).

When I plug this equation into Mathematica, I get a Taylor series that has the absolute value of odd powers. The online widget lists it as a "Parseval" series.

I can't compare the coefficeints of a Parseval series to those of an even-only powered taylor series. Mathematica's answer is useless to me.

I believe the Taylor series produced by Mathematica must not be unique, and I want to re-compute the Parseval series in terms of even powers alone. The function is even, and this SHOULD be possible to do.

If you could guide me in doing this, I would appreciate it.

Here's what I've tried so far, and where I get stuck:

The only way I know to reformulate an infinite series into another infinite series and still be sure it will converge, is to use a Fourier style decomposition to replace Taylor series expansion.

I realize that I need to replace the Fourier sin() cos() basis set with polynomial parts. Apparently this is a well known possibility to mathematicians.

Fourier transform with non sine functions?

But, I don't have the vocabulary to locate practical tips to carry it out to completion.

However, I do know from linear algebra that I can treat polynomial terms as Fourier basis vectors; I'm going to replace each $a x^n$ term of a Taylor expansion with a 'vector' that has an average value of zero and an inner product of 1.

This is my basis set:

$x^n \rightarrow { (1+{1 \over n}) \sqrt { n+ 1 \over 2 } ({ {x^n - 1} \over {n+1} }) }$

The inner product of any two vectors is defined as usual for Forier analysis for period P=2. It will be the definite integral of the product of vector functions over the region x=[-1:+1].

Not surprisingly, when I test the inner product of the vector for x^2 with x^3, they are not orthogonal. They are normal to each other.

The test verifies that polynomial terms in an infinite series are not unique, because a certain amount of each term's coefficient may be represented as a linear combination of other terms.

So, what's left for me to do is to ortho-normalize my basis set; and then use the orthonormal basis in a Fourier decomposition on my original function.

However, the only way I know to do the orthonormalizaation is Grahm-Schmidt process; and when I do that, it's going to change the basis set from singular polynomial terms into linear combinations of them.

There are several arbitrary decisions that have to be made ... and I'm wondering if someone has already done this process before, and how they chose to deal with the trade offs (and why.)

I'm thinking that naively orthogonalizing the series with the x^2 vector first has the dis-advantage of emphasizing the ability of x^2 to absorb the non-orthogonal representation of higher order terms. It sort of would change the meaning of 'x^2'... !

What I really would like is the Fourier decomposition into each orthogonalized vector to produce a number which is proportional to the uniqueness (or mandatory) use of the corresponding Taylor series coefficient.

eg: the value for the x^2 vector's coefficient should represent the minimum or 'above average' amount of x^2 that is required to reconstruct my Fourier decomposed function. Note: The value for the X^2 coefficient does not need to be the same as the value for the taylor coefficent of x^2 term, but the Fourier computed coefficient should have some kind of logical relationship to the Taylor coefficient so that I can compare them.

I assume that I need to have some kind of 'average' vector that represents the most common linear dependency among polynomial terms, so that I can use it to make my x^2 vector NOT absorb more than an average amount of the non-orthognality of higher order vectors. eg: A vector to represent the average linear dependency of higher order terms, and use that as the 'first' vector in the Gram Schmidt process. At the same time, since the basis set is infinite, I can't actually construct such an 'average' vector exactly... It's sort of an ill defined problem.

I tried an experiment; I took the inner product for the $x^2$ vector with all the following vectors up to $x^{24}$ to produce a table of how much the vectors are linearly related.

Inner product of normalized x^2 vector with itself, and higher order vectors.

[100%,.958315,.895806,.83814,.788227,.745356,.708329,.676065,.647689,.622514,.600000,.579721,.561339,.544579,.52922,.515079,.502005,.489871,.478571,.468014,.458123,.44883,.44079,.431818,.424004 ]

Conceptually this is a table that corresponds in linear algebra to the cosine of the 'angle' between vectors. The more non-zero an entry is, the more linear dependence the vecotor has with x^2.

I've tried to construct an average vector by adding the non-orthogonal vectors together in proportion to value in the list. eg: in proportion to the cosine() of the angle between vectors. I'm not sure this is a good choice, but it has the virtue of emphasizing the importance of lower order vectors in the average. In infinite series, convergence is determined by the error of higher order terms going to zero .. so this de-empahsizing higher order terms seems logical. But, again,it's an arbitrary attempt.

None the less, I graphed the normalized results of the averaging, and I get a graph which suggests that the process is converging toward a shape that is very stable in certain places of the graph. I believe that convergence is what linear dependence is ... and non-orthogonality in my basis set. (Am I in error?)

But, I don't quite see a practical way of determining an analytical function from my graph that is both simple (eg: non infinite in terms...!) and would still extract or represent the most common non-orthogonality among the polynomial terms.

enter image description here

Basic Triangle Geometry on GRE: Length of one side of a triangle?

Posted: 31 Mar 2021 09:05 PM PDT

Practice GRE problem that is giving me more trouble than it should. Why is the answer: 'The relationship cannot be determined?'

My answer was that the two quantities are equal--but that is clearly wrong.

GRE Question

Diagonalization of a Matrices Represent Change of Basis.

Posted: 31 Mar 2021 09:09 PM PDT

In our examination of Mathematical Physics course, a question came which had a matrix written in the standard basis for a 2 by 2 matrix. Now he changed the basis of the given matrix and told us to write the new matrix in terms of these new basis.

I gave it a try by solving and finding the eigenvalues of the matrix (whom to be written in new basis) and now my doubt arises that should i ow use their eigenvectors or what. and if i use them, what to do next.

I tried looking for answers and found a you-tube link (https://www.youtube.com/watch?v=s4c5LQ5a4ek&t=530s), but was unable to catch up.

I need to clear this doubt as my professor said it will play a huge role in Quantum Mechanics that denationalization of matrices or similarity transformation represent change of basis.

Edit- I know the 3 important properties of matrices to be similar. Being a Physics student, would appreciate every possible explanation of it.

Integral inequalities of complex function

Posted: 31 Mar 2021 08:40 PM PDT

Why do these inequalities hold $?$. When does the equality hold $?$. \begin{align} \left\vert\,{\int_{c\ \pm\ {\rm i}T}^{r\ \pm\ {\rm i}T} \frac{x^{-s}}{s}\,{\rm d}s}\,\right\vert\ & \leq\ \int_{c}^\infty \frac{x^{-\sigma}}{\sqrt{\sigma^{2} + T^{2}}}\,{\rm d}\sigma \\[4mm] \left\vert\,{\int_{c\ -\ {\rm i}T}^{r\ +\ {\rm i}T} \frac{x^{-s}}{s}\,{\rm d}s}\,\right\vert\ & \leq\ \pi x^{-c} \end{align}

for $ x > 1,\ r > c$.

Image of a region under the Mobius transformation $f(z) = \frac{z+1}{i(z-1)}$

Posted: 31 Mar 2021 09:06 PM PDT

I have a function $$f(z) = \frac{z+1}{i(z-1)}.$$ And I have a triangle enclosed by the vertices $0$, $1$ and $i$. I am trying to draw the image of the triangle under $f$ on the standard complex plane.

I know that $f(0) = i$ and $g(i) = -1$ and $g(1)$ goes to infinity. But I'm having trouble drawing the actual image, especially since $g(1)$ goes to infinity.

I also know that $f$ is a mobius transformation. Is there a trick to determining the image?

Pick r from n with arrangement

Posted: 31 Mar 2021 09:17 PM PDT

I'm self-learning combination theory and encountered this problem.

How many distinct $4$ digit number can be formed from picking numbers in $1,3,3,7,7,8$?

I'm thinking to permute all numbers then eliminate duplicates $3$ and $7$ so ${6!\over2!\times2!} = 180$. Then pick first $4$ digit and eliminate arrangement from the last two so $\frac{180}{2!} = 90$

I don't think this is correct since the second elimination will overcount.

How do I approach this kind of problems?

Solving a first order quasilinear PDEs using the idea of characteristics

Posted: 31 Mar 2021 08:44 PM PDT

I was considering the following problem:

$$u_t+uu_x=1$$

Then I put this in the form of $\frac{du}{dt}=1,$ $\frac{dx}{dt}=u$ and deduced that the general form would be $$u=t+f(x+\frac{1}{2}t^2−ut)$$

for some arbitrary function $f$ that should be determined via initial condition. Up to this step I am confident that I am correct.

Problem:

So as a sanity check I wanted to make sure the $u$ I found indeed would satisfy the PDE. So I calculated its partial derivatives as follows:

$u_t=1+(t-u)f'(x+\frac{1}{2}t^2−ut)$, $u_x=f'(x+\frac{1}{2}t^2−ut).$ Plug everything in I have that

$$u_t+uu_x=1+tf'$$

But I was expecting it to be just $1$? Where have I gone wrong? Have I used the chain rule on partial derivatives incorrectly? Many thanks in advance!

Edit

I saw where my mistake is now. I was meant to partial differentiate rhs as well since $u$ lies in the argument.

Calculate integral $\int_0^{\infty} \frac{(1-at²)\cos(nt)}{(1+bt²)³}dt$

Posted: 31 Mar 2021 08:45 PM PDT

How to calculate the following definite integral containing cosine and rational function of polynomial $$ \int_{0}^{\infty}\frac{\left(1 - at^{2}\right)\cos\left(nt\right)}{\left(1 + bt^{2}\right)^{3}}\,{\rm d}t\ ? $$

Here $a, b$ and $n$ are positive constants, greater than $1$.

Are there any known infinite series of rational terms that are just irrational (not transcendental)?

Posted: 31 Mar 2021 09:09 PM PDT

I have probably encountered hundreds of infinite series where each term is rational. In each case (as far as I can remember), the value of the infinite series was either rational or transcendental.

For example, some simple cases include: $$\begin{align} \sum_{r=1}^{\infty}\frac{1}{2^r}&=1\\ \sum_{r=1}^{\infty}\frac{1}{r^2}&=\frac{\pi^2}{6}\\ \sum_{r=1}^{\infty}\frac{1}{r^2+1}&=\frac{1}{2}(\pi\coth\pi-1). \end{align}$$ I realize that it's definitely not known that it's true that infinite series of rational terms can only be rational or transcendental, as otherwise we wouldn't say that $\zeta(3)$ and other constants are irrational; we'd immediately be able to say that they are transcendental, so I'm not asking that. I'm asking if anyone knows of any infinite series of rational terms that is just irrational, not transcendental.

Thank you for your help.

Proof that $\forall r \in \Bbb Q$, if $3r-\frac12s\in\Bbb{\bar Q}$ then $s\in\Bbb{\bar Q}$

Posted: 31 Mar 2021 08:54 PM PDT

Proof that $\forall r \in \Bbb Q$, if $3r-\frac12s\in\Bbb{\bar Q}$ then $s\in\Bbb{\bar Q}$

I'm unsure about the notation in this proof (specifically what $\Bbb{\bar Q}$ means) and how to go about it. Any help would be appreciated.

semi-simple and simple lie group,SO(n) for n even

Posted: 31 Mar 2021 08:58 PM PDT

It is stated in the literature that SO(n) for n even is semi-simple or simple and either one of these means that it has no non-identity abelian factor groups but I,-I is an order 2 abelian factor group which is contained in SO(n) which contradicts this. Also if eliminate this one possibility,or say SO(n)/{I,-I} for n even >1, I would say SO(n) would be simple and not semi-simple . Can anyone give example of why these(my) statements are not true. It is stated in the literature that SO(n)/{I,-I} ,n even, is simple except for n=4 which is stated as only semi-simple. How can that be - in particular in the natural 4x4 matrix representation what exactly is a possible proper normal subgroup ? It can't be restricted to the space of any 2 or 3 dimensional submatrix that is where every element of the normal subgroup has a 1 on a certain diagonal(s). Could a normal subgroup be taken as a finite group? No but found an answer in Lie Algebras for Physicists by Ashok Das and Susumo Okubo, kupdf.net_das-amp-okubo-lie-groups-and-lie-algebras-for-physicist.pdf, pages 93-4. Subgroups $\exp(a_1J_1+a_2J_2+a_3J_3)$ for all constants $a_i$ or same but $J_i$ replaced by $K_i$ since $[J_i,K_j]=0$ and SO(4) is direct product of the two SO(3) type groups. Now would like to have a general proof of why the same type of analysis and development could not yield proper normal subgroups in SO(n) for n>4. I think possibly a similar type of analysis holds for the discrete finite alternating permutation group.

What is the proper way to exclude multiple specific numbers from a set?

Posted: 31 Mar 2021 09:09 PM PDT

I'm working on some homework, and my google-fu isn't helping me out with this question. I've already solved it, but I need to put it into the proper notation in order to get full credit. I've already figured out that the range is $[-5,\infty)$, but I can't figure out the proper notation, nothing looks right to me. I feel like the answer should be $\mathbb R\setminus \{(-\infty, -5)\}$ ?

(the question in question: Find the largest possible subset $A$ of $\mathbb R$ that will make the following functions well-defined. $A\to \mathbb R$ given by $f(x) = \sqrt{3x+15}$: The range where the question is well defined is from $-5$ to infinity, but I don't know how to "formally" say it.

Can a function have a domain and codomain of binary numbers?

Posted: 31 Mar 2021 09:10 PM PDT

I saw a thread regarding functions and I have a related question.

Is it possible to have a function where the domain and the codomain are binary numbers?

For a decimal number $x\in \{0, 1, \dots, 2^n-1\}$ we have the binary respresentation \begin{align} x &= x_02^0 + x_12^1 + x_22^2 +\ldots+ x_{n-1}2^{n-1} \\ &= x_0 x_1 \cdots x_{n-1} \end{align} where $x_0,\ldots,x_{n-1}\in\{0,1\}$. We also have a second binary number \begin{align} y &= y_02^0 + y_12^1 + y_22^2 +\ldots+ y_{n-1}2^{n-1} \\ &= y_0 y_1 \cdots y_{n-1} \end{align} where $y_0,\ldots,y_{n-1}\in\{0,1\}$.

Question 1:

Can we now have a function with the domain $\{x\}$ and the codomain $\{y\}$? I.e. $$ f:\{x\} \rightarrow \{y\} \tag 1 $$

Question 2:

Is the function notation in $(1)$ equivalent to the following: $$ f:\{x_02^0 + x_12^1 + x_22^2 +\ldots+ x_{n-1}2^{n-1}\} \rightarrow \{y_02^0 + y_12^1 + y_22^2 +\ldots+ y_{n-1}2^{n-1}\} \tag 2 $$ $$ f:\{x_0x_1\cdots x_{n-1}\} \rightarrow \{y_0y_1\cdots y_{n-1}\} \tag 3 $$ If so, which notation is most correct/common?

convex hull of a lower hemicontinuous correspondence is lower hemicontinuous

Posted: 31 Mar 2021 09:01 PM PDT

Let $(X, \mathcal{T})$ and $(Y, \mathcal{T}')$ be two topological spaces.

We call a correspondence (set-valued function) $F: X \rightarrow 2^Y$ lower semicontinuous if for every $G \in \mathcal{T}'$ , $\{x \in X\mid F(x) \cap G \neq \phi\} \in \mathcal{T}$ holds.

Consider a lower semi-continuous correspondence $F: X \rightarrow 2^Y: x \mapsto F(x)$. Show that $c(F): X \rightarrow 2^Y: x \mapsto c(F(x))$ , where $c(A)$ denotes the convex hull of $A$ in $Y$, is also lower semi-continuous.

This is a claim I came across in C.D. Aliprantis and K.C. Border's "Infinite Dimensional Analysis: A Hitchhiker's Guide". It is also a proposition in Ernest Michael's first paper on Continuous selections. However, I'm failing to prove this by just using the definitions I know.

How page rank relates to the power iteration method

Posted: 31 Mar 2021 09:05 PM PDT

I do not see how pageRank relates to the power method. Since for the pageRank we are looking for the steady stable state (vector) for a Markov (transition) matrix and the matrix has already an eigenvalue equals to one, why multiplication is used throughout the iterations to converge into that vector. Knowing that the only things that changes during the iterations are the eigenvalues with absolute value less than 1 and their corresponding "disappearing" eigenvector.

Therefore, why this not done by factoring the Markov matrix to find the eigenvector corresponds to eigenvalue 1 instead of the iterative multiplication approach?