text:
Using QCTOOL v2 to process UK Biobank .bgen files - why so slow?
1
0
Entering edit mode
11 months ago

I’m currently using QCTOOL v2 to process imputed .bgen files from UK Biobank, however they seem to be processing very slowly. Is this normal?

My command is pretty basic; I’m filtering out a list of SNPs and samples:

/path_to/qctool \
-g /path_to/ukbXXXX_c22_b0_v3.bgen \
-s /path_to/ukbXXXX_c22_b0_v3.sample \
-og /output_path/ukb_c22_filt.bgen \
-os /output_path/ukb_c22_filt.sample \
-excl-rsids /path_to/snps_rem_c22.txt \
-excl-samples /path_to/samples_to_rem.txt

It is currently processing SNPs at a rate of 1.2/s (e.g. 71169/?,57205.8s,1.2/s). The computational facility I'm using should not be a speed limiter - have I made any mistakes in my qctool query? Or any other ideas on why it's running so slowly? Alternative suggestions on how to process these files would be appreciated (e.g. I would prefer to use QCTOOL but realising I may have to use PLINK).

ukbiobank plink qctool • 853 views
0
Entering edit mode

Hi! i am install qctool now, but i failed at compilation, did you meet the same issue? if so, how did you handle it? let me know, thanks!

1
Entering edit mode

Compiled binaries seem to be available in this directory: https://www.well.ox.ac.uk/~gav/resources/

0
Entering edit mode

Thank you so much!! I have visited the directory and tried to find out the one suit my system, but failed. however, i got version 2.0.7 last night, and finished compilation. Happy!

2
Entering edit mode
9 months ago

I contacted the QCTOOL team directly and received this response:

The design of BGEN means that when you subset samples the data has to be recompressed - this is essentially what makes this slow. (By contrast you can subset SNPs very quickly without recompression using bgenix https://code.enkre.net/bgen.) It is therefore definitely worth considering not subsetting samples but using a sample inclusion/exclusion list instead, if your analysis software supports that.

If you have to subset and want to use QCTOOL - some things to try are: I typically use the options -bgen-compression zstd -bgen-bits 8 now, c.f. https://doi.org/10.1101/308296 this is faster but first check your downstream software supports zstd compression. Use a map/reduce type pipeline (i.e. chunk data for re-encoding) - this can be implemented using bgenix and cat-bgen.

Have you tried first stripping the SNPs, then stripping the samples?

Ever since working with the imputed data from the UKB I was never successful in chopping pieces of bgen files using qctool in a timely manner. If my memory serves me well, qctool manages to strip SNPs fairly quickly, but is super slow to remove samples. Try PLINK 1.9 or 2.0.

As for “The computational facility I'm using should not limit the speed of an operation.”, depending on how disk data moves in/out of slave nodes and how busy the cluster is, I did saw processes to become I/O starved on large clusters.

Also, consider that most tools that perform association testing can utilize SNPs and samples lists. BOLT, SAIGE, regenie, SNPtest… so there might not be a need to pre-filter. Put “NA” as phenotypes you’d like to be “removed” from the testing.

In the end I did not pre-filter SNPs or samples - I set samples to NA within the phenotype file, and used a SNP inclusion list in the second stage of SAIGE with the flag idstoIncludeFile.


text:
# 4.3: Other Trace Gases

Hundreds of different trace gases have been measured in the atmosphere and perhaps thousands more have yet to be measured. Many of these are volatile organic compounds (VOCs). Volatile means that the compound may exist in the liquid or solid phase but that it easily evaporates. Organic means that the compound contains carbon but is not carbon dioxide, carbon monoxide, or carbides and carbonates found in rocks. There are also other chemicals like the nitrogen oxides (e.g., nitric oxide (NO), nitrogen dioxide (NO2), nitric acid (HNO3)), sulfur compounds (e.g., sulfur dioxide (SO2), sulfuric acid (H2SO4)) and halogen compounds (e.g., natural methyl chloride (CH3Cl), human-made chlorofluorocarbons (CCl2F2)). If we pay attention, we can often smell and identify many of these chemicals, even at trace levels, although some, like methane, carbon monoxide (CO), and chlorofluorocarbons are odorless. We enjoy smelling the VOCs emitted by trees in a forest – aah, that fresh pine smell – but we hold our nose to escape the smells of a stagnant swamp.

In addition to these thousands of chemicals that are emitted into the atmosphere every day, there are also some very reactive compounds that are created by atmospheric chemistry and play the important role of cleaning the atmosphere of many gases. The most important reactive gases are ozone (O3) and hydroxyl (OH). We will focus the discussion of atmospheric chemistry on these two.

## The Atmosphere’s Oxidizing Capacity

Earth’s atmosphere is an oxidizing environment. This term means what you think it would: gases that are emitted into the atmosphere react in a way that increases their oxygen content. Gases that contain oxygen tend to be “stickier” on surfaces and more water soluble, which means that they stick when they hit a surface or they can be readily taken up in clouds and rain drops and be deposited on Earth’s surface. We call gases hitting the surface and sticking “dry deposition” and gases being taken up in precipitation and rained out “wet deposition.”

Let’s consider a natural gas that is very important in our lives – methane (a.k.a., natural gas). More and more methane is being extracted from below Earth’s surface and used to run our electrical power plants, heat our homes, cook our food, and, increasingly, to run our transportation vehicles. Methane is a simple molecule – CH4 – in which each of carbon’s four bonds is made with a hydrogen atom. Energy comes from heating methane to high enough temperatures that cause it to react, giving off energy as more stable molecules are formed. In complete combustion, each methane molecule is converted into CO2 and two H2O. In the process, four oxygen atoms or two oxygen molecules are consumed.

This same process occurs in the atmosphere, but at much lower temperatures and at a much slower rate. In both cases, the first step in the methane oxidation sequence is the reaction with the hydroxyl radical (OH). In water, hydroxyl loses an electron and is ionized (OH-), but in the atmosphere, hydroxyl is not ionized. We call OH a free radical because it has an odd number of electrons (eight for oxygen and one for hydrogen). Any gas with an odd number of electrons is reactive because the electrons want to be paired up in molecules because that makes them more stable.

Often, combustion is inefficient, resulting in the formation of carbon monoxide (CO). Examples include forest fires, humans burning fields to clear them for planting, poorly tuned vehicles, inefficient industrial processes, and other human-caused processes. The primary way that CO is removed from the atmosphere is by reacting with atmospheric OH. It takes a while for CO to be removed from the atmosphere by the reaction with OH, so that satellite instruments can track CO plumes as they emerge from their sources and flow around the world.

## Where does OH come from?

Before we tackle this question, let’s first look at where ozone (O3) comes from. We will start with the stratosphere (a.k.a, good ozone because it blocks solar UV that harms humans, other animals, agriculture, and ecosystems) and then eventually we will consider tropospheric ozone (a.k.a., bad ozone, which is the ozone that hurts our health when we breathe it and that damages plants and their fruit).

Discussion Activity: Trace Gases

I would like you to think about which trace gas is the most important and why. By trace gas I mean a gas with a mixing ratio of less than 20 ppm in the atmosphere. Defend your choice. Use information from this lesson as well as other sources (credit them, please!) to describe the qualities of this gas that make you think that it is the most important trace gas. Then read the choices of your classmates and respond to their choices and follow-up with further questions and/or analysis

4.3: Other Trace Gases is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by William Brune (John A. Dutton: e-Education Institute) via source content that was edited to conform to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

format: plain


text:
A Study of Python's More Advanced Features Part II: Closures, Decorators and functools

Decorators

A decorator is a design pattern in which a class or function alters or adds to the functionality of another class or function without using inheritance, or directly modifying the source code. In Python, decorators are, in simplest terms, functions (or any callable objects) that take as input a set of optional arguments and a function or class, and return a function or class. They can be used to implement the decorator design pattern, or for other purposes. Class decorators are new in Python 2.6.

By the way, before you read further, if you are unfamiliar with Python's closures, make sure to familiarize yourself with them by looking at the closures appendix at the end of this article, as decorators can be hard to understand without a proper understanding of closures in Python.

Decorators are applied to a function or class using the @ symbol in Python. Let's use a simple decorator to log function calls as our first example. Here the decorator takes the time format as an argument and prints a log statement prior to and after every execution of the decorated function with the execution time. This can come in handy when you are comparing the efficiency of two different implementations of the same algorithm, or two separate algorithms, for example.

def logged(time_format):
def decorator(func):
def decorated_func(*args, **kwargs):
print "- Running '%s' on %s " % (
func.__name__,
time.strftime(time_format)
)
start_time = time.time()
result = func(*args, **kwargs)
end_time = time.time()
print "- Finished '%s', execution time = %0.3fs " % (
func.__name__,
end_time - start_time
)

return result
decorated_func.__name__ = func.__name__
return decorated_func
return decorator

Let's look at a use example. Here functions add1 and add2 are decorated using logged and a sample output is given. Notice that the time format argument is stored in the closure of the returned decorated functions. This is why an understanding of closures is important in understanding decorators in Python. Also notice how the returned function's name is replaced with the original function's name, in case it is used later on, to prevent confusion. Python does not do this by default.

@logged("%b %d %Y - %H:%M:%S")
time.sleep(1)
return x + y

@logged("%b %d %Y - %H:%M:%S")
time.sleep(2)
return x + y

# Output:
- Running 'add1' on Jul 24 2013 - 13:40:47
- Finished 'add1', execution time = 1.001s
3
- Running 'add2' on Jul 24 2013 - 13:40:48
- Finished 'add2', execution time = 2.001s
3

If you pay careful attention, you might notice that while we take extra care to make sure the returned function has the right __name__, we do not do so for __doc__, or __module__. So if, in our example, the add function had a doc string, it would be lost. How do we handle this? We could handle it similar to how we handled __name__ but doing so for every decorator becomes tedious. This is why the functools module provides a decorator named wraps which handles exactly this scenario. It might be a bit confusing to see a decorator used inside another, but when you think of decorators as simply functions that take in a function as parameter and return a function, everything makes perfect sense. The wraps decorator is used in our next examples instead of manually fixing __name__ and other such attributes.

Next example is a bit more complicated. Let's write a decorator that caches the result of a function call for a given number of seconds. The code relies on the arguments passed to the function to be hashable objects because we use a tuple with the args arguments as the first entry, and a frozen set of the items in the keyword arguments kwargs as the second entry as the cache key. Each function will have a unique cache dict generated for it which is stored in the function's closure.

import time
from functools import wraps

def cached(timeout, logged=False):
"""Decorator to cache the result of a function call.
Cache expires after timeout seconds.
"""
def decorator(func):
if logged:
print "-- Initializing cache for", func.__name__
cache = {}

@wraps(func)
def decorated_function(*args, **kwargs):
if logged:
print "-- Called function", func.__name__
key = (args, frozenset(kwargs.items()))
result = None
if key in cache:
if logged:
print "-- Cache hit for", func.__name__, key

(cache_hit, expiry) = cache[key]
if time.time() - expiry < timeout:
result = cache_hit
elif logged:
print "-- Cache expired for", func.__name__, key
elif logged:
print "-- Cache miss for", func.__name__, key

# No cache hit, or expired
if result is None:
result = func(*args, **kwargs)

cache[key] = (result, time.time())
return result

return decorated_function

return decorator

And here's how it's used. We apply the decorator to a very naive (and inefficient) Fibonacci number calculator. The cache decorator will effectively apply the memoize pattern to the code. Notice how the closure of fib contains the cache dict, a reference to the original fib function, the value of the logged argument, and finally the value of the timeout argument. dump_closure is defined at the end of the article, under the closures section.

>>> @cached(10, True)
... def fib(n):
...     """Returns the n'th Fibonacci number."""
...     if n == 0 or n == 1:
...         return 1
...     return fib(n - 1) + fib(n - 2)
...
-- Initializing cache for fib
>>> dump_closure(fib)
1. Dumping function closure for fib:
-- cell 0  = {}
-- cell 1  = <function fib at 0x10eae7500>
-- cell 2  = True
-- cell 3  = 10
>>>
>>> print "Testing - F(4) = %d" % fib(4)
-- Called function fib
-- Cache miss for fib ((4,), frozenset([]))
-- Called function fib
-- Cache miss for fib ((3,), frozenset([]))
-- Called function fib
-- Cache miss for fib ((2,), frozenset([]))
-- Called function fib
-- Cache miss for fib ((1,), frozenset([]))
-- Called function fib
-- Cache miss for fib ((0,), frozenset([]))
-- Called function fib
-- Cache hit for fib ((1,), frozenset([]))
-- Called function fib
-- Cache hit for fib ((2,), frozenset([]))
Testing - F(4) = 5

Class Decorators

In the previous section we looked at function decorators and some non-trivial examples of their uses. Next, let's look at class decorators. Here, the decorator takes as input a class (an object of type type in Python), and returns a modified class.

First example is a simple mathematical example. Given a partially ordered set (also called a poset) $P$ , we define $P^d$ to be the dual of $P$ if and only if $P(x,y)\iff{}P^d(y,x)$ . In other words, the ordering is reversed. How can we implement this in Python? Suppose a class defines an ordering by implementing the __lt__, __le__, etc. set of methods. Then we can write a class decorator that replaces each of these functions with its dual.

def make_dual(relation):
@wraps(relation, ['__name__', '__doc__'])
def dual(x, y):
return relation(y, x)
return dual

def dual_ordering(cls):
"""Class decorator that reverses all the orderings"""
for func in ['__lt__', '__gt__', '__ge__', '__le__']:
if hasattr(cls, func):
setattr(cls, func, make_dual(getattr(cls, func)))
return cls

Here's how we can apply that to str, to create a new class called rstr in which opposite lexicographic ordering is used.

@dual_ordering
class rstr(str):
pass

x = rstr("1")
y = rstr("2")

print x < y
print x <= y
print x > y
print x >= y

# Output:
False
False
True
True

Let's look at another more complicated example. Suppose we want the logged decorator from the previous section to be applied to all the methods in a class. One way to do this would be to go through the code and add the decorator to each method. Another would be write a class decorator that automates this process. Before I do this though, I took the logged decorator from the previous section and improved on it a bit. Firstly, it uses the wraps decorator from functools now instead of manually fixing the __name__. Secondly, a _logged_decorator attribute is added to the returned function which is set to True, and is used to make sure the function does not get double-decorated, which comes in handy when we apply the decorator to classes which might inherit methods from another class. Finally, a name_prefix argument is added to allow for customization of the printed log message.

def logged(time_format, name_prefix=""):
def decorator(func):
if hasattr(func, '_logged_decorator') and func._logged_decorator:
return func

@wraps(func)
def decorated_func(*args, **kwargs):
start_time = time.time()
print "- Running '%s' on %s " % (
name_prefix + func.__name__,
time.strftime(time_format)
)
result = func(*args, **kwargs)
end_time = time.time()
print "- Finished '%s', execution time = %0.3fs " % (
name_prefix + func.__name__,
end_time - start_time
)

return result
decorated_func._logged_decorator = True
return decorated_func
return decorator

Now we are ready to write the class decorator.

def log_method_calls(time_format):
def decorator(cls):
for o in dir(cls):
if o.startswith('__'):
continue
a = getattr(cls, o)
if hasattr(a, '__call__'):
decorated_a = logged(time_format, cls.__name__ + ".")(a)
setattr(cls, o, decorated_a)
return cls
return decorator

And here's how it would be used. Notice how inheritance and overridden methods are handled here.

@log_method_calls("%b %d %Y - %H:%M:%S")
class A(object):
def test1(self):
print "test1"

@log_method_calls("%b %d %Y - %H:%M:%S")
class B(A):
def test1(self):
super(B, self).test1()
print "child test1"

def test2(self):
print "test2"

b = B()
b.test1()
b.test2()

# Output:
- Running 'B.test1' on Jul 24 2013 - 14:15:03
- Running 'A.test1' on Jul 24 2013 - 14:15:03
test1
- Finished 'A.test1', execution time = 0.000s
child test1
- Finished 'B.test1', execution time = 1.001s
- Running 'B.test2' on Jul 24 2013 - 14:15:04
test2
- Finished 'B.test2', execution time = 2.001s

Our first example of class decorators was to reverse the ordering methods of a class. A somewhat similar decorator, though arguably a lot more useful, that can come in handy would be one that, given only one of __lt__, __le__, __gt__, or __ge__ and __eq__, would implement the others to make a total ordering for the class. This is precisely what the functools.total_ordering decorator does. You can read up on the documentation here.

Let's look at some other interesting uses of decorators from Flask.

Suppose that you want certain functions to output a warning message if they are called under certain circumstances, but only in debug mode. Instead of manually adding the code to the beginning of every function, you can write a decorator to do this. This is precisely what the following decorator taken from Flask's app.py file does.

def setupmethod(f):
"""Wraps a method so that it performs a check in debug mode if the
"""
def wrapper_func(self, *args, **kwargs):
if self.debug and self._got_first_request:
raise AssertionError('A setup function was called after the '
'first request was handled.  This usually indicates a bug '
'in the application where a module was not imported '
'and decorators or other functionality was called too late.\n'
'To fix this make sure to import all your view modules, '
'database models and everything related at a central place '
'before the application starts serving requests.')
return f(self, *args, **kwargs)
return update_wrapper(wrapper_func, f)

A more interesting example is Flask's route decorator, which is defined in the class Flask. Note how a decorator can be a method in a class, and as such has self as the first parameter. The full source is in the app.py file. Notice that the decorator simply registers the decorated function as a URL handler by calling the add_url_rule function.

def route(self, rule, **options):
"""A decorator that is used to register a view function for a
given URL rule.  This does the same thing as :meth:add_url_rule
but is intended for decorator usage::

@app.route('/')
def index():
return 'Hello World'

For more information refer to :ref:url-route-registrations.

:param rule: the URL rule as string
:param endpoint: the endpoint for the registered URL rule.  Flask
itself assumes the name of the view function as
endpoint
:param options: the options to be forwarded to the underlying
:class:~werkzeug.routing.Rule object.  A change
to Werkzeug is handling of method options.  methods
is a list of methods this rule should be limited
to (GET, POST etc.).  By default a rule
just listens for GET (and implicitly HEAD).
Starting with Flask 0.6, OPTIONS is implicitly
added and handled by the standard request handling.
"""
def decorator(f):
endpoint = options.pop('endpoint', None)
return f
return decorator

The official Python Wiki has lots of more information on decorators if you're looking for further reading.

There is also David Beazley's excellent video on metaprogramming in Python 3.

Appendix: Closures

A function closure is a combination of a function and a set of references to the variables in the scope in which the function was defined. The latter is sometimes referred to as a referencing environment. This allows the function to be executed outside of where it is defined. In Python, the referencing environment is stored as a tuple of cells. You can access them by using the func_closure or __closure___ attributes. (In Python 3 only __closure__.) It is important thing to keep in mind is that the references are just references, and not deep copies of the objects. Of course this does not matter if the objects are immutable, but for mutable objects (say lists) it matters. An example further down illustrates this. Note that functions also have __globals__ which keeps the global referencing environment for where the function was defined.

Let's look at a simple example:

>>> def return_func_that_prints_s(s):
...     def f():
...             print s
...     return f
...
>>> g = return_func_that_prints_s("Hello")
>>> h = return_func_that_prints_s("World")
>>> g()
Hello
>>> h()
World
>>> g is h
False
>>> h.__closure__
(<cell at 0x10d172398: str object at 0x10d170840>,)
>>> print [str(c.cell_contents) for c in g.__closure__]
['Hello']
>>> print [str(c.cell_contents) for c in h.__closure__]
['World']

And a slightly more complicated example. Make sure you understand why the code runs the way it does.

>>> def return_func_that_prints_list(z):
...     def f():
...             print z
...     return f
...
>>> z = [1, 2]
>>> g = return_func_that_prints_list(z)
>>> g()
[1, 2]
>>> z.append(3)
>>> g()
[1, 2, 3]
>>> z = [1]
>>> g()
[1, 2, 3]

def dump_closure(f):


text:
# zbMATH — the first resource for mathematics

Approximating treewidth, pathwidth, frontsize, and shortest elimination tree. (English) Zbl 0818.68118
Summary: Various parameters of graphs connected to sparse matrix factorization and other applications can be approximated using an algorithm of Leighton et al. that finds vertex separators of graphs. The approximate values of the parameters, which include minimum front size, treewidth, pathwidth, and minimum elimination tree height, are not more than $$O (\log n)$$ (minimum front size and treewidth) and $$O (\log^ 2 n)$$ (pathwidth and minimum elimination tree height) times the optimal values. In addition, we show that unless P = NP there are no absolute approximation algorithms for any of the parameters.

##### MSC:
 68R10 Graph theory (including graph drawing) in computer science
##### Keywords:
sparse matrix factorization; vertex separators
Full Text:


text:
Browse Questions

# Phosphorus and nitrogen ions generally get depleted in soil because they usually occur as

$\begin{array}{1 1}(A)\;\text{Neutral ions}\\(B)\;\text{Negatively charged ions}\\(C)\;\text{Positively charged ions}\\(D)\;\text{Both positively and negatively charged but disproportionated mixture}\end{array}$

Phosphorus and nitrogen ions generally get depleted in soil because they usually occur as negatively charged ions
Hence (B) is the correct answer.


text:
FutureStarr

3 13 As An Improper Fraction

4 1 3 As a Improper Fraction

The 4 1 3 As a Improper Fraction works out in decimal form as 3/16. In binary form, it is 0. 1111111010101101.

Great

Fractions that are greater than 0 but less than 1 are called proper fractions. In proper fractions, the numerator is less than the denominator. When a fraction has a numerator that is greater than or equal to the denominator, the fraction is an improper fraction. An improper fraction is always 1 or greater than 1. And, finally, a mixed number is a combination of a whole number and a proper fraction.

A fraction can be identified as proper or improper by comparing the numerator and the denominator. Fractions that are less than one are known as proper fractions, and the numerator (the top number) is less than the denominator (the bottom number). A fraction with a numerator that is greater than or equal to the denominator is known as an improper fraction. It represents a number greater than or equal to one. Numbers that are not whole numbers, but are greater than one, can be written as improper fractions or mixed numbers. A mixed number has a whole number part and a fraction part. (Source: www.montereyinstitute.org)

Improper

Improper fractions can also be represented as a mixed number. To convert an improper fraction into a mixed number, divide the numerator by the denominator. The resultant becomes the whole number, and the remainder becomes the numerator of the new fraction. The denominator of the new fraction is the same as the original denominator. If there is no remainder, then there is no fraction--the result is simply a whole number.

This is called a mixed fraction. Thus, an improper fraction can be expressed as a mixed fraction, where quotient represents the whole number, remainder becomes the numerator and divisor is the denominator. A fraction, where the numerator is less than the denominator is called the proper fraction for example, $$\frac{2}{3}$$, $$\frac{5}{7}$$, $$\frac{3}{5}$$ are proper fractions. A fraction with numerator 1 is called a unit fraction.Each whole circle has 3 pieces. You can multiply the number of whole circles, 2, by 3 to find how many one-third pieces are in the two whole circles. Then you add 1 for the one-third piece in the final, incomplete circle. As you can see from the diagram, there are 7 individual one-third pieces. The improper fraction for (Source: www.montereyinstitute.org)

Related Articles

• Whats a Function in Math

August 15, 2022     |     Muhammad Waseem
• A Fatburger Los Angeles

August 15, 2022     |     Shaveez Haider
• Celebjihad on new york 2022

August 15, 2022     |     Shaveez Haider
• Liverpool FC English football club

August 15, 2022     |     Mr. JA
• Freud Biografia Resumida

August 15, 2022     |     Abid Ali
• Butler Hire to Edinburgh in 2022

August 15, 2022     |     Mr. JA
• False Boneset!

August 15, 2022     |     Shaveez Haider
• Future All Stars Baseball Academy

August 15, 2022     |     Umar Farooq
• Locast Org Activate'

August 15, 2022     |     Abid Ali
• Chichen Itza Resumen

August 15, 2022     |     Sameer Hussain
• assistant store manager resume examples

August 15, 2022     |     sheraz naseer
• Berkshire Bank OR

August 15, 2022     |     Muhammad Arsalan
• security clearance resume reddit

August 15, 2022     |     Muhammad Izyan
• The Enemy of My Friend is My Friend.

August 15, 2022     |     Ayaz Hussain
• cheap houses for rent in las cruces nm

August 15, 2022     |     Sheraz naseer


text:
# HyperText Transfer Protocol (HTTP)

HyperText Transfer Protocol (HTTP) defines how resources on the web are transferred between applications.

The web, or World Wide Web, is a service that can be accessed via Internet. It’s a vast system of resources navigable by means of URL (Uniform Resource Locator). Applications primary interact with the resources which make up the web using HTTP.

HTTP is called a request response protocol because it follow the following model: a client make a request to a server and waits for a response.

Both request and response are text messages (or strings) that follow a standard format so that other machine can understand and interpret them. We often call the result of the response resources.

## Statelessness

A stateless protocol is a protocol where each request/response pair are completely independent of the previous one. HTTP is a stateless protocol.

In HTTP context, it means the server does not need to know the last good state. If a request break, no cleanup is done; this make HTTP resilient, distributed and hard to control, but also difficult to build stateful application upon.

See for a way to make sateteful web applications out of HTTP.

## Difference Between URI and URL

A web page address such as https://www.eff.org/pages/surveillance-self-defense is known as a Uniform Resource Locator, or URL. It’s like a physical address but for visiting web page.

A Uniform Resource Identifier, or URI, on the other hand specifies how resources are located. URL is the most frequently used part of the general concept of URI.

This is confusing, however, and the RFCs regarding the two terms are of no help. In short, though:

• URI = URL + URN
• URI identifies
• URL locates
• Locators (URL) are also identifiers (URI) but not necessary the other way around

The terms are not interchangeable but according to a W3C Note we should use URI when speaking about scheme and URL when speaking precisely about web page addresses.

See also this video for more information and examples.

## URL Components

Let’s analyze the following URL and its components: https://www.eff.org:443/updates?type=case

• https: the scheme. Written before a colon and two forward slashes (://). It tells the web client which protocol to use to access the resource. Often referred to as the protocol which is not totally wrong, but the correct term as an URL component is scheme.
• www.eff.org: the host. Where the resources is at. Different from the domain, although this example uses a domain and a subdomain.
• :443: the port. Can be omitted if it’s one of the default one (80 for HTTP and 443 for HTTPS, like in this case)
• /updates: the path. Shows which resource within the host is being requested. Optional to make a complete HTTP request.
• ?type=case: the query string made up of query parameters. Used to send data to the server. Also optional.

When accessing the URL above, we are redirected to https://www.eff.org/cases. This has nothing to do with how URL works; it’s simply the result of what the framework for this particular website decides to send back.

Unless something else is specified, port 80 will be assumed for every HTTP requests and port 443 will be assumed for every HTTPS request.

### Query Strings/Parameters

Assume the following URL: https://www.eff.org/events/list?type=event&offset=0

Let’s break the query string down:

Query String Component Description
? Marks the start of the query string
type=event Parameter name/value pair
& Marks where another parameter will be added
offset=0 Another parameter name/value pair

Query strings are passed in through the URL. For this reason they are only used in HTTP GET requests. As they are visible in the URL, they should not be used for sensitive information such as username and password. Note also that query strings have a maximum length and space/special characters can’t be used (they need to be URL/percentage encoded).

### URL Encoding

URL can only accept characters from the standard 128-character ASCII character set. Everything else need to be encoded. URL encoding replace non-conforming characters with a % symbol followed by two hexadecimal digits that represent the ASCII Code of the character.

Other than characters that are not in the ASCII character set, those considered unsafe, like characters used to write HTML tag < and > should also be encoded. Characters reserved for URL scheme that we already saw earlier, and characters for the query strings should also be encoded.

## HTTP Request Method

HTTP Request Methods are a verb used to tell the server what action to perform on a resource.

### GET Requests

GET requests are the most common requests. When entering an address in a browser bar or clicking a link, the browser is making a GET request on our behalf.

The response from a GET request can be anything. If it’s HTML and that HTML references other resources, the browser will automatically request those resources (a pure HTTP tool like curl will not).

### POST Requests

GET are great to retrieve or ask for information from a server, but to send or submit data we often use POST.

POST is often used to send information through a form. Though most POST request could be done with GET, it is not wise to use the later with sensitive information as it will reveal the information in the query parameter. POST can also send bigger files, which GET cannot because of the size limitation of its requests.

See .


text:
# Gauss Theorem: Explained with Proof, Applications, Electric Charge Field

0

Save

The Gauss theorem, to put it simply, connects the charges present on the enclosed surface to the ‘flow’ of electric field lines (flux). The net electric flow is 0 if no charges are contained by a surface. Accordingly, the quantity of electric field lines entering the surface is equal to the quantity of field lines ejecting from it.

Gauss Theorem is one of the most governing laws in Electrostatics. In this Physics article, we will study the Gauss theorem and its applications in detail. The Gauss Law, also known as the Gauss theorem, could also be a relation between an electric field with the distribution of charge in the system.

## State Gauss Law

Gauss Law states that the net charge in the volume encircled by a closed surface directly relates to the net flux through the closed surface. According to the Gauss law, the total flux linked with a closed surface is 1/ε0 times the charge enclosed by the closed surface.

Φ = → E.d → A = qnet/ε0

$$\oint\vec{E}\vec{ds}={1\over{\epsilon_{o}}}.q$$

Where E is the electric field flowing through small area element ds and q is the net charge enclosed in it. This form of an equation is used when we calculate electric flux in a continuous charge distribution case. The surface, through which we calculate electric flux, is known as Gaussian Surface.

### Proof of Gauss Theorem

Consider a point charge Q located in a homogeneous isotropic medium of permittivity ε. At any point, the electric field intensity at a distance r from the charge is

$$\vec{E}={Q\over{4\pi{r}62}}\hat{a_r}$$

The flux density is given as,

$$\vec{D}=\epsilon\vec{E}={Q\over{4\pi{r}^2}}\hat{a_r}$$

the flux through area dA

$$d\psi=D.dA.cos\theta$$

Where θ is the angle between D and the normal to dA.

$$dA.cos\theta=r^2d\Omega$$

Now, dAcosθ is the projection of dA that is normal to the radius vector. Solid angle is given by,

$$\psi=\oint_{S}d\psi=\oint_{S}dA.cos\theta=\oint_{S}D^2d={Q\over{4\pi}}\oint{d\Omega}$$

dΩ is the solid angle subtended at Q by the elementary surface area dA. So the total displacement of flux through the entire surface area is

$$\psi=\oint_{S}\vec{D}\vec{d}={Q}$$

The total electric flux through the entire surface is

This is the integral form of Gauss theorem. And hence this theorem is proved.

## Gauss Law Formula

According to the gauss theorem, if $$\phi$$ is electric flux, $$\epsilon_0$$ is the electric constant, then the total electric charge Q enclosed by the surface is

$$\phi = \frac{Q}{\epsilon_0}$$

## Continuous Charge Distribution

• The continuous charge distribution system could also be a system in which the charge is uniformly distributed over the conductor.
• In a continuous charge system, infinite numbers of charges are closely packed and have minor space between them.
• There are three kinds of continuous charge distribution systems.
1. Linear charge density
2. Surface charge density
3. Volume charge density

### Linear Charge Density

• When the charge is uniformly distributed over the length of a conductor, it is also called linear charge distribution and is denoted by the symbol λ (Lambda).
• Mathematically linear charge density is

$$\lambda={dq\over{dl}}$$

• The unit of linear charge density is C/m. If we consider a conductor of length ‘L’ with surface charge density λ and take an element dl on it, then small charge theorem is getting to be

dq = λ dl

### Surface Charge Distribution

• When the charge is uniformly distributed over the surface of the conductor, it is also called Surface Charge Density or Surface Charge Distribution. It is denoted by the symbol σ (sigma) symbol and the unit is $$C/m^2$$
• It is also defined as charge/ per unit area. Mathematically surface charge density is

$$\sigma={dq\over{ds}}$$

• Where dq is a small charge element over the small surface ds. So, the small charge on the conductor will be

dq = σ ds

### Volume Charge Density

• When the charge is distributed over a volume of the conductor, it is also called Volume Charge Distribution.
• It is denoted by the symbol ρ (rho).
• In other words, the charge per unit volume is known as Volume Charge Density and its unit is $$C/m^3$$. Mathematically, volume charge density is

$$\rho={dq\over{dv}}$$

You can also learn about here.

## Application of Gauss Theorem

• The electric field of an infinite line charge with a uniform linear charge density can be obtained by using Gauss’ law. Considering a Gaussian surface in the type of a cylinder at radius r, the electric field has the same magnitude at every point of the cylinder and is directed outward. The electric flux is then just the electric field times the area of the cylinder.
• Now, flux through the two ends of the Gaussian surface is 0, since the field is radial.

E is normal to the surface with a constant magnitude.

The surface area of cylinder = 2 π r l

Flux through the Gaussian Surface = E × 2 π r l

Or, E × 2 π r l = λ l /ϵ0

E = λ / 2 π ϵ0r

• It is a radial unit vector in the plane normal to the wire passing through the point. λ = charge per unit length.
• E is directed outwards if λ is positive and inwards if λ is negative.

### Electric Field Due to Line Charge

The electric field of a line of charge can be found by superposing the point charge field of infinitesimal charge elements.

To find the electric intensity at point P at a perpendicular distance r from the rod, let us consider a circular closed cylinder of radius r and length l with an infinitely long line of charge as its axis.

Therefore according to Gauss Law,

$$\oint\vec{E}.\vec{ds}=\oint\vec{E}.\hat{n}\vec{S}=E\oint{dS}=E(2\pi{rl})$$

Where, 2Πrl is the curved surface area of the cylinder.

Therefore,

$$\phi{E}={q\over{\epsilon_0}}$$

Charge enclosed in cylinder = line charge density × length= λl

$$E(2\pi{rl})={l\lambda\over{\epsilon_0}}$$

Or,

E=$${\lambda\over{(2\pi\epsilon_0{r})}}$$

### Electric Field Intensity due to a Uniformly Charged Infinite Plane Sheet

E is directed outwards if λ is positive and inwards if λ is negative.

For an infinite sheet of charge, the electric field is going to be perpendicular to the surface. Therefore, only the ends of a cylindrical Gaussian surface will contribute to the electric flux.

In this case, a cylindrical Gaussian surface perpendicular to the charge sheet is used. The resulting field is half that of a conductor at equilibrium with this surface charge density.

Let the surface charge density be σ. In this case, there is planar symmetry and thus the electric field lines are perpendicular to the plane of charge. For a positively charged plane, the field points away from the plane of charge.

We use a cylindrical Gaussian surface that pierces the plane and has its straight faces parallel to the plane.

Since the electric field is perpendicular to the plane of charge, it contributes zero flux on the cylinder’s curved surface (θ = 90⁰).

The angle between the straight surfaces’ area vector and the electric field is zero.

Using Gauss theorem,

$$\phi=\oint\vec{E}\vec{dA}={q\over{\epsilon_o}}$$

Since there are two surfaces with a finite flux

Φ = EA + EA = 2EA

E=$${\sigma A\over{2\epsilon_o}}$$

The electric field is uniform and independent of distance from the infinite charged plane.

### Field due to a uniformly charged infinitely plane sheet

• For an infinite sheet of charge, the electric field is going to be perpendicular to the surface. Therefore, only the ends of a cylindrical Gaussian surface will contribute to the electric flux.
• In this case, a cylindrical Gaussian surface perpendicular to the charge sheet is used. The resulting field is half that of a conductor at equilibrium with this surface charge density.
• Let the surface charge density be σ. In this case, there is planar symmetry and thus the electric field lines are perpendicular to the plane of charge. For a positively charged plane, the field points away from the plane of charge.
• We use a cylindrical Gaussian surface that pierces the plane and has its straight faces parallel to the plane.
• Since the electric field is perpendicular to the plane of charge, it contributes zero flux on the cylinder’s curved surface (θ = 90⁰).
• The angle between the straight surfaces’ area vector and the electric field is zero.

Using Gauss theorem,

$$\phi=\oint\vec{E}\vec{dA}={q\over{\epsilon_o}}$$

Since there are two surfaces with a finite flux

Φ = EA + EA = 2EA

$$E={\sigma{A}\over{2\epsilon_o}}$$

The electric field is uniform and independent of distance from the infinite charged plane.

## Electric Field of a Sphere

1. Let us consider a charged spherical shell with a surface charge density σ and radius R. Consider a spherical Gaussian surface with any arbitrary radius r, centred with the spherical shell. By symmetry, the electric field must point radially.
2. Thus, for a Gaussian surface outside the sphere, the angle between the electric field and area vector is 0 (cosθ = 1). For a Gaussian surface outside the sphere, the angle between the electric field and area vector is 180⁰ (cosθ = -1). We shall consider two cases:
3. For a Gaussian surface outside the sphere, the angle between the electric field and area vector is 180⁰ (cosθ = -1). We shall consider two cases:

## Problems on Gauss Theorem:

Q1) Using Gauss law determine the electric field from the centre of a 0.4m circle having charge of 0.1C.

Ans.   Using Gauss Law,

$$\phi=\oint\vec{E}\vec{dA}={q\over{\epsilon_o}}$$

$$E={Q\over{4\pi r^2\epsilon_o}}={0.1\over{0.4\pi\times4^2\times8.85\times10^{-12}}}=5.9\times10^{9}N/C$$

Q2)  A point charge of $$-2\mu{C}$$ is located at the centre of a cube with sides L=5cm. What is the net electric flux through the surface?

Ans. Gauss law is an alternative to find the flux which simply states that divide enclosed charge by $$\epsilon_0$$

Thus, the flux through the above cube is calculated as below

$$\phi_E={q_{in}\over{\epsilon_o}}$$

=$${{-2\times10^{-6}}\over{8.85\times10^{-12}}}$$

=$${-226\times10^3}{Nm^2\over{C}}$$

Q3. A 3.5cm-radius hemisphere contains a total charge of 6.6\times10^{-7} C. The flux through the rounded portion of the surface is 9.8\times {10}^4{N⋅m\over{C}}. What is the flux through the flat base of the hemisphere?

Ans. The amount of electric flux \Phi_E through any closed surface and the associated enclosed total charge is related together by Gauss law as

$$\phi_E={Q_{in}\over{\epsilon_o}}$$

Hemisphere has two surfaces, rounded and flat base thus the total electric flux through it is as

$$\phi_E=\phi_{E,r}+\phi_{E,b}={Q_{in}\over{\epsilon_o}}$$

$$9.8\times10^4+\phi_{E,b}={6.6\times10^{-7}\over{8.854\times10^{-12}}}$$

$$\phi_{E,b}=-2.34{Nm^2\over{C}}$$

Q4. Find the flux through a spherical Gaussian surface of radius a = 1 m surrounding a charge of 8.85 pC.

Ans. The flux thru the Gaussian surface is the charge located inside the surface.

$$\phi={q\over{\epsilon_o}}={8.85\times10^{-12}\over{8.85\times10^{-12}}}=1Nm^2/C$$

 Check out other Important topics which will help you crack the examination: Capacitors Current and Electricity Wheatstone Bridge Theory of relativity Time Dilation, Length Contraction, Relative Speed Mass Energy Equivalence Free Body Diagrams Work Power and Energy Forms of Energy Wave Motion Waves: Types & Properties Doppler Effect

## Gauss Theorem FAQs

Q.1 What is Gauss Theorem?
Ans.1 According to the Gauss law, the total flux linked with a closed surface is 1/ε0 times the charge enclosed by the closed surface.

Q.2 What is linear charge density?
Ans.2 When the charge is uniformly distributed over the length of a conductor, it is also called linear charge distribution and is denoted by the symbol λ (Lambda).

Q.3 What is surface charge density?
Ans.3 When the charge is uniformly distributed over the surface of the conductor, it is also called Surface Charge Density or Surface Charge Distribution. It is denoted by the symbol σ (sigma) symbol and the unit is C/m2.

Q.4 What is volume charge density?
Ans.4 When the charge is distributed over a volume of the conductor, it is also called Volume Charge Distribution.

Q.5 What is Gaussian Surface?
Ans.5 The surface, through which we calculate electric flux, is known as Gaussian Surface.

[/mks_accordion_item]

Q.6 How is Gauss law Related to Coulomb’s law?
Ans.6 Gauss law can be used to derive Coulomb’s law and vice versa.

Q.7 How do we choose an appropriate Gaussian Surface for different cases?
Ans.7 We use a Spherical surface when the charge distribution is spherically symmetric, a Cylindrical surface when the charge distribution is cylindrically symmetric and we use a plane when the charge distribution has translational symmetry along a plane.

Q.8 What is the differential form of the Gauss theorem?
Ans.8 The differential form of Gauss law is the relationship between the electric field to the charge distribution at a particular point in space.


text:
How to find non-trivial of a system of equation?

I have a system of four equations

 eqs4 := {(-5 + 2 c) E^(
4 I c π) (E^(4 I c π) Subscript[x, 1] - Subscript[x,
4]) == (5 + 2 c) E^(
12 I a c) (Subscript[x, 2] -
E^(4 I c π) Subscript[x, 3]), (-5 + 2 c) E^(
6 I a c) (-E^(I b) + E^(6 I a c)) Subscript[x,
3] == (5 + 2 c) (1 - E^(I (b + 6 a c))) Subscript[x,
4], (-5 + 2 c) (-E^(2 I c (3 a + 2 π)) + E^(
I (b + 8 c π))) Subscript[x,
2] == (5 + 2 c) (-E^(-6 I c (a - 2 π)) + E^(
I (b + 8 c π))) Subscript[x, 1],
Subscript[x, 3] + 2 c (Subscript[x, 1] + Subscript[x, 3]) +
Subscript[x, 4] - Subscript[x,
1] - (5 + 2 c) Subscript[x, 2] == -2 c Subscript[x, 4]};

and I want to find the non-trivial solution of the system when $$det=0$$. I want to obtain $$\left\{x_1,x_2,x_3,x_4\right\}$$ in terms of other parameters.

Trying solve, I only obtain trivial solution zero:

Solve[eqs4, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3],
Subscript[x, 4]}] //
Simplify[#,
Assumptions ->
c ∈ Reals &&  c > 0  && b ∈ Reals &&  b > 0 &&
a ∈ Reals &&  a > 0  && d ∈ Reals] &

Then, I try to ignore one of the equation and variables as follows

eqs3 := {(-5 + 2 c) E^(6 I a c) (-E^(I b) + E^(6 I a c)) Subscript[x,
3] == (5 + 2 c) (1 - E^(I (b + 6 a c))) Subscript[x,
4], (-5 + 2 c) (-E^(2 I c (3 a + 2 π)) + E^(
I (b + 8 c π))) Subscript[x,
2] == (5 + 2 c) (-E^(-6 I c (a - 2 π)) + E^(
I (b + 8 c π))) Subscript[x, 1],
Subscript[x, 3] + 2 c (Subscript[x, 1] + Subscript[x, 3]) +
Subscript[x, 4] - Subscript[x,
1] - (5 + 2 c) Subscript[x, 2] == -2 c Subscript[x, 4]};

and I get a solution

solution =
Solve[eqs3, {Subscript[x, 2], Subscript[x, 3], Subscript[x, 4]}] //
Simplify[#,
Assumptions ->
c ∈ Reals &&  c > 0  && b ∈ Reals &&  b > 0 &&
a ∈ Reals &&  a > 0  && d ∈ Reals] &;

But when I try to verify this solution, one of them is not verified.

eqs4 /. solution //
Simplify[#,
Assumptions ->
c ∈ Reals &&  c > 0  && b ∈ Reals &&  b > 0 &&
a ∈ Reals &&  a > 0  && d ∈ Reals] &

Does anybody have a suggestion on how I can find a solution of this system?

There are no general non-trivial solutions. First I've replaced the Subscript's with x[1],x[2],x[3],x[4]. Then I subtracted the rhs of each equation so each equation would equal zero, and I discarded the == 0 part for brevity.

eqs4 = {
(-5 + 2 c) E^(4 I c π) (E^(4 I c π) x[1] - x[4]) - (5 + 2 c) E^(12 I a c) (x[2] - E^(4 I c π) x[3]),
(-5 + 2 c) E^(6 I a c) (-E^(I b) + E^(6 I a c)) x[3] - (5 + 2 c) (1 - E^(I (b + 6 a c))) x[4],
(-5 + 2 c) (-E^(2 I c (3 a + 2 π)) + E^(I (b + 8 c π))) x[2] - ((5 + 2 c) (-E^(-6 I c (a - 2 π)) + E^(I (b + 8 c π))) x[1]),
x[3] + 2 c (x[1] + x[3]) + x[4] - x[1] - (5 + 2 c) x[2] + 2 c x[4]
};

Then I obtained a matrix with CoefficientArrays[eqs4, Array[x, 4]] - the first element is all zero as there are no constant terms, so we can do:

mtx = CoefficientArrays[eqs4, Array[x, 4]] // Normal // Last
FullSimplify[mtx.Array[x, 4] == eqs4] (* confirm it works: True *)

Notice that NullSpace[mtx] is empty. Also I cannot find an {a,b,c} such where $$\det(M)=0$$ except at $$a=0,b=0,c=0$$:

FindInstance[Det[mtx] == 0, {a, b, c}, Complexes]
(* {{a -> 0, b -> 0, c -> 0}} *)

FindInstance[Det[mtx] == 0, {a, b, c}, Complexes, 2]
(* FindInstance::nsmet: The methods available to FindInstance are
insufficient to find the requested instances or prove they do not exist. *)

We can try to find the NullSpace of any triple of equations:

mtx3way = Subsets[mtx, {3}];
nsp3way = Simplify[First@NullSpace[#]] & /@ mtx3way;

Each of Simplify[mtx.nsp3way[[1]]], Simplify[mtx.nsp3way[[2]]], Simplify[mtx.nsp3way[[3]]], Simplify[mtx.nsp3way[[4]]] should have three zeros and one complicated expression in a,b,c.

Looking at the first one, we can find an a,b,c which satisfies it in the Complexes, but any attempt to do so in the Reals will fail:

t1 = Simplify[mtx.nsp3way[[1]]] // Last
i1 = FindInstance[t1 == 0, {a, b, c}, Complexes]

If you are prepared to fix {a,b,c} to specific values, finding many non-trivial solutions is easy, for example, rigging a=0, b=0, c=0:

sols = FindInstance[
FullSimplify[eqs4 /. {a -> 0, b -> 0, c -> 0}] == {0, 0, 0, 0},
Array[x, 4], Reals, 100]

• Thanks. Yes, in general and for all four variables yes, but it should be a way to obtain three of them in terms of one variable. Something like finding an unnormalized solution. – user73733 Jul 14 at 13:20

You can find a nontrivial solution. Let me develop the thought of @flinty further.

Expanding Det[mtx] shows, it gets much simple with certain a,b

det1 = Det[mtx] // Expand

dd = Det[mtx] /. a -> 2 Pi /. b -> 8 c Pi // Expand

ComplexExpand[Im@dd, TargetFunctions -> {Re, Im}]

The result of that ComplexExpand are all Sin[8 c Pi], Sin[12 c Pi], implying c should be c==1. Bingo!

Solve[Thread[eqs4 == 0] /. a -> 2 Pi /. b -> 8 c Pi /. c -> 1,
Array[x, 4]]

(*   Solve::svars: Equations may not give solutions for all "solve" variables. >>

{{x[3] -> x[1], x[4] -> -((4 x[1])/3) + (7 x[2])/3}}   *)

Edit

All multiples of b==2 Pi are allowed. For a all multiples of Pi are allowed, also multiples of Pi/3.

• By fixing {a,b,c} to certain values, e.g {a -> 2 Pi, b -> 8 Pi, c -> 1}, it is easily solvable. I thought the question asked for the x[i] in terms of arbitrary {a,b,c}. Otherwise: FindInstance[ FullSimplify[eqs4 /. {a -> 0, b -> 0, c -> 1}] == {0, 0, 0, 0}, Array[x, 4], Reals, 25] finds loads of them. – flinty Jul 14 at 14:36
• {a -> 0, b -> 0,c->0}  are not allowed due to conditions. I think the question was to find (conditions for) a,b,c where the xi have no trivial solution. Since Reduce didn't do the job for me, i found some a,b,c by intuition. – Akku14 Jul 14 at 14:50


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# 4.1: Ratios and Rates

Difficulty Level: At Grade Created by: CK-12

## Introduction

The Top of the World - Mount Everest

Josh sat at the breakfast table with his nose in a book. His Mom poured some cereal into a bowl and put it down in front of him. Karen, Josh’s sister came into the kitchen and sat down next to him.

“I am reading a book about Mount Everest,” Josh said without looking up.

“Alright Josh, now put the book down and eat something,” their Mom instructed.

“It is terrific. Do you know that during the best year on Everest, and best meaning the year that the least number of people died, that 129 people summitted and only 8 died,” Josh said smiling.

“That hardly seems like something to smile about,” Mom said sipping her coffee.

“Yeah, how morbid,” Karen chimed in.

“Listen it may be morbid, but it is a fact. During the worst year, only 98 people summitted and 15 died. That is a lot of people. I mean we can compare the number of people who summitted and the number of people who didn’t make it,” Josh said.

“Well, it proves that Everest is a dangerous place and not a trip to be taken lightly,” Mom said.

“Yes, but think about how amazing it would be to stand on the top of the world!” Josh said.

“How do they figure out that the best year is the best and the worst year is the worst based on those numbers?” Karen asked.

“They compare the ratios,” Josh explained. “Let me tell you how.”

Do you know how? Given this information, Josh is going to show Karen how to simplify and compare ratios. In this lesson, you will learn how to write ratios and how to understand them better. Pay close attention and you can work with the ratios of the best and worst years on Everest at the end of the lesson.

What You Will Learn

In this lesson, you will learn how to execute the following skills.

• Write, compare and order ratios.
• Find and apply unit rates.
• Find and apply equivalent rates.
• Solve real-world problems involving ratios and rates.

Teaching Time

I. Write, Compare and Order Ratios

A ratio is a comparison of two things or two quantities. The key thing to notice about ratios is that we are comparing. There are many different ways to compare things in mathematics. For example, imagine that there are 25 students in a class; 12 boys and 13 girls. You could say that the ratio of boys to girls is 12 to 13. You could also write this ratio as 12 : 13 or 1213\begin{align*}\frac{12}{13}\end{align*}. The ratio of boys to total students can be written as 12 to 25, 12 : 25, or 1225\begin{align*}\frac{12}{25}\end{align*}. The ratio of girls to total students can be written as 13 to 25, 13 : 25, or 1325\begin{align*}\frac{13}{25}\end{align*}. You will also see that the order that you compare makes a difference. If you are comparing boys to total students, then the number of boys comes first or if you are using fraction form, it is the numerator.

That is a great question. There are three different ways to write ratios. You can write them with a colon between the two values that you are comparing, you can write them using the word “to”, and you can write them by putting the values in fraction form. You can choose which way you want to write a ratio and these ways are interchangeable too.

Take a minute to write the definition of a ratio and the three ways to write a ratio in your notebook.

We just looked at the three ways to write a ratio when you are making a simple comparison. Remember to read the information carefully so that you are clear what is being compared. Now let’s look at an example where you might need to figure something out to write the ratio.

Example

There are 32 red and yellow candies in a bag. There are 10 yellow candies. What is the ratio of red candies to total candies in the bag?

We need the ratio of red candies to total candies. We know that there are 32 total candies. We need to find the number of red candies in the bag before writing the ratio.

3210=22\begin{align*}32-10 = 22\end{align*}

Now write the ratio of red candies to total candies. Because a ratio is a comparison, it can be simplified. Make sure to reduce the ratio to lowest terms. This makes it easier to understand the quantities that are being compared.

red candiestotal candies=2232=1116\begin{align*}\frac{\text{red candies}}{\text{total candies}} = \frac{22}{32} = \frac{11}{16}\end{align*}

We also could have written this ratio in two other ways.

22 to 32 then simplified to 11 to 16

OR

22 : 32 then simplified to 11 : 16

All of these answers would have been correct. Remember that you can interchange the form that you choose to write a ratio.

We can also compare ratios. This is when we have two or more ratios and we want to figure out which ones are larger and which ones are smaller. Let’s look at an example.

Example

Mr. Collison’s class has 30 total students. Of these, 12 are boys. Mrs. Peterson’s class has 25 students. Of these, 11 are boys. Which class has a higher ratio of boys to total students?

First, find the ratio of boys to total students for both classes. You need to do this first because these are the quantities that you are comparing.

Mr. Collison’s class: 1230=25\begin{align*}\frac{12}{30} = \frac{2}{5}\end{align*}

Mrs. Peterson’s class: 1125\begin{align*}\frac{11}{25}\end{align*}

Now compare the ratios the same way you compare fractions. Find a common denominator and compare the numerators.

The least common denominator is 25.

25(55)=1025\begin{align*}\frac{2}{5} \left(\frac{5}{5} \right) = \frac{10}{25}\end{align*}

1025<1125\begin{align*}\frac{10}{25} < \frac{11}{25}\end{align*}, since 10 is less than 11.

Mrs. Peterson’s class has a higher ratio of boys to total students.

Note: In Example 2, even though Mr. Collison’s class had a larger number of boys in the class, Mrs. Peterson’s class had a larger ratio of boys to total students.

We can also order ratios. When you have more than two ratios, you can write them in order from least to greatest or from greatest to least. Let’s look at an example.

Example

Order the following ratios from least to greatest: 10 to 15, 1636\begin{align*}\frac{16}{36}\end{align*}, 12 : 48

The first thing to notice is that these ratios are all in different forms. Let’s write them in the same form first of all. Let’s work with fraction form so that we can apply what we know about comparing and ordering fractions.

10 to 15=1015\begin{align*}10 \ \text{to} \ 15 = \frac{10}{15}\end{align*}

1636\begin{align*}\frac{16}{36}\end{align*}

12:48=1248\begin{align*}12:48 = \frac{12}{48}\end{align*}

Now notice that none of these fractions are in simplest form. We can simplify them and that will make it much easier to order them.

101516361248=23=49=14\begin{align*}\frac{10}{15} &= \frac{2}{3}\\ \frac{16}{36} &= \frac{4}{9}\\ \frac{12}{48} &= \frac{1}{4}\end{align*}

If you understand fractions, we can simply order them right now. We know that one-fourth is the smallest part. That four is almost half of nine, so that would be the middle value, and that two-third would be the greatest part.

The answer is 14,49,23\begin{align*}\frac{1}{4}, \frac{4}{9}, \frac{2}{3}\end{align*}.

Well in that case, you could rewrite them all using a common denominator. Then you will be able to order the numerators. Let’s take a look at that.

144923=936=1636=2436\begin{align*}\frac{1}{4} &= \frac{9}{36}\\ \frac{4}{9} &= \frac{16}{36}\\ \frac{2}{3} &= \frac{24}{36}\end{align*}

You can see that our original work was correct.

II. Find and Apply Unit Rates

A unit rate is a special kind of ratio, where the second number, or the denominator, is equal to one. With a unit rate, you are comparing a quantity to one. Some common examples of unit rates are miles per gallon, price per pound, and pay rate per hour.

To find a unit rate, simplify the ratio so that you have a 1 in the denominator. You can simply divide the first number in the ratio by the second. Make sure you keep track of the units.

Write this information on unit rates down in your notebook. Then continue with the example.

Example

Kayla bought 5.5 pounds of apples. She paid a total of $7.15. What was the unit rate of the apples per pound? A key word is here “per pound”. When you see the word “per”, you should know that you are working with unit rates. You need to find the price per pound. We can write the ratio of price to pounds using the information in the problem. That is what we are comparing, so that is how we write the ratio. Then we can fill in the given information. pricepounds=$7.155.5 pounds\begin{align*}\frac{price}{pounds} = \frac{\ 7.15}{5.5 \ pounds}\end{align*}

Now divide to find the price per pound. We divide the price by the number of pounds that she bought.

5.5)7.15¯¯¯¯¯¯¯¯¯¯¯¯\begin{align*}{5.5 \overline{){7.15\; }}}\end{align*}

$7.155.5 pounds=$1.301 pound\begin{align*}\frac{\7.15}{5.5 \ pounds} = \frac{\ 1.30}{1 \ pound}\end{align*}

The unit rate is $1.30 per pound. Example Brian worked for 8 hours yesterday and made a total of$86. What is his pay rate?

Write a ratio comparing pay rate to hours worked. The rate that we are looking for is what Brian made “per” hour. Even though the problem doesn’t use the word “per” a pay rate is per hour.

pay ratehours worked=868 hours\begin{align*}\frac{\text{pay rate}}{\text{hours worked}} = \frac{\ 86}{8 \ hours}\end{align*} Now divide to find the unit rate.868 hours=10.751 hour\begin{align*}\frac{\86}{8 \ hours} = \frac{\ 10.75}{1 \ hour}\end{align*} Brian’s pay rate is10.75 per hour.

You may also see rates that are equal. Let’s look at equivalent rates.

III. Find and Apply Equivalent Rates

An equivalent rate is a rate that is equal but is written in a different form.'

To find an equivalent rate, you need to write a fraction that is equivalent to the given fraction, or rate.

Example

Find an equivalent rate for this comparison.

2.001=?8\begin{align*}\frac{\2.00}{1} = \frac{?}{8}\end{align*} Notice that we have a unit rate here. We know that the unit rate is two dollars for every one thing. We want eight. We can figure out how to work on this problem by thinking mathematically. 1×8=8\begin{align*}1 \times 8 = 8\end{align*} Just like when we worked with fractions, whichever operation we perform with the denominator must be performed with the numerator too. We multiplied by eight, so we need to do that with the numerator too.2.001=16.008\begin{align*}\frac{\2.00}{1} = \frac{\ 16.00}{8}\end{align*} These two rates are equivalent. As long as you multiply the numerator and the denominator by the same value, you will always create an equivalent rate! IV. Solve Real – World Problems Involving Ratios and Rates Now that you understand ratios and rates, we can look at applying this information when working with real – world problems. Let’s look at some examples. Example Myra’s team scored 10 goals in the last 3 games. At this rate, how many goals will Myra’s team score in 6 games? First, write the ratio to show the team’s scoring rate. goalsgames=10 goals3 games\begin{align*}\frac{goals}{games} = \frac{10 \ goals}{3 \ games}\end{align*} You need to know the equivalent rate for 6 games. Notice that the second ratio has the games in the same spot of the denominator. Be sure that you write the ratios so that the same quantities are being compared. If you mix them up, you get a different result. 10 goals3 games=? goals6 games\begin{align*}\frac{10 \ goals}{3 \ games} = \frac{? \ goals}{6 \ games}\end{align*} Look at the two fractions. The denominator is doubled in the second fraction. So, multiply the first fraction by an equivalent of 1 in order to get the second fraction. 10 goals3 games(22)=20 goals6 games\begin{align*}\frac{10 \ goals}{3 \ games} \left(\frac{2}{2}\right) = \frac{20 \ goals}{6 \ games}\end{align*} An equivalent rate is 20 goals in 6 games. So at this rate, Myra’s team will score 20 goals. Example A store sells salmon for6.99 per pound. What is the rate for 6 pounds of salmon?

You know the rate per pound. You need to find the rate for 6 pounds. So you can multiply the unit rate by 6 to find the equivalent ratio.

$6.991 pound(66)=$41.946 pounds\begin{align*}\frac{\6.99}{1 \ pound} \left(\frac{6}{6} \right) = \frac{\41.94}{6 \ pounds}\end{align*}

The rate for 6 pounds of salmon is 41.94. Now let’s go back to the problem from the introduction and work on solving that problem. ## Real-Life Example Completed The Top of the World - Mount Everest Here is the original problem once again. First, reread it. Then you will need to write and simplify two ratios. One ratio will represent the numbers from the best year on Everest and one ratio will represent the numbers from the worst year on Everest. There are two parts to your answer. Josh sat at the breakfast table with his nose in a book. His Mom poured some cereal into a bowl and put it down in front of him. Karen, Josh’s sister came into the kitchen and sat down next to him. “What are you reading?” she asked. “I am reading a book about Mount Everest,” Josh said without looking up. “Alright Josh, now put the book down and eat something,” their Mom instructed. “It is terrific. Do you know that during the best year on Everest, and best meaning the year that the least number of people died, that 129 people summitted and only 8 died,” Josh said smiling. “That hardly seems like something to smile about,” Mom said sipping her coffee. “Yeah, how morbid,” Karen chimed in. “Listen it may be morbid, but it is a fact. During the worst year, only 98 people summitted and 15 died. That is a lot of people. I mean we can compare the number of people who summitted and the number of people who didn’t make it,” Josh said. “Well, it proves that Everest is a dangerous place and not a trip to be taken lightly,” Mom said. “Yes, but think about how amazing it would be to stand on the top of the world!” Josh said. “How do they figure out that the best year is the best and the worst year is the worst based on those numbers?” Karen asked. “They compare the ratios,” Josh explained. “Let me tell you how.” Now write your ratios. Remember to simplify them. There are two parts to your answer. Solution to Real – Life Example We are going to write two ratios that we can compare. One ratio will represent the best year on Everest and one will represent the worst year on Everest. First, let’s look at the numbers from the best year on Everest. 129 people summitted 8 died The ratio is 129 : 8. However, we want to simplify this ratio to get a better idea of the size of the ratio. Let’s rewrite it in fraction form and simplify it. 1298=161\begin{align*}\frac{129}{8}= \frac{16}{1}\end{align*} This means that for every 16 people who summitted one did not make it. Now let’s look at the numbers for the worst year on Everest. 98 people summitted 16 people died 9816=6.5 to 1\begin{align*}\frac{98}{16} = 6.5 \ to \ 1\end{align*} This means that for every 612\begin{align*}6 \frac{1}{2}\end{align*} people who summitted, one did not make it. From these ratios, you can see how the best year compares to the worst year on Everest. ## Vocabulary Here are the vocabulary words that are found in this lesson. Ratio a way of comparing two numbers or quantities. Ratios can be written in fraction form, with a colon or by using the word “to”. Unit Rate a ratio that is comparing a quantity to one. The word “per” is a key word with unit rates. Equivalent Rate two rates that are equal although different values are being used to represent the same quantities. Resources www.mnteverest.net ## Time to Practice Directions: Look at each ratio. Then write it in the other two ways that it can be written. 1. 16 to 3 2. 4 to 5 3. 1 : 4 4. 121\begin{align*}\frac{12}{1}\end{align*} 5. 6 : 11 6. 33 to 100 7. 49\begin{align*}\frac{4}{9}\end{align*} 8. 3 to 4 9. 45 to 12 10. 12 : 12 Directions: Simplify each ratio and write your answer in fraction form. 1. 4 to 12 2. 5 : 20 3. 36 to 6 4. 18 : 36 5. 20 to 100 Directions: Use what you have learned about ratios to solve each problem. In Kyle’s drawer, there are 14 pairs of white socks and 8 pairs of black socks 1. Write the ratio of black socks to white socks. 2. Write the ratio of black socks to total socks. 3. Write the ratio of white socks to total socks. 4. There are 150 apartments in the Gray building. Of these, 60 are rented and the rest are owned. There are 65 apartments in the Black building. Of these, 45 are rented and the rest are owned. Which building has a larger ratio of owned apartments to total apartments, and by how much? 5. Susan drove a total of 182 miles in three and a quarter hours. If she drove the same speed the whole drive, what was her rate in miles per hour? 6. Holly works at a library reshelving books. She reshelved 960 books in 4 hours. What is Holly’s rate of reshelving in books per hour? 7. Sam bought 9.5 pounds of peaches to make a pie. The peaches cost15.39. What was the unit rate of the peaches?
8. A vacation house costs \$1,100 to rent per month. If there are 30 days in the month, what is the daily rate?
9. Julie can type 55 words per minute. What is the equivalent rate of typing 15 minutes?
10. Don can wrap 8 presents in an hour. What is Don’s rate for 12 presents?

### My Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

Show Hide Details
Description
Difficulty Level:
Tags:
Subjects:


text:
How do you simplify (m-2)/(m-5)*(m+5)/(m-2)?

Jul 25, 2015

You cancel out the terms common to the nominator and to the denominator.

Explanation:

Notice that you initial expression has $\left(m - 2\right)$ as the numerator of the first fraction and as the denominator of the second fraction.

This means that you can cancel out this term to get

$\frac{\cancel{m - 2}}{m - 5} \cdot \frac{m + 5}{\cancel{m - 2}} = \textcolor{g r e e n}{\frac{m + 5}{m - 5}}$

And that is how your simplified expression looks like.


text:
# Facilitate Real-Time Facial Recognition Login Applications Using the Intel® Distribution of OpenVINO™ Toolkit

Published: 10/24/2019

Last Updated: 10/24/2019

## Overview

Identifying the face of a person to grant access to an application is a recent trend. Facial recognition has become a popular method to unlock phones, tag people on social media, and scan crowds for security threats. It has also gained popularity in gaming, grocery stores, airports, and payment platforms. Facial-recognition login software and biometric technology have set a new standard in security-relevant applications because they eliminate the need to remember passwords without compromising security. Further, facial recognition login can also detect and verify people's faces, regardless of whether they changed their appearance (a new mustache, for example) or are wearing eyeglasses.

According to FaceNet: A Unified Embedding for Face Recognition and Clustering, "FaceNet is a system that directly learns a mapping from face images to a compact Euclidean space where distances directly correspond to a measure of face similarity. Once this space has been produced, tasks such as face recognition, verification and clustering can be easily implemented using standard techniques with FaceNet embeddings as feature vectors."

In addition to the actual face recognition process, which is done by FaceNet, we can add a face alignment stage beforehand. This aligns the face to help improve the recognition accuracy. The addition of this face alignment stage requires FaceNet to perform postprocessing techniques to match the face being viewed with other known faces.

The optimized solution described in this paper is based on the Intel® Distribution for OpenVINO™ toolkit, which can optimize trained models in frameworks like Tensorflow*, Caffe*, and PyTorch*, and then quickly infer.

The FaceNet model discussed here was converted to an optimized intermediate representation (IR) with the help of the Intel Distribution for OpenVINO toolkit and was then used to infer at a higher speed. The experiment was conducted on the Intel® Xeon® Platinum 8256 processor (at 3.80 GHz).

## Solution Architecture and Design

The original solution uses a FaceNet model trained on custom images to recognize faces. As the diagram below shows, preprocessing involves face alignment. Postprocessing involves interpreting the feature vector returned by the FaceNet model and matching it against feature vectors of known faces using a distance measure utility.

The optimized solution uses the Intel Distribution for OpenVINO toolkit to optimize the FaceNet model using the Model Optimizer tool, which creates an IR of the model. The IR representation, in the form of .xml and .bin files, is used to infer using a classification-inference engine sample from the Intel Distribution for OpenVINO toolkit. The usual postprocessing done in the sample is discarded because the feature vector from the FaceNet stage is directly fed to the postprocessing for the solution. The inferred feature vector is matched against an existing set of feature vectors using the distance measure to correctly identify the faces.

The IR conversion is done on the FaceNet model, as shown in the following example. See the Intel Distribution for OpenVINO toolkit documentation for code example details.

python /deployment_tools/model_optimizer/mo_tf.py>
--input_model  \
--output  \
--freeze_placeholder_with_value "phase_train->False"

A snippet of the classification sample source code from the Intel Distribution for OpenVINO toolkit is shown below:

# Start sync inference
log.info("Starting inference ({} iterations)".format(args.number_iter))
infer_time = []
for i in range(args.number_iter):
t0 = time()
res = exec_net.infer(inputs={input_blob: images})
infer_time.append((time()-t0)*1000)
log.info("Average running time of one iteration: {} ms".format(np.average(np.asarray(infer_time))))
if args.perf_counts:
perf_counts = exec_net.requests[0].get_perf_counts()
log.info("Performance counters:")
print("{:<70} {:<15} {:<15} {:<15} {:<10}".format('name', 'layer_type', 'exet_type', 'status', 'real_time, us'))
for layer, stats in perf_counts.items():
print("{:<70} {:<15} {:<15} {:<15} {:<10}".format(layer, stats['layer_type'], stats['exec_type'],
stats['status'], stats['real_time']))
# Processing output blob
log.info("Processing output blob")
res = res[out_blob]

The remainder of the classification sample is skipped because the feature vector obtained in the res variable (line 6) is directly fed into the inference for distance calculations.

## Hardware Configuration

Table 1 lists the hardware configuration for the optimized and non-optimized versions of the solution.

Table 1. Hardware configuration for the solution

 Platform Intel® Server Board S2600BPB # Nodes 1 # Sockets 2 CPU Intel® Xeon® Platinum 8256 processor @ 3.80 GHz Cores/socket, Threads/socket 4/8 ucode 0x500001c Hyperthreading (HT) On Turbo On BIOS version SE5C620.86B.02.01.0008.031920191559 System DDR memory configuration: slots / cap / run-speed 12 slots / 32 GB / 2666 MTs / DDR4 DIMM Total memory/node (DDR+DCPMM) 376 GB Storage - boot Intel® Solid State Drive SC2KB48 480 GB (1 GB boot partition) Storage - application drives Intel® Solid State Drive SC2KB48 480 GB (444 GB application partition) Network interface controller (NIC) Intel® Ethernet Controller 10 Gigabit X550T Platform controller hub (PCH) Intel®  C621 chipset OS Ubuntu* 18.04.2 LTS Kernel Linux* 4.15.0-48-generic Mitigation variants (1,2,3,3a,4, L1TF) Full mitigation

## Software Configuration

Table 2 lists the software used (and their versions) in the baseline and optimized solution.

Table 2. Software configuration for the solution

 Software Baseline Optimized Workload Custom FaceNet Custom FaceNet Compiler n/a n/a Libraries Intel® Math Kernel Library (Intel® MKL) 2019.3, NumPy 1.16.13, scikit-learn* 0.20.3, Pillow 6.0.0 Intel MKL 2019.3, NumPy 1.16.3, scikit-learn 0.20.3, Pillow 6.0.0 Frameworks version TensorFlow* 1.13.1 (installed using conda*) Intel Distribution of OpenVINO toolkit R1.133 Python* Python 3.6.8 Python 3.6.8 Dataset Custom Custom Topology Custom FaceNet Custom FaceNet Batch Size 1 1 Streams 1 1

## Results

The time for FaceNet topology to infer a single image improved by 1050x. This measure does not consider preprocessing and postprocessing times. With more images, the margin slightly decreases. However, the Intel Distribution of OpenVINO toolkit version also performed significantly better than native TensorFlow inferences in such cases. Because face login applications process one image at a time, a  single-image comparison holds good for the comparison.

## Conclusion

The inference time for FaceNet showed a 1050x improvement in time with the Intel Distribution of OpenVINO toolkit when compared to the native TensorFlow inference. Because of the optimization and resultant performance gains (less time), inference is a negligible part of the total processing of an image. The optimized solution had no impact on the recognition accuracy, and the feature vector returned in both the optimized and non-optimized versions were nearly identical. Further performance can be achieved by taking advantage of INT8 optimization coupled with Intel® Deep Learning Boost.

## References

FaceNet: A Unified Embedding for Face Recognition and Clustering

Convert TensorFlow FaceNet Models to Intermediate Representation

Intel® Distribution of OpenVINO™ Toolkit

GitHub - davidsandberg/facenet

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.


text:
# Wald test

WaldWald estimatorWald statisticWald statistics
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.wikipedia
56 Related Articles

### Likelihood-ratio test

likelihood ratio testlikelihood ratiolikelihood-ratio
Together with the Lagrange multiplier and the likelihood-ratio test, the Wald test is one of three classical approaches to hypothesis testing.
The likelihood-ratio test is the oldest of the three classical approaches to hypothesis testing, together with the Lagrange multiplier test and the Wald test.

### Abraham Wald

WaldWald, Abraham
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Score test

Lagrange multiplier testLagrange multiplierLagrange multiplier (LM) test
Together with the Lagrange multiplier and the likelihood-ratio test, the Wald test is one of three classical approaches to hypothesis testing.
The main advantage of the score test over the Wald test and likelihood-ratio test is that the LM test only requires the computation of the restricted estimator.

### Structural break

Sup-LR testStructural break testSup-LM test
For cases 1 and 2, the sup-Wald (i.e., the supremum of a set of Wald statistics), sup-LM (i.e., the supremum of a set of Lagrange multiplier statistics), and sup-LR (i.e., the supremum of a set of likelihood ratio statistics) tests developed by Andrews (1993, 2003) may be used to test for parameter instability when the number and location of structural breaks are unknown.

### Statistics

statisticalstatistical analysisstatistician
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Constraint (mathematics)

constraintconstraintsconstrained
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Statistical parameter

parametersparameterparametrization
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Estimator

estimatorsestimateestimates
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Null hypothesis

nullnull hypotheseshypothesis
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Precision (statistics)

precisionprecision matrixconcentration
In statistics, the Wald test (named after Abraham Wald) assesses constraints on statistical parameters based on the weighted distance between the unrestricted estimate and its hypothesized value under the null hypothesis, where the weight is the precision of the estimate.

### Sampling distribution

finite sample distributiondistributionsampling
While the finite sample distributions of Wald tests are generally unknown, it has an asymptotic χ 2 -distribution under the null hypothesis, a fact that can be used to determine statistical significance.

### Chi-squared distribution

chi-squaredchi-square distributionchi square distribution
While the finite sample distributions of Wald tests are generally unknown, it has an asymptotic χ 2 -distribution under the null hypothesis, a fact that can be used to determine statistical significance.

### Statistical significance

statistically significantsignificantsignificance level
While the finite sample distributions of Wald tests are generally unknown, it has an asymptotic χ 2 -distribution under the null hypothesis, a fact that can be used to determine statistical significance.

### Statistical hypothesis testing

hypothesis testingstatistical teststatistical tests
Together with the Lagrange multiplier and the likelihood-ratio test, the Wald test is one of three classical approaches to hypothesis testing.

### Computational complexity

complexitycomputational burdenamount of computation
An advantage of the Wald test over the other two is that it only requires the estimation of the unrestricted model, which lowers the computational burden as compared to the likelihood-ratio test.

### Expression (mathematics)

expressionmathematical expressionexpressions
However, a major disadvantage is that (in finite samples) it is not invariant to changes in the representation of the null hypothesis; in other words, algebraically equivalent expressions of non-linear parameter restriction can lead to different values of the test statistic.

### Taylor series

Taylor expansionMaclaurin seriesTaylor polynomial
That is because the Wald statistic is derived from a Taylor expansion, and different ways of writing equivalent nonlinear expressions lead to nontrivial differences in the corresponding Taylor coefficients.

### Binomial regression

binary response modelbinomial models
Another aberration, known as the Hauck–Donner effect, can occur in binomial models when the estimated (unconstrained) parameter is close to the boundary of the parameter space—for instance a fitted probability being extremely close to zero or one—which results in the Wald test no longer monotonically increasing in the distance between the unconstrained and constraint parameter.

### Boundary (topology)

boundaryboundariesboundary point
Another aberration, known as the Hauck–Donner effect, can occur in binomial models when the estimated (unconstrained) parameter is close to the boundary of the parameter space—for instance a fitted probability being extremely close to zero or one—which results in the Wald test no longer monotonically increasing in the distance between the unconstrained and constraint parameter.

### Parameter space

weight space
Another aberration, known as the Hauck–Donner effect, can occur in binomial models when the estimated (unconstrained) parameter is close to the boundary of the parameter space—for instance a fitted probability being extremely close to zero or one—which results in the Wald test no longer monotonically increasing in the distance between the unconstrained and constraint parameter.

### Monotonic function

monotonicitymonotonemonotonic
Another aberration, known as the Hauck–Donner effect, can occur in binomial models when the estimated (unconstrained) parameter is close to the boundary of the parameter space—for instance a fitted probability being extremely close to zero or one—which results in the Wald test no longer monotonically increasing in the distance between the unconstrained and constraint parameter.

### Maximum likelihood estimation

maximum likelihoodmaximum likelihood estimatormaximum likelihood estimate
Under the Wald test, the estimated that was found as the maximizing argument of the unconstrained likelihood function is compared with a hypothesized value \theta_0.

### Likelihood function

likelihoodlikelihood ratiolog-likelihood
Under the Wald test, the estimated that was found as the maximizing argument of the unconstrained likelihood function is compared with a hypothesized value \theta_0.

### T-statistic

Student's t-statistict''-statisticStudent's ''t''-statistic
The square root of the single-restriction Wald statistic can be understood as a (pseudo) t-ratio that is, however, not actually t-distributed except for the special case of linear regression.


text:
Opuscula Math. 32, no. 1 (2012), 171-178
http://dx.doi.org/10.7494/OpMath.2012.32.1.171

Opuscula Mathematica

# A characterization of convex φ-functions

Bartosz Micherda

Abstract. The properties of four elements $$(LPFE)$$ and $$(UPFE)$$, introduced by Isac and Persson, have been recently examined in Hilbert spaces, $$L^p$$-spaces and modular spaces. In this paper we prove a new theorem showing that a modular of form $$\rho_{\Phi}(f)=\int_{\Omega}\Phi(t,|f(t)|)d\mu(t)$$ satisfies both $$(LPFE)$$ and $$(UPFE)$$ if and only if $$\Phi$$ is convex with respect to its second variable. A connection of this result with the study of projections and antiprojections onto latticially closed subsets of the modular space $$L^{\Phi}$$ is also discussed.

Keywords: inequalities, modulars, Orlicz-Musielak spaces, convexity, isotonicity, antiprojections.

Mathematics Subject Classification: 39B62, 41A65, 46E30.

Full text (pdf)

• Bartosz Micherda
• University of Bielsko-Biała, Department of Mathematics and Computer Science, ul. Willowa 2, 43-309 Bielsko-Biała, Poland


text:
# How do you solve the system 6x-y=-145 and x=4-2y?

Jun 1, 2018

$x = - 22 , y = 13$

#### Explanation:

Plugging $x = 4 - 2 y$ in the first equation we get
$6 \left(4 - 2 y\right) - y = - 145$
expanding
$24 - 12 y - y = - 145$
so
$- 13 y = - 169$

so

$y = 13$

we get $x$ as

$x = 4 - 26$

$x = - 22$


text:
# FiveThirtyEight

## Politics

I went to CPAC today, and unfortunately the title of this post is a little more provocative than the substance — I’m not going to try any comprehensive explanation for why people become Republicans. In some ways I am still adapting to the experience, struggling with a reaction the way Rachel Maddow was speechless after the Bobby Jindal response on Tuesday night.

Ordinarily I wouldn’t waste your time with an anecdote, but since it happened immediately after leaving this massive gathering of suit-clad, mostly young Republicans while I was reflecting on the experience, tying the two together is a decent way to close out a Friday afternoon.

The Onmi Shoreham hotel, which hosts CPAC this week, is a block from the Woodley Park Metro station. I have one of the paper cards and not the new plastic card. (For those unfamiliar with the Metro, you insert your card into the turnstile slot, and provided you have money on it to pay the minimum fare, the gates open, your card pops back up, and you go down to your train. At entry, the card captures where you got on, and when you exit and repeat the turnstile slot process it deducts the fare with a newly printed remainder.)

Well, it wouldn’t take the card, and I had $9.45 left on it. At the kiosk, the Metro employee told me that the card had become demagnetized and thus I had two choices. First, she could issue me a card to go to my next stop, the value of which was$1.65. That would be it. I’d lose $7.20, but be able to travel to my next stop. Second, I could go to a stop called Metro Center (not my stop, one stop away from mine), which was the only place they could issue me a new card so that I could retrieve the value I’d paid in advance. Since Metro Center was close to my final destination, I took the second option. She tears a corner of my card, writes “-$1.65 = $7.75″ in pen, and lets me go in through a side gate. At Metro Center, I wait in a predictably long 20 minute line. When I finally get to the front of the line, I request the$9.45 restored so that when I exit at my real stop, the $1.65 will come off and I’ll be in exactly the position I should have been in, minus the loss of time. Of course, the Metro employee cannot do this. He can only do what it says on the card. Keep in mind, that “$9.45″ is plainly printed as the lowest number on the card, followed by the handwriting. Surely this situation happens routinely. He says he can only give me $7.75. Except, not really. I have to either give him a quarter so that he can give me an$8 card, or I lose $0.75 and he gives me a$7 card. (I had no quarter on me, because I try and minimize the metal I carry through magnetometers). So, in essence, I am going to get $7 in fare refunded to me, which will then be deducted by another$1.65 when I exit my real exit one stop away. I either had to lose $7.20 (the whole card) or lose$2.45 and some time waiting in line.

I asked him, “Why can you not give me the value that I’ve paid for?” I explained that I didn’t want “more” value, I just wanted to get the value that I’d pre-paid. I wanted the government to honor its small little contract with me. He replies, in that maddeningly passive-aggressive government employee way, “It says $7.75. I can only do what it says.” (Unless of course I happened not to have a quarter on me, then I would be further penalized). I pointed out that surely he can see what happened, he can see the$9.45 and that another Metro agent has written this, he knows $1.65 is the cost of the fare to get to Metro Center to this infernal line and that when I exit whatever stop is next, I will have to pay$1.65 or more.

He hunkered down into numbed-over bureaucrat mode and would not budge. After about two minutes of back and forth I gave up, as he surely knew I would, and then he issued me two separate cards that totaled $7. The significance of this? When you get down to the end of a card’s use, there is always some leftover change, and you have to exchange the old paper card for a new one and reload. The$3 card can’t handle two $1.65 trips; the$4 card can, but would have \$0.70 left on it. So two cards just takes more time to redeem the value that’s on them than one card.

Now, I can put this all in perspective. The Metro is a great system. The number of positive interactions I’ve had with it overwhelm the negative ones. Hundreds and hundreds of CPAC attendees rode to the conference on the Metro (all around me) rather than use rugged individualism and walk.

Moreover, it’s not just government that provides these moments in life. Anyone who’s ever had to deal with Dell customer service knows that, indeed, there IS a company more desperately terrible than Comcast in this department. Conservatives would say that in theory the market would replace those horrorshow companies, but for anyone who lives in the real world and interacts with American customer service knows that the day when market forces push private sector companies asymptotically toward customer service quality is a future day well after every conservative who holds that belief will have been long dead.

Still, I walked away today, having just been in a sea of conservatives who left me speechless, and thought: this is one tiny example of a major reason people become Republicans. Disgust, anger, annoyance with government interaction (ever wait in line at the DMV?) is distorted within an emotional prism, and suddenly someone is receptive to an anti-government message. What just happened becomes explainable by a larger narrative, and now you have somewhere to channel that disgust. People don’t like to have loose disgust. It has to be funneled into a rational and ready explanation, a larger story. It helps a person feel they’re regaining control over their environment.

When CPAC attendees gather to glory in their hatred of government, the thing Grover Norquist wants to drown in a bathtub, they are insisting that government is the problem. That it cannot be efficient, and that the side effect is to steal from you (who are good and have earned it) to redistribute to others (who haven’t).

That the tone coming out of CPAC is as hard-edged as it has been (“Al Franken and ACORN: How Liberals are Destroying the American Election System”; “Health Care: The Train Wreck Ahead”; “Bailing Out Big Business: Are We All Socialists Now?”) reflects this core fear that Democratic control of government means more and more aspects of life will be filled with interactions like this one. A lot of the spinoff spew that takes shape in prejudice behaviors of intolerance derives, I believe, from fear that a force bigger than me is taking from me with no recourse. Prejudice is about looking for targets to blame for the powerlessness.

The way that my belief in the moral force of civil rights is the foundation for why I start as less a Democrat than as an anti-Republican, and much of the rest is built outward from there, many Republicans start with the kernel that government’s inherent design is to be inefficient, and to take from your deserving pockets and put it in the pocket of passive-aggressive, government job-having bureaucrats. They, too, build outward from that core belief to the rest of the ideology. It’s a zero-sum game where limited resources mean its you or the other guy who wins.

Is this way oversimplified? Of course, there are many paths to the Republican Party. Earth-shattering in insight? Not close, since it doesn’t take a genius to point out that conservatives hate government. It’s more an idle stream of thought on a Friday afternoon from a stunned-into-silence non-conservative leaving the ultra-conservative CPAC, trying to empathize with how that ideology starts.

I mean, there are a LOT of them at this thing.

Filed under