text:
Python Beginner Algorithms Tutorial

# Valid Parentheses (via Leetcode)

This example was found on Leetcode.

I'll extensively walk through how I'd solve this problem.

### Problem statement¶

You're given a string containing just the following characters: "(", ")", "{", "}", "[", "]". Determine if the input string is valid.

Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. An empty string is also considered valid.

### Test cases¶

Test case #1:

• Input: "[]"
• Output: True
• Reasoning: The open bracket is closed by the same type of bracket in the correct order.

Test case #2:

• Input: "[{]}"
• Output: False
• Reasoning: The first closing bracket of "]" closes that type out before the a previous "[" needed to be closed first. Open brackets are not closed in the correct order.

Test case #3:

• Input: "({}]"
• Output: False
• Reasoning: The open bracket of "(" is never closed. There's a closing bracket of "[" but that doesn't match.

Test case #4:

• Input: "[[{}]]"
• Output: True
• Reasoning: All open brackets are closed by the same type of brackets and in the correct order.

I can write out assert statements in Python for these 4 test cases and the empty string consideration one.

In [1]:
# assert valid_parentheses("[]") == True

# assert valid_parentheses("[{]}") == False

# assert valid_parentheses("({}]") == False

# assert valid_parentheses("[[{}]]") == True

# assert valid_parentheses("") == True

### Logic for Solution¶

I will have to examine every element in the input string. Therefore, I should iterate over it. A string is a Python sequence that allows for iteration over every element.

When I think about the input "[{]}", I know that every successive open bracket must be closed by the same type before an earlier open bracket is closed. Let me write out a few step-by-step examples on how I'd solve this.

One data structure that comes to mind here is a stack. A stack stores elements in what seems like a list, but it is optimized by time complexity for operations by last-in-first-out - aka "LIFO" - and first-in-first-out - aka "FIFO".

A stack optimized data structure in Python is found in the collections package and deque module. For a deque, use the append method to insert an element into the end of the structure and pop to remove an element from the end of the structure.

Operations for "[{]}":

1. Iterate over element "[". Since it's an open bracket, append to deque b/c open bracket.
2. Iterate over "{". Since it's an open bracket, append to deque b/c open bracket.
3. Iterate over "]". Since it's a closed bracket, compare this to the last item in the deque. This element is a different type than the last item in the deque. Therefore, return False.

Operation for "[[{}]]":

1. Iterate over element "[". Since it's an open bracket, append to deque b/c open bracket.
2. Iterate over element "[". Since it's an open bracket, append to deque b/c open bracket.
3. Iterate over element "{". Since it's an open bracket, append to deque b/c open bracket.
4. Iterate over element "}". Since it's a closed bracket, compare this to the last item in the deque. This is element is the same type as the last item in the deque. Pop out last item added to deque.
5. Iterate over element "]]". Since it's a closed bracket, compare this to the last item in the deque. This is element is the same type as the last item in the deque. Pop out last item added to deque.
6. Iterate over element "]". Since it's a closed bracket, compare this to the last item in the deque. This is element is the same type as the last item in the deque. Pop out last item added to deque.
7. Return True

This pseudocode generally explains the step logic.

In [2]:
# from collections import deque

# create a function with string as an input
# create an empty deque
# create dict in which keys are open brackets and values are of the same type closed brackets

# iterate over each character in input string
# if it's an open bracket
# append item to deque

# else if it's a closed bracket and there are no brackets in our stack
# we can't add a closed bracket as the first in our stack b/c it's invalid
# return False
# else:  # it's a closed bracket
# if this closed type is the same as the last open type in the stack
# pop out last item in deque
# else:
# this is the wrong match so return False to break out of function
# finished iteration...
# if length of deque is 0 meaning all open brackets have been closed properly
# return True
# else:  # there are open brackets that haven't been closed
# return False

### Code¶

In [3]:
from collections import deque
import logging

logging.basicConfig(level=logging.DEBUG, format='%(asctime)-25s %(levelname)-7s %(lineno)-4s %(message)-8s')

def valid_parentheses(brackets_string):
"""
Compute if a string is a valid parentheses string such as "{}" or "{[[]]}"

param brackets_string: the string to validate if it's a valid parentheses
return boolean: True if brackets_string is a valid parentheses
"""

logging.debug("assign empty deque to open_brackets_stack...")
open_brackets_stack = deque()

logging.debug("create dict in which keys are open brackets and values are of the same type closed brackets")
bracket_pair_dict = {'[': ']',
'{': '}',
'[': ']'
}

logging.debug("iterate over each character in input string...")
for bracket in brackets_string:
logging.debug(f"bracket: {bracket}")
logging.debug("check if bracket is an open type...")
if bracket in bracket_pair_dict:
logging.debug("append bracket to stack...")
open_brackets_stack.append(bracket)
elif bracket not in bracket_pair_dict and len(open_brackets_stack) == 0:
logging.debug("closed bracket can't be the first item in a valid stack...")
return False
else:
logging.debug("under this condition we have a closed bracket and there are items in the stack...")
logging.debug(f"{bracket} is a closed bracket...")
logging.debug("check if this closed type is the same as the last open type in our stack...")
last_open_in_stack = open_brackets_stack[-1]
logging.debug(f"last_open_in_stack: {last_open_in_stack}")

if bracket_pair_dict[last_open_in_stack] == bracket:
logging.debug("we have a match of same open and closed type...")
logging.debug("pop out last item in stack...")
open_brackets_stack.pop()
else:
logging.debug("we have a mismatch of the open and closed type...")
return False

logging.debug("loop has finished...")
if len(open_brackets_stack) == 0:
logging.debug("length of stack is 0 so all open brackets have been closed in proper order...")
return True
else:
logging.debug("still open brackets in the so they haven't been properly closed...")
return False

In [4]:
assert valid_parentheses("[]") == True

2020-03-14 18:12:04,558   DEBUG   9    assign empty deque to open_brackets_stack...
2020-03-14 18:12:04,559   DEBUG   12   create dict in which keys are open brackets and values are of the same type closed brackets
2020-03-14 18:12:04,561   DEBUG   18   iterate over each character in input string...
2020-03-14 18:12:04,562   DEBUG   20   bracket: [
2020-03-14 18:12:04,563   DEBUG   21   check if bracket is an open type...
2020-03-14 18:12:04,564   DEBUG   23   append bracket to stack...
2020-03-14 18:12:04,566   DEBUG   20   bracket: ]
2020-03-14 18:12:04,567   DEBUG   21   check if bracket is an open type...
2020-03-14 18:12:04,569   DEBUG   29   under this condition we have a closed bracket and there are items in the stack...
2020-03-14 18:12:04,570   DEBUG   30   ] is a closed bracket...
2020-03-14 18:12:04,570   DEBUG   31   check if this closed type is the same as the last open type in our stack...
2020-03-14 18:12:04,571   DEBUG   33   last_open_in_stack: [
2020-03-14 18:12:04,572   DEBUG   36   we have a match of same open and closed type...
2020-03-14 18:12:04,573   DEBUG   37   pop out last item in stack...
2020-03-14 18:12:04,574   DEBUG   43   loop has finished...
2020-03-14 18:12:04,575   DEBUG   45   length of stack is 0 so all open brackets have been closed in proper order...

Turn off logging messages for the rest of the test cases.

In [5]:
logger = logging.getLogger()
logger.disabled = True

In [6]:
assert valid_parentheses("[{]}") == False

assert valid_parentheses("({}]") == False

assert valid_parentheses("[[{}]]") == True

assert valid_parentheses("") == True


text:
# Help: All subspaces of 2x2 diagonal matrices

Tags:
1. Sep 24, 2015

### kostoglotov

The exercise is: (b) describe all the subspaces of D, the space of all 2x2 diagonal matrices.

I just would have said I and Z initially, since you can't do much more to simplify a diagonal matrix.

I cannot understand how D is $R^4$, let alone the rest of the answer. I kind of get why there'd be orthogonal subspaces in that case, since it's diagonal...but that's just grasping at straws.

I can see how we might take the columns of D and form linear combinations from them, but those column vectors are in $R^2$

2. Sep 24, 2015

### WWGD

Maybe they are using the identification of a matrix $(a_{ij})$ with the $i \times j$-ple (i.e., a point in $\mathbb R^{i \times j}$) given by : $(a_{11}, a_{12},...., a_{ij})$ , i.e., you use a double-alphabet ordering to do the identification. $2 \times 2$ diagonal matrices are then identified with the set $(a, 0,0,b) :a, b \in \mathbb R$.

3. Sep 24, 2015

### FireGarden

In short, the set of 2x2's with real entries is just a silly way of writing $\mathbb{R}^4$.

A 2x2 matrix is of course going to be a set of 4 independent real numbers. Independent in the sense that the elements do not constrain one another. We add component-wise, and we perform scalar multiplication component-wise. Really, this is exactly how we work with row/column vectors. We've just written them down differently. Thinking of them as actual matrices is misleading, I think. The question's solution then follows by describing (very generally) that the subspaces are just (any!) spaces of dimension 0,1,2 and 3. 1D subspaces always have to pass through the zero vector, that's nothing special about this case.

4. Sep 24, 2015

### WWGD

But the diagonal matrices are already a subspace of $\mathbb R^4$ whose 2nd, 3rd entries are both $0$. That makes it into a 2-dimensional subspace of $\mathbb R^4$.

5. Sep 25, 2015

### FireGarden

Oh, I didn't read the requirement for the matrices to be diagonal. We still get some of the 1 dimensional subspaces and the zero subspace anyway - the second and third entries must be zero to be diagonal, but we could just as well fix the first and/or fourth to be zero, and we will still have a diagonal matrix. I'm not sure why the answer claims there are 3 dimensional subspaces in this case though..

format: plain


text:
# achemso package in suppinfo mode does not show Contents

I am writing a JACS communication Supporting Information in Latex using achemso package where the manuscript type set to suppinfo.

\documentclass[journal=jacsat,manuscript=suppinfo]{achemso}

I am then calling for the contents (sections and subsections) with:

\tableofcontents

As here in the simplified form

\documentclass[journal=jacsat,manuscript=suppinfo]{achemso}
\title{Title goes here}

\begin{document}

\tableofcontents

\end{document}

But I get an empty contents section

How can I fix that?

• Do you compile your document twice? Welcome to TeX.SE! – Zarko May 9 '17 at 12:20
• Yes I did multiple times but doesn't work.. Thanks! – Yigit Altay May 9 '17 at 12:21
• unfortunately I'n not familiar with achemso document class. With article your MWE works as expected. Hopefully here are some users who will be able help you. – Zarko May 9 '17 at 12:38
• indeed it is something related to the achemso package. I also tried with simple article class and it works... – Yigit Altay May 9 '17 at 12:42

The standard settings used unnumbered sections for supinfo: these are not written to the .toc file. You need to add
\SectionNumbersOn

before \begin{document} to reactivate them.


text:
## вторник, 13 октября 2020 г.

### ScopedTypeVariables to fix type safety flaws

Recently I struggled to implement a simple converter from a type representing an integer number of seconds to NominalDiffTime from module Data.Time.Clock. For simplicity, let the original type be a simple Integer value counting a number of seconds. It felt like the solution was straightforward. Indeed, the module provides a dead simple conversion function secondsToNominalDiffTime of type Pico -> NominalDiffTime. Type Pico is a fixed-precision value from module Data.Fixed with twelve digits after the dot. Below is the original definition of conversion function toNominalDiffTime in GHCi REPL.

GHCi, version 8.10.2: https://www.haskell.org/ghc/  :? for help
Prelude> import Data.Fixed as F
Prelude F> import Data.Time.Clock as TC
Prelude F TC> toNominalDiffTime = secondsToNominalDiffTime . MkFixed . (resolution (undefined :: Pico) *)
Prelude F TC> :t toNominalDiffTime
toNominalDiffTime :: Integer -> NominalDiffTime
Prelude F TC> toNominalDiffTime 23
23s
Prelude F TC> toNominalDiffTime 2383747764736464646
2383747764736464646s

Notice that the original value must be multiplied by the resolution of Pico (i.e. 1000000000000), otherwise the converted value will be one picosecond.

Looks good, does it? Nope… This explicit type annotation of undefined is frustrating. What if I make a mistake and put another type instead?

Prelude F TC> toNominalDiffTime = secondsToNominalDiffTime . MkFixed . (resolution (undefined :: Nano) *)
Prelude F TC> toNominalDiffTime 23
0.023s

In many contexts, this is a catastrophe! How do I get rid of the explicit type declaration? Why did I put it here after all? The root of the problem is that resolution gets fed with an Integer value, while it requires a Fixed value. This is why we created an undefined object of type Pico which is a type synonym of Fixed E12. After getting the resolution from this object and multiplying this by the original value, the calibrated value gets piped to constructor MkFixed which expects an integer value calibrated with resolution of Pico because function secondsToNominalDiffTime requires this concrete type. At this moment, we cannot check correctness of the calibration because the temporary undefined object is already unreachable. In other words, the Fixed type context gets broken between resolution and MkFixed, which I would regard as a type safety flaw.

How can we fix this? Let’s first make a Fixed value and then get its resolution.

Prelude F TC> import Control.Arrow as A
Prelude F TC A> asIntegerPart = uncurry (*) . (MkFixed . (^2) . resolution &&& id) . MkFixed
Prelude F TC A> :t asIntegerPart
asIntegerPart :: HasResolution a => Integer -> Fixed a
Prelude F TC A> toNominalDiffTime = secondsToNominalDiffTime . asIntegerPart
Prelude F TC > :t toNominalDiffTime
toNominalDiffTime :: Integer -> NominalDiffTime
Prelude F TC A> toNominalDiffTime 23
23s

This works fine and is type safe. Except the algorithm has changed and become less clear. Here we created a fixed-precision value from the original Integer value. Say, if the original value was 23 then MkFixed must produce 0.000000000023 from this. Then we made a fixed-precision value from the quadratic resolution of Pico and multiplied this by value 0.000000000023. Is it clear why quadratic? The answer is simple: the single resolution would give us 1.000000000000 as the multiplier, while the quadratic gives 1000000000000.000000000000. Also notice that there are no explicit type annotations here because (*) expects two arguments of the same type and returns a value of this very same type.

Prelude F TC A> :t (*)
(*) :: Num a => a -> a -> a

As soon as secondsToNominalDiffTime expects Pico, all fixed-precision values in asIntegerPart must be Pico.

Let’s turn back to our simple algorithm and try to make it type safe. A solution could involve using wrapping type classes, GADTs, etc. However, surprisingly, there is a very simple and straightforward solution!

So, what do we want after all? Something like in the following snippet.

Prelude F TC A> :{
Prelude F TC A| asIntegerPart :: HasResolution a => Integer -> Fixed a
Prelude F TC A| asIntegerPart = MkFixed . (resolution (undefined :: Fixed a) *)
Prelude F TC A| :}

<interactive>:36:28: error:
• Could not deduce (HasResolution a0)
arising from a use of ‘resolution’
from the context: HasResolution a
bound by the type signature for:
asIntegerPart :: forall a. HasResolution a => Integer -> Fixed a
at <interactive>:35:1-54
The type variable ‘a0’ is ambiguous
These potential instances exist:
7 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(*)’, namely
‘resolution (undefined :: Fixed a)’
In the second argument of ‘(.)’, namely
‘(resolution (undefined :: Fixed a) *)’
In the expression: MkFixed . (resolution (undefined :: Fixed a) *)

Obviously, type variables a in the signature and in the declaration of the function denote different entities, but we wanted them to be of the same type. This is where ScopedTypeVariables extension must help!

Prelude F TC A> :set -XScopedTypeVariables
Prelude F TC A> :{
Prelude F TC A| asIntegerPart :: HasResolution a => Integer -> Fixed a
Prelude F TC A| asIntegerPart = MkFixed . (resolution (undefined :: Fixed a) *)
Prelude F TC A| :}

<interactive>:40:28: error:
• Could not deduce (HasResolution a0)
arising from a use of ‘resolution’
from the context: HasResolution a
bound by the type signature for:
asIntegerPart :: forall a. HasResolution a => Integer -> Fixed a
at <interactive>:41:1-54
The type variable ‘a0’ is ambiguous
These potential instances exist:
7 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(*)’, namely
‘resolution (undefined :: Fixed a)’
In the second argument of ‘(.)’, namely
‘(resolution (undefined :: Fixed a) *)’
In the expression: MkFixed . (resolution (undefined :: Fixed a) *)

Hmm, no change. But we know that extension ScopedTypeVariables expects explicit forall quantifiers in the signature!

Prelude F TC A> :{
Prelude F TC A| asIntegerPart :: forall a. HasResolution a => Integer -> Fixed a
Prelude F TC A| asIntegerPart = MkFixed . (resolution (undefined :: Fixed a) *)
Prelude F TC A| :}
Prelude F TC A> toNominalDiffTime = secondsToNominalDiffTime . asIntegerPart
Prelude F TC A> :t toNominalDiffTime
toNominalDiffTime :: Integer -> NominalDiffTime
Prelude F TC A> toNominalDiffTime 23
23s
Prelude F TC A> toNominalDiffTime 73643545463262772
73643545463262772s

Finally, with ScopedTypeVariables, the algorithm gets working and type safe, while still being straightforward as in the first try.

## воскресенье, 12 апреля 2020 г.

### Recursive calculations in Nginx with recursive subrequests from NgxExport.Tools.Subrequest

Disclaimer. Do not use recursive calculations demonstrated below in production code as they use Nginx and system resources very extensively. Recursion is always attractive but dangerous when implemented naively! Here I want to show something weird and beautiful. Module NgxExport.Tools.Subrequest provides natural HTTP subrequests running inside normal client requests. Being directed towards the Nginx server itself (e.g. with 127.0.0.1), they can make recursive flows. It means… Yes, we can calculate things like factorials and Fibonacci numbers simply by doing nested subrequests to the server! Let’s calculate them. Firstly, we have to install the latest version of package ngx-export-tools-extra with Cabal.
cabal v1-install ngx-export-tools-extra

(You may prefer the new-style v2-install instead.) Then write a bit of Haskell code.
{-# OPTIONS_GHC -Wno-unused-imports #-}

module NgxSubrequestRecursion where

import           NgxExport
import           NgxExport.Tools
import           NgxExport.Tools.Subrequest

import           Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Lazy.Char8 as C8L

showAsLazyByteString :: Show a => a -> L.ByteString
showAsLazyByteString = C8L.pack . show

type IntegerTuple = (Integer, Integer)

multiply :: ByteString -> L.ByteString
multiply = showAsLazyByteString .
maybe 0 (uncurry (*)) . readFromByteString @IntegerTuple

ngxExportYY 'multiply

maybe 0 (uncurry (+)) . readFromByteString @IntegerTuple

prev :: ByteString -> L.ByteString
prev = showAsLazyByteString .
maybe 0 pred . readFromByteString @Integer

ngxExportYY 'prev

Besides the asynchronous handler makeSubrequest imported from module NgxExport.Tools.Subrequest, module NgxSubrequestRecursion exports a number of simple arithmetic handlers such as multiply, add, and prev: they will be used as auxiliary functions in the recursive algorithms. Let’s compile the module.
ghc -O2 -dynamic -shared -fPIC -lHSrts_thr-ghc$(ghc --numeric-version) ngx_subrequest_recursion.hs -o ngx_subrequest_recursion.so  Gather all dependent libraries (see Utility hslibdeps). hslibdeps -t /var/lib/nginx/x86_64-linux-ghc-8.8.3 ngx_subrequest_recursion.so  And finally, install all the artifacts into directory /var/lib/nginx being a superuser. cp .hslibs/libHS* /var/lib/nginx/x86_64-linux-ghc-8.8.3/ cp ngx_subrequest_recursion.so /var/lib/nginx/  Now let’s turn to calculation of factorials and Fibonacci numbers based on recursive subrequests spawned right out of the Nginx configuration. Remember how recursive equations for factorials and Fibonacci numbers are defined? Factorial. $F_0 = 1$ $F_{n} = F_{n-1} \cdot n$ Fibonacci numbers. $F_0 = 0$ $F_1 = 1$ $F_{n} = F_{n-1} + F_{n-2}$ We are going to encode them inside the configuration! user nobody; worker_processes 2; events { worker_connections 1024; } http { default_type application/octet-stream; sendfile on; haskell load /var/lib/nginx/ngx_subrequest_recursion.so; haskell_var_empty_on_error$hs_subrequest, $hs_subrequest2; server { listen 8010; server_name main; error_log /tmp/nginx-test-haskell-error.log; access_log /tmp/nginx-test-haskell-access.log; location = /Factorial { rewrite ^ /Calculate/Factorial last; } location = /Fibonacci { rewrite ^ /Calculate/Fibonacci last; } location ~ ^/Calculate/(.*) { internal; set$algorithm $1; if ($arg_v !~ '^\d+$') { return 400; } if ($arg_v = 1) {
echo 1;
break;
}

set $check0$arg_v$algorithm; if ($check0 = 0Factorial) {
echo 1;
break;
}

if ($check0 = 0Fibonacci) { echo 0; break; } rewrite ^ /Internal/$algorithm last;
}

location = /Internal/Factorial {
internal;

haskell_run prev $hs_prev_v$arg_v;

haskell_run_async makeSubrequest $hs_subrequest '{"uri": "http://127.0.0.1:8010/Factorial?v=$hs_prev_v"}';

haskell_run multiply $hs_result '($arg_v, $hs_subrequest)'; if ($hs_result = 0) {
echo_status 500;
echo "Error while getting factorial $arg_v"; break; } echo$hs_result;
}

location = /Internal/Fibonacci {
internal;

haskell_run prev $hs_prev_v$arg_v;
haskell_run prev $hs_prev2_v$hs_prev_v;

haskell_run_async makeSubrequest $hs_subrequest '{"uri": "http://127.0.0.1:8010/Fibonacci?v=$hs_prev_v"}';
haskell_run_async makeSubrequest $hs_subrequest2 '{"uri": "http://127.0.0.1:8010/Fibonacci?v=$hs_prev2_v"}';

haskell_run add $hs_result '($hs_subrequest, $hs_subrequest2)'; if ($hs_result = 0) {
echo_status 500;
echo "Error while getting Fibonacci number $arg_v"; break; } echo$hs_result;
}
}
}

There are two entry points: locations /Factorial and /Fibonacci. They rewrite to an internal location /Calculate which filters bad requests (when the value of variable arg_v is not a natural number) and defines base cases for the recursion rules. If the number passed in arg_v is big enough, then the request gets rewritten to locations /Internal/Factorial or /Internal/Fibonacci where calls to makeSubrequest perform recursion over the same locations until the base cases get reached. Let’s calculate basic factorials and Fibonacci numbers.
curl 'http://localhost:8010/Factorial?v=0'
1
curl 'http://localhost:8010/Factorial?v=1'
1
curl 'http://localhost:8010/Fibonacci?v=0'
0
curl 'http://localhost:8010/Fibonacci?v=1'
1

Factorials of big numbers.
time curl 'http://localhost:8010/Factorial?v=10'
3628800

real    0m0,015s
user    0m0,005s
sys     0m0,006s

If you look into the access log /tmp/nginx-test-haskell-access.log, you will see 10 lines which correspond to 10 subrequests.
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=1 HTTP/1.1" 200 12 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=2 HTTP/1.1" 200 12 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=3 HTTP/1.1" 200 12 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=4 HTTP/1.1" 200 13 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=5 HTTP/1.1" 200 14 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=6 HTTP/1.1" 200 14 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=7 HTTP/1.1" 200 15 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=8 HTTP/1.1" 200 16 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=9 HTTP/1.1" 200 17 "-" "-"
127.0.0.1 - - [11/Apr/2020:23:42:29 +0300] "GET /Factorial?v=10 HTTP/1.1" 200 18 "-" "curl/7.66.0"

time curl 'http://localhost:8010/Factorial?v=100'
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

real    0m0,124s
user    0m0,011s
sys     0m0,010s

Subrequests are spawned sequentially (time to calculate factorial 100 is 10 times bigger than time to calculate factorial 10), but they are still asynchronous. So, when run in a bunch, they’ll probably run out of limit of open file descriptors.
for i in {1..8} ; do curl 'http://localhost:8010/Factorial?v=100' & done
Error while getting factorial 100
Error while getting factorial 100
Error while getting factorial 100
Error while getting factorial 100
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

If you look into the error log /tmp/nginx-test-haskell-error.log, you will find a zillion number of HttpExceptionRequest errors with messages Error while getting factorial …, but more interesting are messages with failed to create async event channel for future async result, skipping IO task (24: Too many open files). There should be four such messages: they are the real cause of the four errors. We can evaluate the number of open file descriptors needed for running 8 simultaneous calculations of factorial 100. Every request creates 99 nested subrequests ($1 + 99 = 100$), each of them creates 2 TCP sockets for the Haskell HTTP client and the Nginx HTTP server, add to this 1 eventfd channel for Haskell/Nginx communication. Altogether $3 \cdot 100 = 300$ open file descriptors for a single request at the peak, or $8 \cdot 300 = 2400$ open file descriptors for 8 simultaneous calculations at the peak which is more than 2 times bigger than the value of worker_connections we set (1024). The same story with Fibonacci numbers: each sub-calculation is sequential and nevertheless asynchronous. This means that the bigger the number, the longer time to complete the whole calculation, on the other hand, independent calculations work in parallel and may exhaust open file descriptors as fast as factorial calculations.
time curl 'http://localhost:8010/Fibonacci?v=10'
55

real    0m0,113s
user    0m0,016s
sys     0m0,005s

time curl 'http://localhost:8010/Fibonacci?v=20'
6765

real    0m7,539s
user    0m0,007s
sys     0m0,004s

The parallel computation shall bring a real TCP storm.
for i in {1..8} ; do curl 'http://localhost:8010/Fibonacci?v=20' & done
6765
6765
6765
6765
6765
6765
6765
6765

This added to the access log 175128 new records! Notice that this time there were no errors as far as depth 20 is not enough to exhaust open file descriptors.

## понедельник, 16 декабря 2019 г.

### Новый переключатель раскладки g3kb-switch для Gnome 3 и vim-xkbswitch

Люди говорят (а я проверил), что xkb-switch больше (и наверное уже давно) не работает в Gnome Shell. Поэтому я решил написать его аналог для этой популярной среды. Он называется g3kb-switch и ведет себя практически аналогично xkb-switch. Так же, как и xkb-switch, он может быть настроен для работы с vim-xkbswitch. В базовом варианте для этого нужны всего две строки в файле .vimrc.
let g:XkbSwitchEnabled = 1
let g:XkbSwitchLib = '/usr/local/lib/libg3kbswitch.so'

Реализация g3kb-switch сильно отличается от xkb-switch: он не работает на уровне X протокола, а выполняет удаленные действия в Gnome Shell с помощью синхронных вызовов, передаваемых через шину сообщений D-Bus.

## понедельник, 20 мая 2019 г.

### Exploring Nginx workers load arbitration

In the documentation of Haskell module NgxExport.Tool.Aggregate there is a small example of how to establish monitoring of Nginx worker’s load. In a few words, it is possible to set up an internal server that would sit on an arbitrary Nginx worker process and accumulate various data from all the workers. This data could be retrieved via a specified interface configured in the Nginx configuration script. In the example, the internal server collects the number of requests and bytes that were sent back to clients from each worker process. This data is accessible in JSON format via a dedicated virtual server listening on port 8020. Say, to retrieve the current load, we can simply use curl and jq (to pretty-print JSON).

curl 'http://127.0.0.1:8020/' | jq
[
"2019-04-22T14:29:04Z",
{
"5910": [
"2019-04-22T14:31:34Z",
{
"bytesSent": 17751,
"requests": 97,
"meanBytesSent": 183
}
],
"5911": [
"2019-04-22T14:31:31Z",
{
"bytesSent": 549,
"requests": 3,
"meanBytesSent": 183
}
]
}
]

Now I want to show how to retrieve this data repeatedly and render it on an interactive dashboard online using R and a Shiny application with plotly.

Below is the annotated code saved in file load_monitoring.r.

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110  library(shiny) library(plotly) library(jsonlite) ui <- fluidPage( fluidRow( headerPanel(h1("Nginx workers load arbitration", align = "center"), "Nginx workers load arbitration")), fluidRow( wellPanel(div(align = "center", div(style = "display: inline-block; margin-right: 20px", textInput("i_url", NULL, "http://127.0.0.1:8020/", width = "200px")), span(), div(style = "display: inline-block; margin-right: 20px", radioButtons("rb_mode", NULL, c("Requests" = "reqs", "Bytes_sent" = "bsent"), selected = "reqs", inline = TRUE)), div(style = "display: inline-block", actionButton("b_reset", "Reset Traces"))))), fluidRow( div(plotlyOutput("plot"), id = "graph")) ) server <- function(input, output, session) { values <- reactiveValues() values$init <- TRUE values$load <- list("", list()) values$pids_prev <- list() observe({ invalidateLater(5000, session) if (class(values$load) != "try-error") { values$pids_prev <- names(values$load[[2]]) } values$load <- try(fromJSON(input$i_url)) m <- if(input$rb_mode == "reqs", 2, 1) if (class(values$load) == "try-error" || length(values$load[[2]]) == 0) { invalidateLater(1000, session) } else { pids <- names(values$load[[2]]) if (values$init) { values$init <- FALSE values$p <- plot_ly(type = "scatter", mode = "lines", colors = "YlOrRd") for (i in 1:length(values$load[[2]])) { xs <- as.POSIXct(values$load[[2]][[i]][[1]], format = "%Y-%m-%dT%H:%M:%S") values$p <- add_trace(values$p, name = paste(pids[i], names(values$load[[2]][[i]][[2]][m])), x = xs, y = values$load[[2]][[i]][[2]][[m]], line = list(width = 2)) %>% add_annotations( x = xs, y = values$load[[2]][[i]][[2]][[m]], text = "", showarrow = TRUE, arrowcolor = "#bbb") } values$p <- layout(values$p, yaxis = list(range = 0)) output$plot <- renderPlotly(values$p) } else { vs <- list() xs <- list() ts <- list() len <- length(pids) if (length(names(values$load[[2]])) != length(values$pids_prev) || length(setdiff(names(values$load[[2]]), values$pids_prev)) > 0) { invalidateLater(1000, session) values$init <- TRUE } else { i <- 1 while (i <= len) { vs[[i]] <- list(values$load[[2]][[i]][[2]][[m]]) xs[[i]] <- list(values$load[[2]][[i]][[1]]) ts[[i]] <- i i <- i + 1 } plotlyProxy("plot", session) %>% plotlyProxyInvoke("extendTraces", list(x = xs, y = vs), ts) } } } } ) observeEvent(input$b_reset, { values$init <- TRUE } ) observeEvent(input$rb_mode, { values$init <- TRUE } ) }  In lines 1–3 all required libraries are loaded: shiny for UI, plotly for interactive plotting, and jsonlite for reading JSON data. The user interface is built in lines 5–23. It consists of the header (lines 6–8), a panel with control widgets (lines 9–20), and the plot area (lines 21–22). In lines 25–110 a Shiny server that would render data online, is defined. In lines 26–29 a number of reactive values are declared and initialized: they will be used in reactive observer observe defined in lines 31–99. The observer runs every 5 seconds (line 32) retrieving new data from Nginx (line 37) and plotting it on the dashboard in case of success (lines 44–97). If retrieval fails then observe re-runs after 1 second (lines 41–43). There are two branches of execution on successful data retrieval: initialization of the plot (lines 47–70), and extending traces (lines 71–97). The initialization triggers when the reactive value of values$load is TRUE: in this phase the plotly object values$p gets initialized in calls to plot_ly, add_trace, and add_annotations. The plot type is set to scatter, its mode is lines, and the color palette for traces is YlOrRd (lines 49–51). The traces and the annotations are added in a loop (lines 53–67), the number of iterations depends on JSON data saved in the value values$load and corresponds to the number of Nginx worker processes. The annotations are empty strings (they have value <span />): they are only needed for drawing arrows at the beginnings of the traces.

Extending traces comes after the initialization phase, and only if the PIDs of the Nginx worker processes (found in line 45) did not change after the previous data retrieval (it gets checked in lines 77–82). If the PIDs have changed then the plot will be redrawn in 1 second (lines 81–82). A more graceful solution would be adding new traces dynamically, without redrawing of the whole plot, however this would be more challenging for such a simple example, and not very useful, taking into account that the workers’ PIDs should not change often in the normal case. So, when the PIDs do not change, the traces get extended with new values (lines 83–95).

In lines 101–109 actions for the Reset button and the Mode radio-button are defined: they simply reset the value of values\$init to TRUE in order to redraw the plot.

Let’s start Nginx with this configuration.

nginx -c /path/to/nginx.conf
ps -ef | grep nginx
root     29516     1  0 13:01 ?        00:00:00 nginx: master process nginx -c /path/to/nginx.conf
nobody   29523 29516  1 13:01 ?        00:00:00 nginx: worker process
nobody   29524 29516  1 13:01 ?        00:00:00 nginx: worker process

The PIDs of the worker processes are 29523 and 29524. Later we should see them on the plot.

Now let’s start an R shell and run the server.

source("load_monitoring.r")
shinyApp(ui, server)

Listening on http://127.0.0.1:6678

The application will open in a browser. Now run a number of requests to the Nginx server from a shell.

for i in {1..100} ; do curl 'http://127.0.0.1:8010/' & done
...
for i in {1..100} ; do curl 'http://127.0.0.1:8010/' & done
...

The application in the bowser shall look like on the image below.

The plot gets updated in real time. The address of the Nginx stats server and types of traces can be altered using control widgets on the grayish panel above the plot.


text:
# All

## Applying Multi-qubit Correction to Frustrated Cluster Loops on an Adiabatic Quantum Computer. (arXiv:1902.05827v1 [cs.ET])

The class of problems represented by frustrated cluster loops, FCL, is a
robust set of problems that spans a wide range of computational difficulty and
that are easy to determine what their solutions are. Here, we use frustrated
cluster loops to test the relative performance of the D-Wave without
post-processing and the D-Wave with multi-qubit correction (MQC)
post-processing. MQC post-processing has shown itself exceptionally beneficial
in improving the performance of the D-Wave 2000Q when processing difficult FCL
problems.

## Experimental Realization of a Quantum Autoencoder: The Compression of Qutrits via Machine Learning. (arXiv:1810.01637v2 [quant-ph] UPDATED)

With quantum resources a precious commodity, their efficient use is highly
desirable. Quantum autoencoders have been proposed as a way to reduce quantum
memory requirements. Generally, an autoencoder is a device that uses machine
learning to compress inputs, that is, to represent the input data in a
lower-dimensional space. Here, we experimentally realize a quantum autoencoder,
which learns how to compress quantum data using a classical optimization
routine. We demonstrate that when the inherent structure of the data set allows

## Phonon-assisted tunnelling in a double quantum dot molecule immersed in a cavity. (arXiv:1902.05580v1 [cond-mat.mes-hall])

The effects caused by phonon-assisted tunnelling (PhAT) in a double quantum
dot (QD) molecule immersed in a cavity were studied under the quantum Markovian
master equation formalism in order to account for dissipation phenomena. We
explain how for higher PhAT rates, a stronger interaction between a QD and the
cavity at off-resonance takes place through the resonant interaction of another
QD and the cavity, where the QDs interact through tunnelling. A closer look at

## Magnetization and entanglement after a geometric quench in the XXZ chain. (arXiv:1902.05834v1 [cond-mat.stat-mech])

We investigate the dynamics of the XXZ spin chain after a geometric quench,
which is realized by connecting two half-chains prepared in their ground states
with zero and maximum magnetizations, respectively. The profiles of
magnetization after the subsequent time evolution are studied numerically by
density-matrix renormalization group methods, and a comparison to the
predictions of generalized hydrodynamics yields a very good agreement. We also
calculate the profiles of entanglement entropy and propose an ansatz for the

## Characterizing high-quality high-dimensional quantum key distribution by state mapping between different degree of freedoms. (arXiv:1810.02067v2 [quant-ph] UPDATED)

Quantum key distribution (QKD) guarantees the secure communication between
legitimate parties with quantum mechanics. High-dimensional QKD (HDQKD) not
only increases the secret key rate but also tolerates higher quantum bit error
rate (QBER). Many HDQKD experiments have been realized by utilizing
orbital-angular-momentum (OAM) photons as the degree of freedom (DOF) of OAM of
the photon is a prospective resource for HD quantum information. In this work
we proposed and characterized that a high-quality HDQKD based on

## Unbounded sequence of observers exhibiting Einstein-Podolsky-Rosen steering

Author(s): Akshata Shenoy H., Sébastien Designolle, Flavien Hirsch, Ralph Silva, Nicolas Gisin, and Nicolas Brunner
A sequential steering scenario is investigated, where multiple Bobs aim at demonstrating steering using successively the same half of an entangled quantum state. With isotropic entangled states of local dimension $d$, the number of Bobs that can steer Alice is found to be ${N}_{\mathrm{Bob}}∼d/logd$...
[Phys. Rev. A 99, 022317] Published Fri Feb 15, 2019

## Carrier-phase estimation for simultaneous quantum key distribution and classical communication using a real local oscillator

Author(s): Tao Wang, Peng Huang, Shiyu Wang, and Guihua Zeng
The simultaneous quantum and classical communication (SQCC) protocol is an appealing protocol since it allows continuous-variable quantum key distribution (CV-QKD) and classical communication to be implemented simultaneously by using the same communication infrastructure and on a single wavelength. ...
[Phys. Rev. A 99, 022318] Published Fri Feb 15, 2019

## Constructing solutions to two-way diffusion problems

A variety of boundary value problems in linear transport theory are expressed as a diffusion
equation of the two-way, or forward–backward, type. In such problems boundary data are specified
only on part of the boundary, which introduces several technical challenges. Existence and
uniqueness theorems have been established in the literature under various assumptions; however,
calculating solutions in practice has proven difficult. Here we present one possible means of

## Conserved chiral currents on the boundary of 3D Maxwell theory

In this paper the 3D Maxwell theory with single-sided planar boundary is studied. As a consequence
of the existence, on the boundary, of two Ward identities, we find two chiral conserved edge
currents satisfying a Kaç–Moody algebra with central charge equal to the inverse of the Maxwell
coupling constant. We show that the boundary degrees of freedom are two 2D scalar chiral bosons
whose chiralities depend on the parameters of the bulk Maxwell theory. In particular, the edge

## Quantum Algorithms for Systems of Linear Equations Inspired by Adiabatic Quantum Computing

Author(s): Yiğit Subaşı, Rolando D. Somma, and Davide Orsucci
We present two quantum algorithms based on evolution randomization, a simple variant of adiabatic quantum computing, to prepare a quantum state $|x⟩$ that is proportional to the solution of the system of linear equations $A\stackrel{→}{x}=\stackrel{→}{b}$. The time complexities of our algorithms are...
[Phys. Rev. Lett. 122, 060504] Published Thu Feb 14, 2019


text:
# Trouble with finding shortest distance between $y=x^2$ and $y=x-1$ with Lagrangian multipliers

I've found another thread with a similar question, but none of the answers help with the specific part I'm stuck on.

Just to make things simpler, I've used the square of the distance $f(x_1,x_2,y_1,y_2)=(x_1-x_2)^2+(y_1-y_2)^2$, and I have constraints $G_1=x_1^2-y_1$, and $G_2=x_2-y_2-1$.

Taking the gradients of $f$, $G_1$, and $G_2$, I have the system of equations

$2(x_1-x_2)=2\lambda_1x_1$

$2(y_1-y_2)=-\lambda_1$

$-2(x_1-x_2)=\lambda_2$

$-2(y_1-y_2)=-\lambda_2$

What I've done so far is, I've first observed that the immediate implication of the 2nd and 4th equations is that $\lambda_1=-\lambda_2$. Using this, I cancelled out the 1st and 3rd equations with the substituted value for $\lambda_2$, and got that $2\lambda_1x_1=\lambda_1\implies x_1=\frac{1}{2}$, and by constraint 1 that $y_1=\frac{1}{4}$. From here though, I'm not sure how to pin down the value of $\lambda$, and therefore determine $x_2$ and $y_2$.

• From equation 1 you obtain $x_2 =(1-\lambda_1)/2$, from equation 2 you obtain $y_2= (1+2 \lambda_1)/4$. Using the constraint $G_2$, you obtain $\lambda_1 = -3/4$ and with that the remaining values. – Fabian Jan 20 '17 at 9:18

The shortest distance between the parabola $y = x^2$ and straight line $y = x - 1$ occurs when the tangent to the parabola is parallel to the line, i.e. when their slopes are equal. Now, slope of tangent of parabola $y = x^2$ is

$$m = \frac{dy}{dx} = 2x$$

and the slope of the straight line $= 1$. Hence the shortest distance occurs at $x = 1/2$. The point on the parabola corresponding to $x = 1/2$ is $(1/2, 1/4)$. Hence, perpendicular distance of this point from the given straight line is:

$$d = \frac{|0.5 - 0.25 - 1|}{\sqrt{2}} = \frac{3}{4\sqrt{2}}$$

which is the shortest distance between the curves.

EDIT: This, I guess, isn't the answer you're looking for. But I find this approach much easier and shorter than using Lagrange multipliers. Hence just shared this technique.

• Yeah, normally this would've been the technique I would've used, given how intuitive its approach is. I'm specifically preparing for a test involving Lagrange multipliers though, which is why I'm using an otherwise overkill method. – George Jan 20 '17 at 8:00

the distance between the curves is given by $$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$$ with $$y_1=x_1^2,y_2=x_2-1$$ with these equations we obtain $$\sqrt{(x_2-x_1)^2+(x_2-1-x_1^2)^2}$$ now you must differentiate this with respect to $$x_1,x_2$$

• What do I use as the constraints for the Lagrange multiplier in this case? – George Jan 20 '17 at 7:55

Perhaps one could use Lagrange multipliers in more elegant way, but this will work.

Define $$D(x,y,x',y') = (x-x')^2+(y-y')^2$$ and $$g(x,y,x',y') = (y-x^2)^2 + (y'-x'+1)^2.$$

Then you want to optimize $D$ with respect to $g(x,y,x',y') = 0$. Calculate gradients:

$$\nabla D = 2(x-x',y-y',-(x-x'),-(y-y'))\\ \nabla g = 2((y-x^2)(-2x),y-x^2,-(y'-x'+1),y'-x'+1)$$

Set $\nabla D = \lambda \nabla g$ to get system

\begin{align} x-x' &=-2\lambda x(y-x^2)\\ y-y' &=\lambda (y-x^2)\\ x-x' &=\lambda (y'-x'+1)\\ y-y' &=-\lambda (y'-x'+1)\\ \end{align}

From equations 1 and 2 we get $$x-x' = -2x(y-y')$$ and from equations 3 and 4 we get $$x-x' = -(y-y')$$ which gives us $$(2x-1)(y-y') = 0$$ You can quickly check that $y-y' = 0$ is impossible since it would imply that $x-x'= 0$ as well, but our parabola and line do not intersect. Thus, $x = \frac 12$. Now you know $y = \frac 14$ and from the system \begin{align}x-x' &= y'-y\\ y' &= x'-1\end{align} you can get $x'$ and $y'$. This will give you your distance.


text:
Math Help - integral of polinomial division

1. integral of polinomial division

Dear All!
please, any ideas of what to do with:
$\int \frac{3x^3+2x^2+4x-8}{x^4+16}$

2. Re: integral of polinomial division

You can factor the denominator as $(x^2-2\sqrt{2}x+4)(x^2+2\sqrt{2}x+4)$ and use the method of partial fractions.

- Hollywood


text:
# How Decibel Operations are Performed Through Logarithms?

Digital ElectronicsElectronics & ElectricalElectron

#### Digital Marketing Online Training

23 Lectures 2 hours

#### How To Start Your Own Digital Marketing Agency

125 Lectures 9 hours

#### Digital Marketing Agency Elite Consultants Masterclass

140 Lectures 20 hours

## Introduction to dB Operations

The ‘decibel’ is a form of representing ratios on a logarithmic scale instead of linear scale. They are used across several disciplines of STEM. In this article, we will see how to perform calculations using decibels with examples pertaining to electrical engineering. We know that the ‘decibel’ represents the ratio of two quantities on the logarithmic scale. While comparing two quantities, one of them will be considered as a reference. This article discusses the basic operations that could be performed on decibels with some examples.

## Basic operations based on logarithms

### Logarithmic Multiplication

The logarithm of the product of two numbers taken on a linear scale is equal to the sum of the two numbers in their logarithmic forms.

We know that multiplication on a linear scale is equivalent to addition on a logarithmic scale.

(A×B)dB=(A)dB + (B)dB

Where,

A(dB)=10log10A

Let us consider a cascaded three amplifier system where the gains of the first, second, and third amplifiers are 10, 15 and 20, respectively. The input power of the signal fed to the first amplifier is 5 W.

The overall gain of the system is the ratio of PA3 / Pin

The overall linear gain of the system is the product of the linear gains of individual amplifiers. This gives us overall linear gain AP to be

$$A_{p}=\frac{P_{A3}}{P_{in}}=G_{1}G_{2}G_{3}=3000$$

$$P_{A3}=A_{P}P_{in}=15kW$$

The overall ‘dB’ power gain is given as

10 log103000=34.77dB

We also know that the overall gain of the system is the sum of individual ‘dB’ gains of the amplifier. Since we are dealing with power ratios,

$$10log_{10}(A\times\:B\times\:C)=10log_{10}A +10log_{10}B+10log_{10}C$$

$$10log_{10}(10\times\:15\times\:20)=10log_{10}10 +10log_{10}15+10log_{10}20$$

$$=10dB+11.76dB+13.01dB$$

### Logarithmic Division

The logarithm of division of two numbers taken on a linear scale is equal to the difference between the two numbers in their logarithmic forms.

$$(A/B)_{dB}=A_{dB}-(B)_{dB}$$

Where

$$A(dB)=10log_{10}A$$

Thus, we have

$$log_{10}10-log_{10}5=log_{10}(\frac{10}{5})=log_{10}2$$

Updated on 23-Jun-2021 14:15:11


text:
• thomas5267
Prove that the polynomials $$P_n$$ has n distinct root for all n. $$P_n$$ are characteristic polynomials of a particular type of matrix. $P_n=-xA_{n-1}-\frac{1}{2}A_{n-2}\\ A_n = \left( \dfrac{-x+\sqrt{x^2-1}}{2}\right)^n + \left(\dfrac{-x-\sqrt{x^2-1}}{2}\right)^n$ $$A_n$$ satisfies the following recurrence relation: $A_n=-x A_{n-1}-\frac{1}{4}A_{n-2}\\ A_1=-x\\ A_2=x^2-\frac{1}{2}$
Mathematics

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.


text:
## a. 5.41 \times 10^{14} \mathrm{Hz}b. 1.04 \times 10^{15} H zc. 1.19 e V

Quantum Physics

Atomic Physics

### Discussion

You must be signed in to discuss.
##### Christina K.

Rutgers, The State University of New Jersey

LB

### Video Transcript

case on this problem. We're talking about zinc, and we're told that the work function is 4.31 you be, and we want caught off wavelength. So caught off way blink is gonna be when electrons were omitted, But they have no kinetic energy. So in the usual formula for the photoelectric effect, which is kinetic energy is the energy of the photon minus the work function. Um, we can say that this is zero. So that we can say is he called a bye. And then whatever you solving for again, um, Lois frequency and then we want to use is equal to h f. So f is equal to fi over age. So if we do 4.31 designed by needs, then we need to convert the 4.31 to drools by multiplying by 1.602 times 10 to the minus 19. Um, And then with that, I got one point. 04 times 10 to the 15 hurts. And so that's the answer for hopes we wanted to find the wavelength for us. Well, that's OK. On the frequency first, and then you for a We want to use frequency is equal to see over Lambda and then land us, therefore equal to see over after. And so what we want to do is take the inverse of our frequency and multiply it by the speed of light. So I'll do this minus one times the speed of light. And I got 2.88 um, 288 nanometers. And for see, um, we know the energy of the photons. We want the Max Kinetic energy. So, um, again, we can use this formula, but without the without, the key crossed out. So, for a C, you're gonna say kinetic energy, um, is just the energy of the foe times. And then that's what they give us. Um, 5.5 u v minus 4.31 Okay, so then this is 0.69 plus 0.5 is, um, 0.69 plus 0.5 is one 0.19 Does that work out groups Not one equals 0.19 gov. So, yeah, they've they've been ejected. You've had to kind of spend this much on the work function just to take them out of the the electrons out of the structure. And, um, and then you have this much left over which is converted into Connecticut, and she

University of Washington

#### Topics

Quantum Physics

Atomic Physics

##### Christina K.

Rutgers, The State University of New Jersey

LB


text:
# Tag Info

7

From $$xS(x)=\sum_{n=0}^\infty\frac{x^{n+1}}{(n+1)!},$$ just by a change of index, you get $$xS(x)=\sum_{p=1}^\infty\frac{x^p}{p!}=\sum_{p=0}^\infty\frac{x^p}{p!}-1=e^x-1,$$ that is $$S(x)=\frac{e^x-1}x, \quad x \neq0.$$

5

HINT: $$\sin(n)\sin\left(\frac{(-1)^n}{n^{1/4}}\right)=(-1)^n\sin(n)\sin\left(\frac{1}{n^{1/4}}\right)$$ Now, show that there exists a number $M$ (added hint: $M=\sec(1/2)$ suffices) such that for all $N$ $$\left|\sum_{n=1}^N (-1)^n\sin(n)\right|\le M$$ Finally, apply Dirichlet's Test noting that $\sin\left(\frac{1}{n^{1/4}}\right)>0$ and ...

4

The typical way to "skip terms" in a power series is to use roots of unity. Here, let $\zeta=e^{i\pi/3}$ be a primitive $6$th root of unity, so that $$\frac16 \sum_{j=0}^5 (\zeta^\ell)^j = \begin{cases} 1, &\text{if } 6\mid \ell, \\ 0, &\text{otherwise.} \end{cases}$$ Therefore, setting $\alpha=e^{i\pi/6}$, for any $0\le k\le 5$, \begin{align*} ...

4

May be, we could use generalized harmonic numbers since $$\sum_{n=1}^x {1\over \sqrt{n}}=H_x^{\left(\frac{1}{2}\right)}$$ and use the asymptotics for large values of $n$ $$H_x^{\left(\frac{1}{2}\right)}=2 \sqrt{x}+\zeta \left(\frac{1}{2}\right)+\frac 1 {2\sqrt x}+O\left(\frac{1}{x^{3/2}}\right)$$

4

Yes, there is. As it is a series with positive terms, you can use equivalents: $$\log(2n+1)-\log(2n)=\log\Bigl(1+\frac1{2n}\Bigr)\sim_\infty\frac1{2n},$$ which diverges.

3

use that $$\sum_{k=1}^n k^{-1/2} = \int_{1-\epsilon}^{n+\epsilon} \left(\sum_{k=1}^n \delta(x-k)\right) x^{-1/2} dx = n^{1/2} + \frac{1}{2}\int_1^n \lfloor x \rfloor x^{-3/2} dx$$ (some sort of integration by parts, see Abel's summation formula ) while $$n^{1/2} = 1+\frac{1}{2}\int_1^n x^{-1/2} dx$$ hence $$A_n = 2 n^{1/2}-\sum_{k=1}^n k^{-1/2} = 1 ... 3 Too lazy to whip up anything fancy, but program z2 use ISO_FORTRAN_ENV,only:wp=>REAL128 real(wp) zeta,x integer k, M M = 100000000 zeta = sum([(1/sqrt(real(k,wp)),k=1,M)])- & 2*sqrt(M+0.5_wp)-1/(48*sqrt(M+0.5_wp)**3) write(*,*) zeta end program z2 Spits out -1.46035450880958681288949915247298, which has 29 digits of ... 3$$\forall x\in\mathbb{C}:\|x\|<1,\qquad\sum_{n\geq 1}x^n = \frac{x}{1-x}\tag{1} $$Now we apply twice the operator xD: f(x)\mapsto x\cdot f'(x)  to get:$$\forall x\in\mathbb{C}:\|x\|<1,\qquad\sum_{n\geq 1}n^2\,x^n = \frac{x(1+x)}{(1-x)^3}\tag{2} $$and by evaluating at x=\frac{2}{5}:$$\sum_{n\geq 1}n^2\left(\frac{2}{5}\right)^n = ...

3

Using $\;\sin\frac1n\le\frac1n\;$ , you get: $$\left|\frac{\cos n\sin\frac1n}{n}\right|\le\frac1{n^2}$$ annd the comparison test gives you absolute convoergence ( of course, we also used $\;|\cos n|\le1\;$).

3

The answer is negative. In fact if we define the Baire class $B_\alpha$ for countable ordinals $\alpha$ by saying $B_0=C(I)$, $B_{\alpha+1}$ is the set of pointwise limits of sequences in $B_\alpha$, and $B_\alpha=\bigcup_{\beta<\alpha}B_\beta$ for limit ordinals $\alpha$ then all the $B_\alpha$ are distinct. Or so I've read; don't ask me to prove it. ...

3

Fine as they are, the other answers gloss over an important nuance: In a comparison of (positive) sequences, if $a_n\le b_n$ and $\lim_{n\to\infty}b_n=L$, we cannot conclude that $\lim_{n\to\infty}a_n=L$. In fact, we cannot even conclude that $\lim_{n\to\infty}a_n$ exists (unless $L=0$). We need to squeeze $a_n$ between two sequences that both converge to ...

3

First, note that there exists $\delta$ such that $|\sin^4(x)|<\delta$ implies $|\sin^4(x+1)|>\delta$. To see this, draw a circle. The angles $x$ for which $|\sin(x)|<\delta$ correspond so arcs around $(1,0)$ (at angle $0$) and $(-1,0)$ (at angle $\pi$), so if these arcs are small enough, which corresponds to $\delta$ being small, then adding $1$ to ...

3

Note that $$\sin^4 n = (\sin^2 n)^2 = \left( \frac{1 - \cos 2n }2 \right)^2 = \frac{1 - 2\cos 2n + \cos^2 2n}4$$ $$= \frac{1-2\cos 2n}4 + \frac{1+2\cos 4n}8 = \frac38-\frac{\cos 2n}2+\frac{\cos 4n}4.$$ We split the sum into three parts: $$\sum_{n=1}^{\infty} \frac{\sin^4 n }{\ln(n+\frac1n)} = \sum_{n=1}^{\infty} \frac38 \frac1{\ln(n+\frac1n)} - ... 3 Without too many details: |(1+i/n)^n| = (1 + \frac{1}{n^2})^{n/2} \arg(1 + i/n)^n = n\tan^{-1} 1/n as n \to \infty, the modulus goes to 1 and the argument goes to 1. This is exactly e^i. 3 Hint: By mean value theorem, for each n\in\mathbb{N} there exists \xi_n\in(2n,2n+1) such that$$\log(2n+1)-\log(2n)=\frac{1}{\xi_n}\geq\frac{1}{2n+1}\geq\frac{1}{3n}$$3 The series converges: Using \sin x = x - \frac{x^3}{6} + o(x^4) around 0, we get that when n\to \infty$$ \sin\left(\frac{\sin(3n)}{\sqrt{n}} + \frac{1}{n\ln^2(n)}\right) = \underbrace{\frac{\sin(3n)}{\sqrt{n}}}_{a_n} + \underbrace{\frac{1}{n\ln^2(n)} + O\left(\frac{1}{n^{3/2}}\right)}_{b_n}. $$The series \sum_{n=2}^\infty (-1)^n b_n converges ... 3 The integral of the question 1 is not difficult to evaluate. We have$$\int_{0}^{1}\left(\left(y+\frac{1}{y}\right)\log\left(1+y^{2}\right)-y\right)dy=\int_{0}^{1}y\log\left(1+y^{2}\right)dy+\int_{0}^{1}\frac{\log\left(1+y^{2}\right)}{y}dy-\int_{0}^{1}ydy. $$For the first integral take y^{2}+1=u  to get ... 2 Multiply the given relation by a factor of \frac{1}{2} and add it to the original sequence. Now we get:$$L = 1 - \frac{1}{2} + \frac 13 - \frac 14 + \frac 15 - \frac 16 + \frac 17 - \frac 18 + ...\frac 12 L = 0 + \frac 12 + 0 - \frac 14 + 0 + \frac 16 + 0 - \frac 18+ ...\frac 32 L = 1 + 0 + \frac 13 - \frac 12 + \frac 15 + 0 + \frac 17 - ...

2

Observe that $$a_n:=\frac{ne^{-n^2}}{e^{-n}+4}=\frac{ne^n}{4e^{n^2+n}+e^{n^2}}\implies$$ $$\sqrt[n]{a_n}=\frac{\sqrt[n]n\,e}{\sqrt[n]{4e^{n^2+n}+e^{n^2}}}\le\frac{\sqrt[n]n}{e^n}e\xrightarrow[n\to\infty]{}0$$ so the series converges.

2

Hint. One has, for $n \geq1$, $$0\leq\frac{ne^{-n^2}}{e^{-n}+4}\leq ne^{-n^2}.$$

2

Yes, the important thing is that it is decreasing after a while at least. This is because a finite number of terms isn't relevant for the convergence of the serie.

2

Let $(x_n)$ be a convergent sequence in $M$ with limit $a$. Then we can consider the sequence $x_1, a, x_2, a, x_3, a, \ldots$ which intertwines $(x_n)$ with the constant sequence $(a)$. This sequence converges to $a$ as well, so by assumption, the sequence $f(x_1), f(a), f(x_2), f(a), \ldots$ converges in $N$. Since every other term is $f(a)$, the only ...

2

Note that $\cos kz = \mathrm{Re}(\cos kz + i \sin kz) = \mathrm{Re}(e^{ikz})$. Thus: $$\sum_{k \geq 1} e^{-tk} \cos kz = \sum_{k \geq 1} \mathrm{Re}(e^{-tk})\mathrm{Re}(e^{ikz}) = \sum_{k \geq 1} \mathrm{Re}(e^{k(-t + iz)}) = \mathrm{Re}\left(\sum_{k \geq 1} \left(e^{-t + iz}\right)^k\right)$$ which is a geometric series.

2

By the triangle inequality, $$\int_{B_n} |f_n-f| \mathop{d\mu} \le \int_{B_n} (|f_n|+|f|) \mathop{d\mu} \le 2M \int_{B_n} \mathop{d\mu}$$ where the last inequality is due to $|f_n| \le M$ and $|f| \le M$.

2

for $x=\pi$, the series is $$\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} \sin(n\pi) = \sum_{n=1}^{\infty} 0 = 0$$ so the series converges to 0 at $\pi$. We expect this because 0 is the midpoint between $g(-\pi)$ and $g(\pi)$

2

The two series $$f(z)=\sum \frac{z^n}{n},\quad g(z)=\sum (-1)^n\frac{z^n}{n}$$ are a counterexample to your conjecture, because $f(z)$ converges everywhere on the unit disk except at $z=1$ while $g(z)$ converges everywhere on the unit disk except at $z=-1$ (note, indeed, that $f(-z)=g(z)$). The answer to your second question is affirmative, as one can ...

2

One may consider, $\dfrac1{x_n^2}=\pi n$, with $n=1,2,3,\ldots$, giving $$\lim _{x_n\to 0}\:\frac{\sin\left(\frac{1}{x_n^2}\right)}{x_n^2}=\lim _{n\to +\infty}\pi n \times \sin(\pi n)=0$$ and one may consider, $\dfrac1{y_n^2}=(4n+1)\dfrac{\pi}2$, with $n=0,1,2,\ldots$, giving $$\lim _{y_n\to ... 2 break it up. a_n=\sum \limits_{k=1}^{n} \frac{2^kn}{2^{k+1}n^2+2^kk} + \sum\limits_{k=1}^{n} \frac{2n^2}{2^{k+1}n^2+2^kk}+\sum\limits_{k=1}^{n} \frac{k}{2^{k+1}n^2+2^kk}. Since every element of each of those series is greater than zero, the series for a_n converges iff all three of the above converge, and diverges if any of the above diverge. \sum ... 2 Let f_n(x) = e^{-x^2} n \sin\left(\dfrac{x}{n}\right)\cdot \chi_{[0,n^2]}(x). On the interval [0,1], this is a monotone increasing sequence of functions, and MCT can be applied. On the interval [1,\infty), you have$$ \int^{n^2}_1 e^{-x^2} n \sin\left(\frac{x}{n}\right) \, dx = \int\limits_{[1,\infty)} f_n(x)\,dx $$and$$ |f_n(x)| \le xe^{-x^2} ...

2

For $\;|x|<1\;$ : $$\frac1{1-x^2}=\sum_{n=0}^\infty x^{2n}\stackrel{\text{diff.}}\implies\frac{2x}{(1-x^2)^2}=\sum_{n=1}^\infty 2n\,x^{2n-1}$$ Now just do a little cosmetics to the above and get your answer.

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# Time and WorkAptitude Questions and Answers

## 1. What is Work?

Technically speaking, Work is the quantity of energy transferred from one system to another but for question based on this topic, Work is defined as the amount of job assigned or the amount of job actually done.

## 2. Analogy with Time-Speed-Distance

Problem on work are based on the application of concept of ratio of time and speed. Work is always considered as a whole or one. There exists an analogy between the time-speed-distance problems and work.

Work based problem are more or less related to time speed and distance.

Above mentioned definition of work throws light on three important points.

Work = 1 (It is always measured as a whole) = Distance

Rate at which work is done = speed

Number of days required to do the work = Time

#### Example:

If Ram and Raman can do a job in 10 days and 15 days independently, how many days would they take to complete the same job working simultaneously?

#### Solution:

If total work is $W$, Ram's rate of working = $\dfrac{W}{10}$ per day and that of Raman = $\dfrac{W}{15}$ per day.

Thus when working simultaneously, rate of work done = $\dfrac{W}{10} + \dfrac{W}{15}$ and thus time taken:

$=\dfrac{W}{W/10 + W/15} = \dfrac{15*10}{15+10}$

$= 6 \text{ Days}$

#### Alternatively:

above problem can be worked out assuming work to be just 1 unit and thus eliminating use of W.

Assume the total work to be the LCM of the days taken individually i.e. LCM of 10 & 15 i.e. 3o units of work.

Thus Ram’s rate of working = 3 units per day and Raman’s rate of working = 2 units per day.

When working simultaneously, $3+2=5$ units of work is done every day and thus it would take $30/5 = 6$ Days.

#### Note:

ALL problems or work can be solved in either way and both ways take almost the same time as there are exactly the same numbers of calculations involved. However if you are not comfortable with fraction, the approach using LCM may seem better to you.

## 3. Important Formulae

### 3.1. Work from Days

If A can do a piece of work in n days, then A's 1 day's work $= \dfrac{1}{n}$

### 3.2. Days from Work

If A's 1 day's work $=\dfrac{1}{n}$, then A can finish the work in n days.

### 3.3. Ratio

1. If A is thrice as good a workman as B, then:

2. Ratio of work done by A and B $= 3 : 1.$

3. Ratio of times taken by A and B to finish a work $= 1 : 3$

4. If A is $x$ times as good a workman as B, then he will take $\left(\dfrac{1}{x}\right)^{th}$ of the time by B to do the same work.

5. A and B can do a piece of work in 'a' days and 'b' days respectively, then working together, they will take $\dfrac{xy}{x+y}$ days to finish the work and in one day, they will finish $\left(\dfrac{x+y}{xy}\right)^{th}$ part of work.

Hide

Number formats

Decimals
Lofoya.com   2016

You may drag this calculator


text:
# Math Help - Question on Quadratic Application

1. ## Question on Quadratic Application

A parabola whose equation is y=x2-2x+k has a turning point with coordinates (1,-5). Find the value of K

2. Originally Posted by hawk123
A parabola whose equation is y=x2-2x+k has a turning point with coordinates (1,-5). Find the value of K
$y(1) = -5$

$-5 = (1)^2 - 2(1) + k$

3. y
= x^2 - 2x + k
= x^2 - 2x + (-2/2)^2 - (-2/2)^2 + k
= x^2 - 2x + 1 - 1 + k
= (x^2 - 2x + 1) + (k - 1)
= (x - 1)^2 + (k - 1)
= (x - H)^2 + (K)
where (H,K) is the turning point = (1, -5)
hence -5 = k - 1
k = -4


text:
## Results (1-50 of at least 1000)

Next
Label $\alpha$ $A$ $d$ $N$ $\chi$ $\mu$ $\nu$ $w$ prim arith $\mathbb{Q}$ self-dual $\operatorname{Arg}(\epsilon)$ $r$ First zero Origin
2-624-1.1-c1-0-0 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0 0 0.828386 Modular form 624.2.a.k.1.1 2-624-1.1-c1-0-1 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0$ $0$ $1.17745$ Elliptic curve 624.e Modular form 624.2.a.e Modular form 624.2.a.e.1.1
2-624-1.1-c1-0-10 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0.5 1 2.05225 Elliptic curve 624.c Modular form 624.2.a.c Modular form 624.2.a.c.1.1 2-624-1.1-c1-0-11 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0.5$ $1$ $2.29216$ Elliptic curve 624.f Modular form 624.2.a.f Modular form 624.2.a.f.1.1
2-624-1.1-c1-0-2 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0 0 1.20573 Elliptic curve 624.d Modular form 624.2.a.d Modular form 624.2.a.d.1.1 2-624-1.1-c1-0-3 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0$ $0$ $1.36526$ Modular form 624.2.a.k.1.2
2-624-1.1-c1-0-4 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0 0 1.38605 Elliptic curve 624.h Modular form 624.2.a.h Modular form 624.2.a.h.1.1 2-624-1.1-c1-0-5 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0$ $0$ $1.48749$ Elliptic curve 624.g Modular form 624.2.a.g Modular form 624.2.a.g.1.1
2-624-1.1-c1-0-6 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0 0 1.62121 Elliptic curve 624.i Modular form 624.2.a.i Modular form 624.2.a.i.1.1 2-624-1.1-c1-0-7 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0$ $0$ $1.67948$ Elliptic curve 624.j Modular form 624.2.a.j Modular form 624.2.a.j.1.1
2-624-1.1-c1-0-8 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 1.1 $$1.0 1 0.5 1 1.88069 Elliptic curve 624.a Modular form 624.2.a.a Modular form 624.2.a.a.1.1 2-624-1.1-c1-0-9 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 1.1$$ $1.0$ $1$ $0.5$ $1$ $2.01665$ Elliptic curve 624.b Modular form 624.2.a.b Modular form 624.2.a.b.1.1
2-624-12.11-c1-0-0 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0.5 0 0.280569 Modular form 624.2.d.h.287.2 2-624-12.11-c1-0-1 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.416$ $0$ $0.350415$ Modular form 624.2.d.c.287.2
2-624-12.11-c1-0-10 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0.0833 0 1.22806 Modular form 624.2.d.a.287.2 2-624-12.11-c1-0-11 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.152$ $0$ $1.29172$ Modular form 624.2.d.b.287.1
2-624-12.11-c1-0-12 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0.0367 0 1.35961 Modular form 624.2.d.g.287.3 2-624-12.11-c1-0-13 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.0367$ $0$ $1.42831$ Modular form 624.2.d.g.287.4
2-624-12.11-c1-0-14 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0 0 1.43337 Modular form 624.2.d.h.287.3 2-624-12.11-c1-0-15 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.203$ $0$ $1.54764$ Modular form 624.2.d.i.287.2
2-624-12.11-c1-0-16 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0 0 1.55494 Modular form 624.2.d.h.287.4 2-624-12.11-c1-0-17 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.370$ $0$ $1.82144$ Modular form 624.2.d.g.287.1
2-624-12.11-c1-0-18 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0.416 0 2.04195 Modular form 624.2.d.c.287.1 2-624-12.11-c1-0-19 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.203$ $0$ $2.14075$ Modular form 624.2.d.i.287.4
2-624-12.11-c1-0-2 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 -0.203 0 0.442798 Modular form 624.2.d.i.287.1 2-624-12.11-c1-0-20 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.250$ $0$ $2.15445$ Modular form 624.2.d.f.287.1
2-624-12.11-c1-0-21 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 -0.5 0 2.24219 Modular form 624.2.d.h.287.1 2-624-12.11-c1-0-22 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $0.347$ $0$ $2.30677$ Modular form 624.2.d.e.287.1
2-624-12.11-c1-0-23 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 0.416 0 2.42821 Modular form 624.2.d.d.287.1 2-624-12.11-c1-0-3 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.370$ $0$ $0.605369$ Modular form 624.2.d.g.287.2
2-624-12.11-c1-0-4 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 -0.347 0 0.754605 Modular form 624.2.d.e.287.2 2-624-12.11-c1-0-5 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.0833$ $0$ $0.778910$ Modular form 624.2.d.a.287.1
2-624-12.11-c1-0-6 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 -0.416 0 0.873744 Modular form 624.2.d.d.287.2 2-624-12.11-c1-0-7 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.152$ $0$ $0.918931$ Modular form 624.2.d.b.287.2
2-624-12.11-c1-0-8 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 12.11 $$1.0 1 -0.250 0 0.989461 Modular form 624.2.d.f.287.2 2-624-12.11-c1-0-9 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 12.11$$ $1.0$ $1$ $-0.203$ $0$ $0.998652$ Modular form 624.2.d.i.287.3
2-624-13.10-c1-0-0 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 -0.419 0 0.394876 Modular form 624.2.bv.g.49.3 2-624-13.10-c1-0-1 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $-0.429$ $0$ $0.526303$ Modular form 624.2.bv.f.49.2
2-624-13.10-c1-0-10 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 0.290 0 1.82805 Modular form 624.2.bv.b.49.1 2-624-13.10-c1-0-11 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $0.373$ $0$ $1.83210$ Modular form 624.2.bv.c.49.1
2-624-13.10-c1-0-12 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 0.373 0 2.42272 Modular form 624.2.bv.e.49.1 2-624-13.10-c1-0-13 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $-0.376$ $1$ $2.84684$ Modular form 624.2.bv.a.49.1
2-624-13.10-c1-0-2 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 -0.237 0 0.654665 Modular form 624.2.bv.d.49.2 2-624-13.10-c1-0-3 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $-0.126$ $0$ $0.792849$ Modular form 624.2.bv.c.49.2
2-624-13.10-c1-0-4 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 -0.283 0 1.09157 Modular form 624.2.bv.g.49.4 2-624-13.10-c1-0-5 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $-0.126$ $0$ $1.09935$ Modular form 624.2.bv.e.49.2
2-624-13.10-c1-0-6 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 0.0751 0 1.21703 Modular form 624.2.bv.d.49.1 2-624-13.10-c1-0-7 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $-0.0662$ $0$ $1.24323$ Modular form 624.2.bv.f.49.1
2-624-13.10-c1-0-8 $2.23$ $4.98$ $2$ $2^{4} \cdot 3 \cdot 13$ 13.10 $$1.0 1 -0.0273 0 1.37376 Modular form 624.2.bv.g.49.1 2-624-13.10-c1-0-9 2.23 4.98 2 2^{4} \cdot 3 \cdot 13 13.10$$ $1.0$ $1$ $0.149$ $0$ $1.61672$ Modular form 624.2.bv.g.49.2


text:
# Why do we have freedom to choose a renormalization scale in massless QFT theories?

I thought that the freedom to choose renormalization conditions arises from the freedom to choose the arbitrary renormalization parameters. Let me exemplify this in a

### Massive $$\phi^4$$ scalar theory

Let's denote with a subscript $$_0$$ bare quantities and let $$\phi$$ be the renormalized field defined by $$\phi_0 =: \sqrt{A} \, \phi$$ for some arbitrary constant $$A$$, so that $$$$\begin{split} \mathcal{L} &= \frac{1}{2}(\partial \phi_0)^2 - \frac{1}{2}m_0^2\phi_0^2-\frac{1}{4!}\lambda_0\phi_0^4 \\ &\equiv \frac{1}{2} A(\partial \phi)^2 - \frac{1}{2}m_0^2A\phi^2-\frac{1}{4!}\lambda_0A^2\phi^4 \\ &\equiv \frac{1}{2}(\partial \phi)^2 - \frac{1}{2}\tilde{m}^2\phi^2-\frac{1}{4!}\tilde{\lambda}\phi^4 + \frac{\delta_Z}{2}(\partial \phi)^2 - \frac{\delta_m}{2}\phi^2-\frac{\delta_{\lambda}}{4!}\phi^4 \\ \end{split}$$$$

This is just a rewriting, identically true for any choice of the renormalization parameters $$A, \tilde{m}, \tilde{\lambda}$$ upon $$A = 1 + \delta_Z , \quad A m_0^2 = \tilde{m}^2 + \delta_m , \quad A^2 \lambda_0 = \tilde{\lambda} + \delta_{\lambda}$$

Let's focus on $$A$$ and $$\tilde{m}$$. From Dyson resummation and Kallen-Lehmann representation the Fourier bare propagator is $$\mathcal{F}\left[ \langle\Omega|T\phi_0(x)\phi_0(y)|\Omega\rangle \right](p) \equiv G_0(p) = \frac{i}{p^2-m_0^2 - M_0^2(p^2)} = \frac{iZ}{p^2-m^2} + \text{regular at } p^2 = m^2$$ where $$-iM_0^2(p^2)$$ is the sum of Fourier amputated 1PI bare diagrams and $$m$$ is the physical mass.

Then the Fourier renormalized propagator has, on one side, the same Dyson structure of the bare one upon $$m_0 \rightarrow \tilde{m}$$ and $$M_0^2 \rightarrow M^2$$, on the other it's simply $$\frac{G_0(p)}{A}$$ per definition of renormalized field:

$$\mathcal{F}\left[ \langle\Omega|T\phi(x)\phi(y)|\Omega\rangle \right](p) \equiv G(p) = \frac{i}{p^2-\tilde{m}^2 - M^2(p^2)} = \frac{i \, Z/A}{p^2-m^2} + \text{regular at } p^2 = m^2$$ where $$-iM^2(p^2)$$ is the sum of Fourier amputated 1PI renormalized diagrams and $$m$$ is again the physical mass.

In particular the renormalized propagator still has a pole at the physical mass and it's residue there it's $$i \, Z/A$$:

$$p^2 - \tilde{m}^2 - M^2(p^2) |_{p^2 = m^2} = 0 \Rightarrow M^2(m^2) = m^2 - \tilde{m}^2 \quad \quad \quad (*)$$

$$i \, Z/A = \frac{i}{1-\frac{d}{dp^2} M^2(p^2)|_{p^2 = m^2}} \Rightarrow \dot{M}^2(m^2) = 1-(Z/A)^{-1} \quad \quad (**)$$

These are all facts. But we still have the freedom to choose $$A$$ and $$\tilde{m}$$: an obvious choice is

$$A \overset{!}{=} Z , \quad \tilde{m} \overset{!}{=}m \Rightarrow M^2(m^2) = 0, \quad \dot{M}^2(m^2) = 0$$

Another possibile choice is to introduce some renormalization scale $$\mu$$ so that

$$M^2(-\mu^2) = 0, \quad \dot{M}^2(-\mu^2) = 0$$

We can choose 2 conditions because we have 2 free parameters, $$A$$ and $$\tilde{m}$$. This choice implicitly constraints these parameters in function of $$\mu$$ via equations $$(*), (**)$$; this dependence is described by Callan-Symanzik equation.

Question 1: is my understanding correct so far?

### Massless theory

In the massless theory all goes the same way, but since no $$\tilde{m}$$ is introduced we have only one degree of freedom, $$A$$, to choose. Following the same reasoning as before without $$m_0, m$$ and $$\tilde{m}$$ around the renormalized propagator must still have a pole at $$p^2 = 0$$, so equation (*) seems constrained to $$M^2(0)=0$$.

Question 2: Why do we have the freedom to choose again $$M^2(-\mu^2)=0$$ ?

• You do introduce $\bar{m}$ in the massless model. You also introduce $m_0$. This is the same number of parameters as before. What makes it massless is that the pole of the two point function $m=0$. – octonion Oct 16 '18 at 0:45
• If we introduced $\tilde{m}$ and $m_0$ and just set $m=0$ this would mean for the Fourier renormalized propagator $G(p^2 = -\mu^2) = \frac{i}{-\mu^2 - \tilde{m}^2}$, where $\tilde{m}$ depends on $\mu$ via the CS equation. But Peskin&Schroeder, pag. 408, reads (in this notation) $G(p^2 = -\mu^2) = \frac{i}{-\mu^2}$, as if no $\tilde{m}$ was ever introduced. – DavideL Oct 18 '18 at 17:12
• Okay fair enough, so they absorbed $\tilde{m}^2$ into $M^2$. There's no problem with that, $\tilde{m}^2$ was only introduced for convenience. The important thing is there is a bare mass and thus a mass counterterm $\delta_m$. You can see how they explicitly calculate in this scheme on page 412. – octonion Oct 18 '18 at 18:30
• The counterterms $\delta_m$ etc. are parameters too. Maybe that is the key to your question. – octonion Oct 18 '18 at 18:33
• Thanks, this makes sense. Let me see if I get it. Being massless means that the pole of the two point function is at $p^2 = 0$. There still is a bare mass and thus mass counterterm. This answers my original question on the number of degrees of freedom necessary to choose the ren. cond. As for my previous comment, you're saying that the ren. condition is actually chosen to be $-\tilde{m}^2 - M^2(-\mu^2) = 0$. Fair enough. Does this mean that $\tilde{m}$ is the running coupling, depending on $\mu$ by this constraint? – DavideL Oct 18 '18 at 18:43

In the massless theory all goes the same way, but since no $$\tilde{m}$$ is introduced we have only one degree of freedom, $$A$$, to choose... Question 2: Why do we have the freedom to choose again $$M^2(-\mu^2)=0$$ ?
For massless $$\phi^4$$ scalar theory, you still have the freedom to choose the mass renormalization condition. The reason is that nothing prevents the scalar field from gaining a mass from quantum corrections. So there is practically no difference between massive and massless $$\phi^4$$ scalar theories. This is actually all the fuss about surrounding the "naturalness" of the Higgs model: Higgs (as a $$\phi^4$$ scalar theory) can have mass quantum corrections all the way up to the Planck scale, regardless of the initial mass the Higgs field has.


text:
# Implicit function graphing

I came across the function, $$z=\frac{4xy(x^2-y^2)}{x^2+y^2}$$ and I had to draw the level curve for this equation. Clearly the equation is already explicitly expressed in the form $$z=f(x,y)$$ and therefore for every value of $$z$$, the "shape" of the curve would be the same. We assume $$z$$ to be some constant $$c$$ and proceed. The main problem arises when we try to graph the following function which is now implicit in $$x$$ and $$y$$: $$c=\frac{4xy(x^2-y^2)}{x^2+y^2}$$

MY ATTEMPT: Firstly I tried proceeding normally. The function does not seem to be defined at the origin $$(0,0)$$. Now I tried checking behaviour at infinity. $$c=\lim_{x\to\infty}\frac{4xy(x^2-y^2)}{x^2+y^2}$$ Now the very first question that arises is how do we deal with $$y$$? We do not know if the limit of $$y$$ as $$x$$ approaches $$\infty$$ is $$0$$, $$\infty$$ or finite. Therefore we cannot comment on how the function behaves at either infinity. The next thing that we do is look at the derivative. The derivative here is: $$y'= \frac{12xy^2+4y^3-12x^2y+2cx}{4x^3-2cy}$$ Clearly this derivative is also difficult to handle because of the implicit nature of the function. The only takeaway from it is the fact that there exists a vertical asymptote at those points where $$y=\frac{2x^3}{c}\;\;\;\;\;\;...(1)$$ which again being tedious gives this: $$64x^8+(8c-8c^2)x^4+c^3=0$$ which anyone would discard at first look. If we just had to solve equation $$(1)$$ and our curve we could have tried approximating and playing around with graphs but that does not work here because the graph is what we actually want. Clearly I have ventured the wrong way, correct it is, but too rigorous to be solved.

MY 2nd ATTEMPT: Another train of thought that arises is to try polar coordinates, which, by the way, was also suggested in the book. Doing so, we get the curve to be: $$c= r^2sin(4\theta)$$ Now the problem here is that the polar system is a lot less intuitive compared to the Cartesian coordinate system as the variables deal with distance from the origin and angle with the x-axis. I still do not see a clear way out.

So how do we deal with this? I know that a graphing calculator is the simplest solution, but then I am not a fan, especially in a question that deals specifically with "sketching" a graph. The book is old enough that there weren't any easily available graphing calculators around like we have today. So, could someone describe the technique to sketch this curve or is it that there isn't any?

P.S: I have seen some Stack Exchange questions and browsed the internet but those were simpler ones like $$x=f(y)$$ or $$y^2=f(x)$$ type, so I won't be linking them here.

As mentioned in the hint, you can write this as

$$c = r^2 \sin(4\theta)$$

For $$c=0$$, $$r=0$$ or $$\sin(4\theta) = 0$$ when $$\theta$$ is a multiple of $$\pi/4$$. That is, the level curve for $$z=0$$ consists of the $$x$$ and $$y$$ axes and the lines $$y=x$$ and $$y=-x$$.

For $$c \ne 0$$, $$r = \sqrt{c/\sin(4\theta)}$$. Of the eight intervals $$(0, \pi/4), (\pi/4, \pi/2), \ldots, (7\pi/4, 2\pi)$$, there are four where $$\sin(4\theta)$$ has the same sign as $$c$$. This gives you curves that are closest to the origin at the middle of the interval, and go off to $$\infty$$ as you approach the endpoints. The curves are symmetric under rotation by $$\pi/2$$.

• Sir, how did you come to the conclusion that in the level curves where $z\ne0$ the curves are closest to the origin at the mid point of the interval? – Tesla's Coil Oct 28 '20 at 18:28


text:
# Evaluation metric and Class Imbalance in Label Propagation

I'm using the MAD Label Propagation algorithm as described in the following paper "New Regularized Algorithms for Transductive Learning" by Partha Pratim Talukdar and Koby Crammer http://talukdar.net/papers/adsorption_ecml09.pdf

I have two labels, say A and B. Around 300k vertices and 1.4 million edges. I'm using it in the classification setting. However, I have a doubt regarding evaluation:
The labels A and B are mostly complimentary. Presence of one indicated absence of the other.

I'm holding back around 20% of the labels for evaluation But how should I evaluate the performance? If score(A) > score(B) for a node does it imply label A has a stronger association with the node? In the paper, it looks like the scores for each label are calculated independently of the scores for the other labels. There doesn't seem to be a notion of 'discrimination' between nodes, as is the case in traditional classifiers like Logistic Regression, Booted trees etc.
In that case does it even make sense to compare the scores for 2 labels for a given node?

Or should I instead take the top-K scored nodes (from the test set) for a each label and see what fraction of them are actually correct?

Moreover, my labels are imbalanced. Around 87% A and 13% B. How does this affect the scores? From the paper it seems the algorithm is heavily susceptible to class imbalance. Is there any way to overcome this?

PS: This is one of my first questions on this site. Please call out any mistakes or bad practices I may have used in farming/presenting the question

• By minimum keep the ratio of $A$ and $B$ labels the same in the training and test data (Stratified split). Some kind of resampling might be a good idea but I let others (who are more experienced) comment on that. – mmh Sep 26 '15 at 17:09

In 2-class label propagation methods, you can use the approach of class mass normalization to make the final prediction instead of maximum score. Please refer to section Incorporating Class Prior Knowledge Semi-Supervised Learning Using Gaussian Fields and Harmonic Functions

• That seems to be a highly complex solution to a simple problem. If class imbalance matters you are using the wrong metrics. Use continuous information-preserving metrics. See for example this and this. – Frank Harrell Jun 16 at 12:48


text:
# Henry Cavendish

Henry Cavendish

Henry Cavendish (born October 10, 1731 in Nice , † February 24, 1810 in London ) was a British natural scientist . His best-known achievements are the discovery of the element hydrogen and the first experimental determination of the mean density of the earth (“weighing the earth”), which subsequently made it possible to determine the gravitational constants .

## Life

Henry Cavendish obituary

Henry Cavendish was the son of Lord Charles Cavendish (a son of William Cavendish, 2nd Duke of Devonshire , 1704–1783), and Lady Anne Gray, daughter of Henry Gray, 1st Duke of Kent . The Cavendish family belonged to the long-established nobility and were closely associated with many other important noble families in Great Britain . Henry was born in Nice in 1731, where - according to George Cavendish, 1st Earl of Burlington - his mother stayed because of her poor health. His mother died in 1733 after the birth of his brother Frederick (1733-1812).

At the age of eleven, Cavendish was a student at Newcome's School in Hackney , one of the largest and most recognized private schools of the 18th century. On December 18, 1749 he became a student at Peterhouse College, University of Cambridge , which he left on February 23, 1753 without a degree. His first scientific work appeared in 1766 and was entitled Experiments on Factitious Airs ("artificial types of air", i.e. gases produced by chemical reactions). After traveling through Europe with his brother Frederick, he lived with his father in Soho (London) until his death in 1783 . During this time he carried out his electrical and most of his chemical research. He began as an assistant to his father, who carried out scientific experiments himself. At the age of 40, Henry Cavendish inherited a great fortune that enabled him to continue his scientific studies. After his father's death, he moved to a villa in Clapham Common, where he set up a large experimental laboratory. He also owned a town house in Bloomsbury, London, and another house for his library on Dean Street, Soho. He attended the meetings of the Royal Society, of which he became a fellow in 1760 and whose members he dined on Thursdays. Otherwise he avoided social events and even Lord George Cavendish , whom he later made his main heir, he only saw once a year for a few minutes. Apart from that, the inheritance hardly changed anything about his modest lifestyle.

Cavendish exhibited eccentric behavior . He ordered his dinner every day by a note he left on the hall table, and his female employees were instructed to stay out of sight if they did not want to risk being fired. He was extremely shy of women and strangers and avoided talking to them at all. He was a tall man with a high-pitched, thin voice and wore a worn, faded, purple velvet suit and tricorn hat from the previous century. He was a taciturn loner.

One of his most important collaborators was Charles Blagden , who was involved in a large number of his experiments. There is also an intensive correspondence between the two scientists. In 1790 Cavendish also met Alexander von Humboldt , who soon accepted his chemical knowledge. In 1803 he became a member of the Académie des Sciences in Paris.

Cavendish conducted innumerable scientific studies and experiments, most of which, however, remained unpublished during his lifetime. In his entire life, he has only published 20 articles and not a single book. It was not until long after his death, towards the end of the 19th century, that James Clerk Maxwell began to study Cavendish's research and realized that many scientific achievements had already been anticipated by him, such as Ohm's law , Dalton's law , the law von Gay-Lussac and the principles of electrical conductivity. In 1879 he published Cavendish's Experimental Researches . He also expressed his astonishment that he created a detailed manuscript of his research and extensively investigated special questions in his experiments, which at the time only he knew how to appreciate, but which he never published his elaborated manuscripts.

Cavendish died on February 24, 1810 and was buried in All Saints Church in Derby (now Derby Cathedral). He left an important fortune to Lord George Cavendish, the great-grandson of William Cavendish, 2nd Duke of Devonshire . Henry Cavendish was the grandson of the latter. His estate was £ 700,000 with property income of £ 8,000 a year and £ 50,000 with his bank. In 1871, William Cavendish, 7th Duke of Devonshire and principal of the University of Cambridge, donated the money to establish the physics department of the University of Cambridge called Cavendish Laboratory . James Clerk Maxwell was the first director and first Cavendish professor .

The lunar crater Cavendish and the asteroid (12727) Cavendish are named after him.

## plant

Cavendish's apparatus for generating and collecting the hydrogen

### Discovery of hydrogen and rejection of the phlogiston theory

In 1766, Cavendish discovered a gas that was formed by the action of acid on metals, but failed to realize that it was a chemical element. He called the gas inflammable air and interpreted it to mean that the combustible air had escaped from the metal. Since it formed in the same way with different acids, he identified it with the long-sought hypothetical substance phlogiston , which is released from the body when it burns. He tested this by treating the limes, which were left over from the burning of metals and should no longer contain phlogiston , with acid. No flammable air was formed. Joseph Priestley also found in 1782 that metal limes were converted back into metal by the combustible air and the combustible air disappeared in the process. The next step took place after Cavendish repeated Priestley's oxyhydrogen tests in 1781 , in which a "rope" had formed. He found that the "dew" was pure water. Thus water was not elemental, but the long-sought compound oxide of the inflammable air. It consists of the combustible air discovered by Cavendish, soon to be called hydrogen, and oxygen, discovered by Priestley in 1774. In the meantime Lavoisier had also learned of Cavendish's experiments in 1783, quickly picked up on them and in some cases presented them in such a spectacular way that Cavendish's experiments were overshadowed by them. Cavendish's series of experiments to interpret the synthesis of water showed, as did Lavoisier's experiments, the great importance of quantitative measurements in chemistry.

Even after his experiments on the synthesis of water, Cavendish himself stuck to the phlogiston doctrine, which he only reinterpreted. According to him, what Lavoisier took to be the element hydrogen was water bound to phlogiston, while Lavoisier's oxygen was the water from which phlogiston was withdrawn. In the case of the formation of water from hydrogen and oxygen, only phlogiston would have been exchanged.

### Determination of the gravitational force and the mass of the earth

Cavendish was the first to succeed in 1797 in an experiment with two bodies of known mass to observe their mutual attraction. This phenomenon had been postulated a century earlier by Isaac Newton in his law of gravitation explaining the motion of planets and the weight of bodies on earth. Using a sensitive rotating balance , Cavendish was able to demonstrate and measure the force with which the heavier test specimen with the mass m 1  = 158 kg and the lighter test specimen with the mass m 2  = 0.73 kg attract each other after shielding all known interferences . The experiment determined assuming the correctness of the postulated by Newton law of gravitation indirectly the mass M planet Earth and thus their average density. The experiment has therefore been popularly referred to as weighing the earth . It is sufficient to assume that the attraction of two spherical bodies is proportional to the product of their masses and inversely proportional to the square of the distance between their centers, so that the ratio of two gravitational forces depends exclusively on the ratio of the masses and distances. In detail, the following applies to the ratio of the force F sample , with which the light test specimen is attracted by the heavy one, and the force F earth , with which the light test specimen is attracted to the earth (i.e. its weight):

${\ displaystyle {\ frac {F _ {\ rm {Sample}}} {F _ {\ rm {Earth}}}} = {\ frac {\ frac {m _ {\ rm {1}} \ cdot m _ {\ rm { 2}}} {R _ {\ rm {12}} ^ {2}}} {\ frac {M _ {\ rm {Earth}} \ cdot m _ {\ rm {2}}} {R _ {\ rm {Earth} } ^ {2}}}} = {\ frac {m _ {\ rm {1}} \ cdot R _ {\ rm {Earth}} ^ {2}} {M _ {\ rm {Earth}} \ cdot R _ {\ rm {12}} ^ {2}}} \ \,}$

R 12R earth are the respective distances. The mass m 2 of the light specimen does not have to be known because it stands out. After measuring F sample , M earth is the last remaining unknown and can be easily determined.

Cavendish experiment (1798)

The measuring device - a torsion balance - originally came from the geologist John Michell , who completed it shortly before his death in 1793, but did not take any more measurements himself. Cavendish emphasized that Michell had the idea before Coulomb , who in 1785 had studied electrostatic attraction and repulsion in the same way. To prove the much weaker gravitation, Cavendish had to partially rebuild the balance in order to eliminate disruptive factors, in particular the influence of the slightest temperature fluctuations. He therefore operated his experiment from another room and read the measured values with a telescope. The angular deflection of a dumbbell suspended on a torsion thread with two lead balls was measured when they were attracted by two larger lead balls brought into close proximity. According to Hooke's law, the restoring force was assumed to be proportional to the deflection angle. Cavendish carried out his experiment 17 times with 29 measurements over the course of a year, taking into account even the smallest possible disturbances. His final results for G deviate by 1.2 percent and for the density of the earth by 0.6 percent from today's value. With knowledge of the absolute earth mass, the masses of other bodies of the solar system could now also be determined from the law of gravitation, which like the earth are orbited by observable companions.

Cavendish's experiment is now considered a classic in the history of physics. It is evaluated as the first determination of the gravitational constant G , which is one of the three fundamental natural constants . Cavendish himself was still far from this point of view, even the term "gravitational constant" could only appear in the second half of the 19th century, after the conceptual prerequisite for it had been created in 1873 with the first general definition of a unit of force ( dynes ).

## Works (selection)

• Henry Cavendish: An Attempt to Explain Some of the Principal Phenomena of Electricity, by means of an Elastic Fluid: By the Honorable Henry Cavendish, FRS Phil. Trans. January 1, 1771 61: 584-677; doi: 10.1098 / rstl.1771.0056 ( full text )
• Henry Cavendish: Experiments to Determine the Density of the Earth . Philosophical Transactions of the Royal Society of London, Vol. 88 (1798), 469-526 ( full text )
• Henry Cavendish in: Philosophical Transactions of the Royal Society of London (1776–1886) . Internet archives online
• James Clerk Maxwell (Ed.): The electrical researches of the Honorable Henry Cavendish; edited by J. Clerk Maxwell. Written between 1771 and 1781. Edited from the original Manuscripts in the Possession of the Duke of Devonshire . Cambridge University, Press 1879, archive.org

## literature

Commons : Henry Cavendish  - collection of images, videos and audio files
Wikisource: Henry Cavendish  - Sources and full texts

## Remarks

1. Since weighing is the determination of the weight that the earth would have if it were placed on its own surface on a scale, this description is illogical in itself.

## Individual evidence

1. ^
2. Blagden's correspondence list In: Archives associated with this Fellow in the entry on Cavendish; Henry (1731-1810); Natural Philosopher in the Archives of the Royal Society , London (English).
3. ^ Hanno Beck: Alexander von Humboldt . tape 1 . Steiner, Wiesbaden 1959, p. 26, 39-40 .
4. ^ List of members since 1666: Letter C. Académie des sciences, accessed on October 28, 2019 (French).
5. ^ Maxwell (Ed.): The Experimental Researches of the Honorouble Henry Cavendish. Cambridge University Press, 1879
6. ^ Isobel Falconer: arxiv : 1504.07437 Editing Cavendish: Maxwell and The Electrical Researches of Henry Cavendish . (Arxiv), Proceedings of the International Conference on the History of Physics 2014
7. ^
8. ^ Richard E. Dickerson, Harry B. Gray, Marcetta Y. Darensbourg: Principles of Chemistry. Walter de Gruyter & Co, Berlin 1988. p. 28.
9. Martin Carrier: Cavendish's version of phlogiston chemistry. P. 41.
10. Martin Carrier: Cavendish's version of phlogiston chemistry. uni-bielefeld.de ( Memento from November 29, 2014 in the Internet Archive )
11. ^ Henry Cavendish: Experiments to determine the Density of the Earth (PDF) 1798 (English).
12. BE Clotfelter: The Cavendish experiment as Cavendish knew it . At the. J. Phys. 55: 210 (1987); doi: 10.1119 / 1.15214


text:
0
2013
Impact Factor

# Natalia Gelfreikh

7/9 Universitetskaya Emb. St Petersburg 199034 Rus
Saint-Petersburg State University

## Publications:

 Gelfreikh N. G. Normal Forms for Three-parameter Families of Area-preserving Maps near an Elliptic Fixed Point 2018, vol. 23, no. 3, pp.  273-290 Abstract We study dynamics of area-preserving maps in a neighborhood of an elliptic fixed point. We describe simplified normal forms for a fixed point of codimension 3. We also construct normal forms for a generic three-parameter family which contains such degeneracy and use normal form theory to describe generic bifurcations of periodic orbits in these families. Keywords: area-preserving maps, resonant fixed point, normal form, bifurcation Citation: Gelfreikh N. G.,  Normal Forms for Three-parameter Families of Area-preserving Maps near an Elliptic Fixed Point, Regular and Chaotic Dynamics, 2018, vol. 23, no. 3, pp. 273-290 DOI:10.1134/S1560354718030048
 Gelfreich V. G., Gelfreikh N. G. Unique normal forms for area preserving maps near a fixed point with neutral multipliers 2010, vol. 15, no. 2-3, pp.  300-318 Abstract We study normal forms for families of area-preserving maps which have a fixed point with neutral multipliers $\pm 1$ at $\varepsilon = 0$. Our study covers both the orientation-preserving and orientation-reversing cases. In these cases Birkhoff normal forms do not provide a substantial simplification of the system. In the paper we prove that the Takens normal form vector field can be substantially simplified. We also show that if certain non-degeneracy conditions are satisfied no further simplification is generically possible since the constructed normal forms are unique. In particular, we provide a full system of formal invariants with respect to formal coordinate changes. Keywords: area-preserving map, unique normal form, parabolic fixed point Citation: Gelfreich V. G., Gelfreikh N. G.,  Unique normal forms for area preserving maps near a fixed point with neutral multipliers, Regular and Chaotic Dynamics, 2010, vol. 15, no. 2-3, pp. 300-318 DOI:10.1134/S1560354710020164