text:
Microbial 'omics

Brought to you by

# kegg-metabolism [artifact]

A TXT-type anvi’o artifact. This artifact is typically generated, used, and/or exported by anvi’o (and not provided by the user)..

Back to the main page of anvi’o programs and artifacts.

## Provided by

anvi-estimate-metabolism

## Required or used by

anvi-compute-functional-enrichment

## Description

Output text files produced by anvi-estimate-metabolism that describe the presence of metabolic pathways in a contigs-db.

Depending on the output options used when running anvi-estimate-metabolism, these files will have different formats.

## Long format output modes

The long format output modes produce tab-delimited files. Each line in the file (except for the header line) is indexed by an integer in the unique_id column. Different output “modes” will result in output files with different information.

### ‘Modules’ Mode

The ‘modules’ output file will have the suffix modules.txt. Each line in the file will represent information about a KEGG module in a given genome, metagenome, or bin. Here is one example, produced by running metabolism estimation on the Infant Gut dataset:

unique_id db_name genome_name kegg_module module_name module_class module_category module_subcategory module_definition kofam_hits_in_module gene_caller_ids_in_module module_completeness module_is_complete
0 E_faecalis_6240 Enterococcus_faecalis_6240 M00001 Glycolysis (Embden-Meyerhof pathway), glucose => pyruvate Pathway modules Carbohydrate metabolism Central carbohydrate metabolism ””“(K00844,K12407,K00845,K00886,K08074,K00918) (K01810,K06859,K13810,K15916) (K00850,K16370,K21071,K00918) (K01623,K01624,K11645,K16305,K16306) K01803 ((K00134,K00150) K00927,K11389) (K01834,K15633,K15634,K15635) K01689 (K00873,K12406)””” K01834,K00134,K00873,K01689,K01624,K01803,K00927,K00850,K01810,K00845 2342,2646,1044,642,226,1041,348,1042,1043,225,600,1608 1.0 True
1 E_faecalis_6240 Enterococcus_faecalis_6240 M00002 Glycolysis, core module involving three-carbon compounds Pathway modules Carbohydrate metabolism Central carbohydrate metabolism ”"”K01803 ((K00134,K00150) K00927,K11389) (K01834,K15633,K15634,K15635) K01689 (K00873,K12406)””” K01834,K00134,K00873,K01689,K01803,K00927 2342,2646,1044,642,226,1041,1042,1043 1.0 True
(…) (…) (…) (…) (…) (…) (…) (…) (…) (…) (…) (…) (…)

### ‘KOfam Hits in Modules’ Mode

The ‘kofam_hits_in_modules’ output file will have the suffix kofam_hits_in_modules.txt. Each line in the file will represent information about one KOfam hit in a given genome, metagenome, or bin - but ONLY KOs that are a part of at least one KEGG Module are included in this output. Hits are organized according to the KEGG module that they belong to, and more specifically the path through the KEGG module in which the KO appears.

What is a path through a KEGG module, you ask? Well. KEGG modules are metabolic pathways defined by a set of KOs. For example, here is the definition of module M00001, better known as “Glycolysis (Embden-Meyerhof pathway), glucose => pyruvate”:

(K00844,K12407,K00845,K00886,K08074,K00918) (K01810,K06859,K13810,K15916) (K00850,K16370,K21071,K00918) (K01623,K01624,K11645,K16305,K16306) K01803 ((K00134,K00150) K00927,K11389) (K01834,K15633,K15634,K15635) K01689 (K00873,K12406)

Spaces separate steps (reactions) in the metabolic pathway, and commas separate alternative KOs or alternative sub-pathways that can facilitate the same overall reaction. So a definition such as the one above can be “unrolled” into several different linear sequences of KOs, each of which we consider to be a possible “path” through the module. As an example, we can take the first option for every step in the Embden-Meyerhof pathway definition from above:

(K00844,K12407,K00845,K00886,K08074,K00918) (K01810,K06859,K13810,K15916) (K00850,K16370,K21071,K00918) (K01623,K01624,K11645,K16305,K16306) K01803 ((K00134,K00150) K00927,K11389) (K01834,K15633,K15634,K15635) K01689 (K00873,K12406)

to get the following path of KOs (which happens to be the path shown in the output example below):

K00844 K01810 K00850 K01623 K01803 K00134 K00927 K01834 K01689 K00873

For every KO in the path above that has a hit in the contigs-db, there will be a corresponding line in the ‘kofam_hits’ output file. The same will occur for every possible path in every single KEGG module, resulting in a lot of lines and extremely repetitive but nicely parseable information.

Without further ado, here is an example of this output mode (also from the Infant Gut dataset):

unique_id db_name kofam_hit gene_caller_id contig path_id path path_completeness genome_name kegg_module module_completeness module_is_complete
0 E_faecalis_6240 K01834 2342 Enterococcus_faecalis_6240_contig_00003_chromosome 0 K00844,K01810,K00850,K01623,K01803,K00134,K00927,K01834,K01689,K00873 0.8 Enterococcus_faecalis_6240 M00001 1.0 True
1 E_faecalis_6240 K01834 2646 Enterococcus_faecalis_6240_contig_00003_chromosome 0 K00844,K01810,K00850,K01623,K01803,K00134,K00927,K01834,K01689,K00873 0.8 Enterococcus_faecalis_6240 M00001 1.0 True
(…) (…) (…) (…) (…) (…) (…) (…) (…) (…) (…) (…)

### ‘KOfam Hits’ Mode

The kofam_hits output file will have the suffix kofam_hits.txt. Unlike the previous mode, this output will include ALL KOs, regardless of whether they belong to a KEGG Module or not. However, since only a subset of these KOs belong to modules, this output does not include module-related information like paths and module completeness.

Here is an example of this output mode (also from the Infant Gut dataset):

unique_id db_name genome_name ko gene_caller_id contig modules_with_ko definition
0 E_faecalis_6240 Enterococcus_faecalis_6240 K00845 1608 Enterococcus_faecalis_6240_contig_00003_chromosome M00001,M00549,M00892,M00909 glucokinase [EC:2.7.1.2]
1 E_faecalis_6240 Enterococcus_faecalis_6240 K01810 600 Enterococcus_faecalis_6240_contig_00003_chromosome M00001,M00004,M00114,M00892,M00909 glucose-6-phosphate isomerase [EC:5.3.1.9]
2 E_faecalis_6240 Enterococcus_faecalis_6240 K00850 225 Enterococcus_faecalis_6240_contig_00003_chromosome M00001,M00345 6-phosphofructokinase 1 [EC:2.7.1.11]
(…) (…) (…) (…) (…) (…) (…) (…)

### Custom Mode (for module data)

The ‘modules_custom’ output mode will have user-defined content and the suffix modules_custom.txt (we currently only support output customization for modules data). See anvi-estimate-metabolism for an example command to work with this mode.

## Matrix format output

Matrix format is an output option when anvi-estimate-metabolism is working with multiple contigs databases at once. The purpose of this output mode is to generate matrices of KEGG module statistics for easy visualization. Currently, the output of this mode includes a module completeness matrix, a matrix of binary module presence/absence values, and a matrix of KO counts. In these matrices, each row is a KEGG module or KO, and each column is an input contigs-db.

Here is an example of a module completeness matrix:

module bin_1 bin_2 bin_3 bin_4 bin_5 bin_6
M00001 1.00 0.00 1.00 1.00 1.00 0.00
M00002 1.00 0.00 1.00 1.00 1.00 1.00
M00003 0.88 0.00 1.00 0.75 1.00 0.88
M00004 0.88 0.00 0.88 0.88 0.88 0.00
M00005 1.00 0.00 1.00 1.00 1.00 1.00
(…) (…) (…) (…) (…) (…) (…)

While the above is the default matrix format, some users may want to include more annotation information in the matrices so that it is easier to know what is going on when looking at the matrix data manually. You can add this metadata to the matrices by using the --include-metadata flag when running anvi-estimate-metabolism, and the output will look something like the following:

module module_name module_class module_category module_subcategory bin_1 bin_2 bin_3 bin_4 bin_5 bin_6
M00001 Glycolysis (Embden-Meyerhof pathway), glucose => pyruvate Pathway modules Carbohydrate metabolism Central carbohydrate metabolism 1.00 0.00 1.00 1.00 1.00 0.00
M00002 Glycolysis, core module involving three-carbon compounds Pathway modules Carbohydrate metabolism Central carbohydrate metabolism 1.00 0.00 1.00 1.00 1.00 1.00
M00003 Gluconeogenesis, oxaloacetate => fructose-6P Pathway modules Carbohydrate metabolism Central carbohydrate metabolism 0.88 0.00 1.00 0.75 1.00 0.88
(…) (…) (…) (…) (…) (…) (…)

Edit this file to update this information.


text:
# strobelfilms.com

Home > Error Could > Error Could Not Find Function Print.xtable

# Error Could Not Find Function Print.xtable

I have a follow-up, though. Is the form "double Dutch" still used? I still haven't found a way to make xtable accept \multicolumn{} arguments for columns or rows. knitr did not used to have this problem. http://strobelfilms.com/error-could/error-could-not-find-function-read-dbf.html

Great Blogs and Websites Andrew Gelman Chris Lloyd Christophe Lalanne Cognitive Sciences Stack Exchange Cross Validated Daniel Lemire David Smith Drew Conway Hadley Wickham J. wrong format in GOTERM Dear list; I am using package GO and try to extract goterm for some genes. > mget("GO:0008372... One of these days I'm about to work it out once and for all (I'll post the code on GitHub). My best advice though is, that when >> something doesn't work, simply do a search for that function/package ;) >> Typing ?xtable.matrix gives you the xtable help page, which a.o.

knitr does the conversion from R Markdown to Markdown.R Studio provides a pleasant user interface and a particular Github-enabled version of a Markdown to HTML converter.2. more hot questions question feed lang-r about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation ReplyDeleteRepliesJeromy AnglimMay 2, 2014 at 3:27 PMI guess you could use the traditional graphics devices like png and pdfhttp://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/Devices.htmlOtherwise, I'm not sure.

One of my scripts is giving me the following error: in my script I set: library("xtable") print.xtable(.... Can you do that with Markdown and knitr? characters knitr xtable share|improve this question edited Jul 12 '13 at 15:21 Jagath 3,6721729 asked Jul 12 '13 at 15:03 user2418594 232 1 Welcome to TeX.SX! I think that you misunderstood a little about my previous post.

Generated Sat, 24 Dec 2016 10:33:56 GMT by s_wx1200 (squid/3.5.20) On average, Saskatchewan has the largest farms in Canada. The syntax was simpler than I thought. Since I am still in the learning stage of R, I don't think that I could fix all the problems myself.

Thus, the program begins to malfunction and crash. Landers Rob J Hyndman Sanjay Srivastava Tal Galili Tal Yarkoni Disclaimer This page, its contents and style, are the responsibility of the author and do not necessarily represent the views, policies What I meant was that I had known how to fix xtable and the .db files. I have followed this guide to create a new R package.

You answered everythign I wanted to know! https://support.bioconductor.org/p/29053/ They look like R code chunks, except they are only displayed as code. It seems like fig.pos might only work for LaTeX at present (I haven't tried: http://yihui.name/knitr/options ). Thus, I can run that to get the workspace into a state that I can start running analyses.

It reads: # This file contains various useful functions for working with datasets # # #this is the dataset merger #note thet variables from DF1 are put in front #note also http://strobelfilms.com/error-could/error-could-not-find-function-plot-table.html The most important features are in knitr. ctab <- function(tab, dec = 2, margin = NULL) { tab <- as.table(tab) ptab <- paste(round(prop.table(tab, margin = margin) * 100, dec), "%", sep = "") res <- matrix(NA, nrow = These shortcut keys are presented in a clear way.

Who were the red-robed citizens of Jedha City? Related 2Adding a knitr table from R into a \pgfplotstableread statement0How can I use a table generated by Latex in R(xtable)?6Selectively suppress caption numbering when using xtable15knitr & xcolor: incompatible color Is the form "double Dutch" still used? this content The post may be most useful if the source code and displayed post are viewed side by side.

PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 ADD REPLY • link written 7.4 years ago by Martin Morgan ♦♦ 18k On Mon, Aug 10, Have you tried it? KEGG.db, >>>> and >>>> all the chip annotation packages (moe430a.db, hgu133a.db, >>>> mogene10stprobeset.db etc.). >>>> >>>> Please see >>>> http://www.bioconductor.org/packages/release/AnnotationData.html for all >>>> the annotation packages. >>>> >>>> Best >>>> \Heidi

## But there are other possible workflows.

and receive this error: Error : could not find function "print.xtable" This is a new error and I cannot find the source. In Rnw/HTML/reStructured documents, the chunk option fig.align='center' will do the job. sed -i -e '1,//d' -e'/^<\/body>/,$d' -e 's/$//' filename.html Temporarily disable caching Question: I asked on StackOverflow about How to set cache=FALSE for a knitr markdown document and override code chunk settings? Trouble to load data with basicProfile Dear All, I am actually working on a Transcriptomic project and I woudl like to produce one of t...

Leave a Reply Cancel replyYou must be logged in to post a comment. One of my scripts is giving me the following > >> error: > >> > >> in my script I set: > >> library("xtable") > >> print.xtable(.... > >> > >> In this particular case >>>> you'd therefore want GO.db, but the same would apply to e.g. have a peek at these guys Today I reinstalled all my bioconductor/R packages.

Similar posts • Search » Re: metaData New versions of annotation data packages have been put on the web for downloading. I guess you could scan the knitr options, but I haven't seen anything designed to do this: http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/Devices.htmlDeleteReplyGary KidsonMarch 6, 2016 at 10:10 AMHi, why do my box plots look so And displayed formulas: $$\frac{1}{1+\exp(-x)}$$ knitr provides self-contained HTML code that calls a Mathjax script to display formulas.

format: plain


text:
# Homework Help: Trig solution

1. Oct 25, 2005

### jamjar

Hi,
I'm trying to solve this trig equation. I've tried representing everything in terms of sin or cos but I don't ever seem to get anywhere useful.
Any pointers?

$$Sin(\theta ) = \frac{1}{2}\left( {\frac{1}{{Cos(\theta )}} + Cos(\theta )} \right)$$

2. Oct 25, 2005

### jamjar

Well, I just solved that anyway, 1 minute after posting it.
I had some wacky manipulation error before that I spotted.

3. Oct 26, 2005

### Atomos

How did you solve it? I have been studying this problem and I cannot find a solution.


text:
Show Summary Details
Page of

# (p. 350) Respiratory muscle function in the critically ill

Respiratory muscle function in the critically ill
Chapter:
Respiratory muscle function in the critically ill
DOI:
10.1093/med/9780199600830.003.0077
Page of

PRINTED FROM OXFORD MEDICINE ONLINE (www.oxfordmedicine.com). © Oxford University Press, 2021. All Rights Reserved. Under the terms of the licence agreement, an individual user may print out a PDF of a single chapter of a title in Oxford Medicine Online for personal use (for details see Privacy Policy and Legal Notice).

date: 23 January 2022

## Key points

• The main inspiratory muscle is the diaphragm.

• Hyperinflation places the diaphragm at a great mechanical disadvantage, decreasing its force generating capacity.

• The ability to take one breath depends on the balance between the load faced by the inspiratory muscles and their neuromuscular competence, whereas the ability to breathe over time (endurance) depends on the balance between energy supplies to the inspiratory muscles and their energy demands.

• In response to acute increases in load, the inspiratory muscles develop fatigue, inflammation, and injury. In response to unloading by the use of mechanical ventilation they develop atrophy and dysfunction.

• Respiratory muscle function can be tested using the maximum static inspiratory and expiratory mouth pressures, and sniff pressure. Diaphragm function can be tested by measuring the transdiaphragmatic pressures, and the twitch pressures developed upon electrical or magnetic stimulation of the phrenic nerve.

## Functional anatomy

### The intercostal muscles

The intercostal muscles are two thin layers of muscle fibres occupying each of the intercostal spaces, the external being superficial to the internal [1]. The muscle fibres of the two layers run approximately at right angles to each other: The external intercostals extend from the tubercles of the ribs dorsally to the costochondral junctions ventrally, and their fibres are orientated obliquely, downward and forward, from the rib above to the rib below [1]. The internal intercostals begin posteriorly, as the posterior intercostal membrane on the inner aspect of the external intercostal muscles. From approximately the angle of the rib, the internal intercostal muscles run obliquely, upward and forward from the superior border of the rib and costal cartilage below to the floor of the subcostal groove of the rib and the edge of the costal cartilage above, ending at the sternocostal junctions [1]. All the intercostal muscles are innervated by the intercostal nerve [1].

The external intercostal muscles have an inspiratory action on the rib cage, whereas the internal intercostal muscles are expiratory, with the exemption of the parasternal intercostals, which are inspiratory [1].

### The diaphragm

The floor of the thoracic cavity is closed by a thin musculotendinous sheet, the diaphragm, the most important inspiratory muscle, accounting for approximately 70% of minute ventilation in normal subjects [1]. The diaphragmatic fibres radiate from the central tendon to insert peripherally into skeletal structures. The diaphragm has two main components based on its point of origin—the crural (vertebral) part and the costal (sternocostal) part. The crural part arises from the crura (strong, tapering tendons attached vertically to the anterolateral aspects of the bodies, and intervertebral disks of the first three lumbar vertebrae on the right and two on the left) and the three aponeurotic arcuate ligaments. The costal part of the diaphragm arises from the xiphoid process, and the lower end of the sternum and the costal cartilages of the lower six ribs. These costal fibres run cranially so that they are directly apposed to the inner aspect of lower rib cage, creating a zone of apposition [1].

The shape of the relaxed diaphragm at the end of a normal expiration is that of two domes joined by a saddle that runs from the sternum to the anterior surface of the spinal column. The motor and proprioceptive innervation of the diaphragm is from the phrenic nerves. When tension develops within the diaphragmatic muscle fibres, a caudally-orientated force is applied on the central tendon and the dome of the diaphragm descends; this descent has two effects. First, it expands the thoracic cavity along its craniocaudal axis and, consequently, the pleural pressure falls. Secondly, it produces a caudal displacement of the abdominal visceral contents and an increase in the abdominal pressure that in turn results in an outward motion of the ventral abdominal wall. Moreover, when the diaphragm contracts, a cranially-orientated force is applied by the costal diaphragmatic fibres to the upper margins of the lower six ribs that has the effect of lifting and rotating them outward (insertional force) [1]. The actions mediated by the changes in pleural and abdominal pressures are more complex. If the diaphragm was the only muscle acting on the rib cage, it would have two opposing effects when it contracts [1]. On the upper rib cage, it causes a decrease in the anteroposterior diameter, and this expiratory action is primarily because of the fall in pleural pressure. On the lower rib cage, it causes an expansion. This inspiratory action on the lower rib cage is caused by the concomitant action of two different forces, the ‘insertional’ force already described and the ‘appositional’ force, whereby the increase in abdominal pressure expands the lower rib cage at the zone of apposition.

### The abdominal muscles

The abdominal expiratory muscles constitute the ventrolateral wall of the abdomen (i.e. the rectus abdominis ventrally, and the external oblique, internal oblique, and transverses abdominis laterally). They are innervated by the lower six thoracic nerves and the first lumbar nerve [1]. As they contract, they pull the abdominal wall inward, thus increasing the intra-abdominal pressure. This causes the relaxed diaphragm to move cranially into the thoracic cavity, increasing the pleural pressure and decreasing lung volume. Expiration is usually passive, but can become active when minute ventilation has to be increased (e.g. during exercise) or during respiratory distress. Expiratory muscle action is also essential during cough.

## Physiology: the ability to breathe—the load/capacity balance

For a human to take a spontaneous breath, the inspiratory muscles must generate sufficient force to overcome the elastance of the lungs and chest wall (lung and chest wall elastic loads), as well as the airway and tissue resistance (resistive load). This requires an adequate output of the centres controlling the muscles, anatomic and functional nerve integrity, unimpaired neuromuscular transmission, an intact chest wall, and adequate muscle strength [2,3]. This can be schematically represented by considering the ability to take a breath as a balance between inspiratory load and neuromuscular competence (Fig. 77.1a). Under normal conditions, this system is polarized in favour of neuromuscular competence (i.e. there are reserves that permit considerable increases in load). However, for a human to breathe spontaneously, the inspiratory muscles should be able to sustain the aforementioned load over time, as well as adjust the minute ventilation in such a way that there is adequate gas exchange. The ability of the respiratory muscles to sustain this load without the appearance of fatigue is called endurance, and is determined by the balance between energy supplies and energy demands (Fig. 77.1b).

Fig. 77.1a Balance between inspiratory load and neuromuscular competence. The ability to take a spontaneous breath is determined by the balance between the load imposed on the respiratory system (pressure developed by the inspiratory muscles; PI) and the neuromuscular competence of the ventilatory pump (maximum inspiratory pressure; PI, max). Normally, this balance weighs in favour of competence, permitting significant increases in load. However, if the competence is, for whatever reason, reduced below a critical point (e.g. drug overdose, myasthenia gravis), the balance may then weigh in favour of load, rendering the ventilatory pump insufficient to inflate the lungs and chest wall.

Reproduced with permission of the European Respiratory Society ©. Eur Respir J November 1, 1996 9, 2383–400; doi: 10.1183/09031936.96.09112383.

Fig. 77.1b Balance between energy supplies and energy demands. Respiratory muscle endurance is determined by the balance between energy supplies and demands. Normally, the supplies meet the demands, and a large reserve exists. Whenever this balance weighs in favour of demands, the respiratory muscles ultimately become fatigued, leading to inability to sustain spontaneous breathing. VT/TI, Mean inspiratory flow (tidal volume/inspiratory time); TI/TTOT, duty cycle (fraction of inspiration to total breathing cycle duration); PI/PI,max, inspiratory pressure/maximum inspiratory pressure ratio; VʹE, minute ventilation.

Reproduced with permission of the European Respiratory Society ©. Eur Respir J November 1, 1996 9, 2383–400; doi: 10.1183/09031936.96.09112383.

Energy supplies depend on the inspiratory muscle blood flow, the blood substrate (fuel) concentration, and arterial oxygen content, the muscle’s ability to extract and use energy sources, and the muscle’s energy stores [2,3]. Under normal circumstances, energy supplies are adequate to meet the demand, and a large recruitable reserve exists (see Fig. 77.1b). Energy demands increase proportionally with the mean pressure developed by the inspiratory muscles per breath (PI) expressed as a fraction of maximum pressure that the respiratory muscles can voluntarily develop (PI/PI,max), the minute ventilation (VE), the inspiratory duty cycle (TI/TTOT), and the mean inspiratory flow rate (VT/TI) and are inversely related to the efficiency of the muscles [2,3]. Fatigue develops when the mean rate of energy demands exceeds the mean rate of energy supply (i.e. when the balance is polarized in favour of demands) [2,3].

The product of TI/TTOT and the mean transdiaphragmatic pressure expressed as a fraction of maximal (Pdi/Pdi,max) defines a useful ‘tension-time index’ (TTIdi) that is related to the endurance time (i.e. the time that the diaphragm can sustain the load imposed on it). Whenever TTIdi is smaller than the critical value of 0.15, the load can be sustained indefinitely; but when TTIdi exceeds the critical zone of 0.15–0.18, the load can be sustained only for a limited time period—in other words, the endurance time. This was found to be inversely related to TTIdi [2,3]. The TTI concept is assumed to be applicable not only to the diaphragm, but also to the respiratory muscles as a whole:

$Display mathematics$
[eqn 1]

Because endurance is determined by the balance between energy supply and demand, TTI of the inspiratory muscles has to be in accordance with the energy balance view [2,3]. In fact, as Fig. 77.1b demonstrates, PI/PI,max and TI/TTOT, which constitute the TTI, are among the determinants of energy demands. An increase in either that will increase the TTI value, will also increase the demands, but what determines the ratio PI/PI,max? The numerator, the mean inspiratory pressure developed per breath, is determined by the elastic and resistive loads imposed on the inspiratory muscles. The denominator, the maximum inspiratory pressure, is determined by the neuromuscular competence (i.e. the maximum inspiratory muscle activation that can be voluntarily achieved). It follows, then, that the value of PI/PI,max is determined by the balance between load and competence (see Fig. 77.1a). However, PI /PI,max is also one of the determinants of energy demands (see Fig. 77.1b; therefore, the two balances (i.e. between load and competence, and energy supply and demand) are in essence linked, creating a system (Fig. 77.1c). Schematically, when the central hinge of the system moves upward, or is at least at the horizontal level, spontaneous ventilation can be sustained indefinitely. The ability of a subject to breathe spontaneously depends on the fine interplay of many different factors. Normally, this interplay moves the central hinge far upward and creates a great ventilatory reserve for the healthy individual. When the central hinge of the system, for whatever reason, moves downward, spontaneous ventilation cannot be sustained, and ventilatory failure ensues [2,3].

Fig. 77.1c System of two balances—load and competence, energy supplies and demands. The system of two balances, incorporating the various determinants of load, competence, energy supplies, and demands is represented schematically. The PI/PI,max, one of the determinants of energy demands (see Fig. 77.1a) is replaced by its equivalent—the balance between load and neuromuscular competence (see Fig. 77.1b). In fact, this is the reason the two balances are linked. When the central hinge of the system moves upward or is at least at the horizontal level, a balance exists between ventilatory needs and neurorespiratory capacity, and spontaneous ventilation can be sustained. In healthy persons, the hinge moves far upward, creating a large reserve.

Reproduced with permission of the European Respiratory Society ©. Eur Respir J November 1, 1996 9, 2383–400; doi: 10.1183/09031936.96.09112383.

### Hyperinflation

Hyperinflation (frequently observed in obstructive airway diseases) compromises the force-generating capacity of the diaphragm for a variety of reasons [2]: First, the respiratory muscles, like other skeletal muscles, obey the length–tension relationship. At any given level of activation, changes in muscle fibre length alter tension development. This is because the force-tension developed by a muscle depends on the interaction between actin and myosin fibrils (i.e. the number of myosin heads attaching and thus pulling the actin fibrils closer within each sarcomere). The optimal fibre length (Lo) where tension is maximal, is the length at which all myosin heads attach and pull the actin fibrils. Below this length (as with hyperinflation, which shortens the diaphragm), actin-myosin interaction becomes suboptimal, and tension development declines. Second, as lung volume increases, the zone of apposition of the diaphragm decreases in size, and a larger fraction of the rib cage becomes exposed to pleural pressure. Hence, the diaphragm’s inspiratory action on the rib cage diminishes. Third, the resultant flattening of the diaphragm increases its radius of curvature (Rdi) and, according to Laplace’s law, Pdi = 2Tdi/Rdi, diminishes its pressure-generating capacity (Pdi) for the same tension development (Tdi).

## Respiratory muscle responses to changes in load

### Acute responses to increased load

#### Respiratory muscle fatigue

Fatigue is defined as the loss of capacity to develop force and/or velocity in response to a load that is reversible by rest [4,5]. Fatigue should be distinguished from weakness, in which reduced force generation is fixed and not reversed by rest. Theoretically, the site of fatigue may be located anywhere in the long chain of events involved in voluntary muscle contraction leading from the brain to the contractile machinery. A widely-used convention is to classify fatigue as central, peripheral high-frequency, or peripheral low-frequency.

Central fatigue is present when a maximal voluntary contraction generates less force than does maximal electrical stimulation [4,5].

Peripheral fatigue refers to failure at the neuromuscular junction or distal to this structure and is present when muscle force output falls in response to direct electrical stimulation [4,5]. This type of fatigue may occur because of failure of impulse propagation across the neuromuscular junction, the sarcolemma, or the T-tubules (transmission fatigue), impaired excitation–contraction coupling, or failure of the contractile apparatus of the muscle fibres. Peripheral fatigue can be further classified into high-frequency and low-frequency, on the basis of the shape of the muscle force-frequency curve. High-frequency fatigue results in depression of the forces generated by a muscle in response to high-frequency electrical stimulation (50–100 Hz), whereas low-frequency fatigue results in depression of force generation in response to low-frequency stimuli (1–20 Hz) [4,5]. High-frequency fatigue is attributed to transmission fatigue. Normal subjects breathing against high-intensity inspiratory resistive loads develop high-frequency fatigue, which resolves very quickly after cessation of the strenuous diaphragmatic contractions.

When the loss of force is not accompanied by a parallel decline in the electrical activity impaired excitation-contraction coupling is thought to be responsible. This type of fatigue is characterized by a selective loss of force at low frequencies of stimulation (low-frequency fatigue) and is long-lasting, taking several hours to recover [4,5].

#### Inflammation and injury

Strenuous diaphragmatic contractions (induced by resistive breathing, which accompanies many disease states such as chronic obstructive pulmonary disease (COPD) and asthma) initiate an up-regulation of cytokines within the diaphragm [6]. Prolonged, strenuous resistive breathing results in diaphragmatic ultrastructural injury (such as sarcomere disruption, necrotic fibres, flocculent degeneration, and influx of inflammatory cells) in both animals and humans. The mechanisms involved are not definitely established, but may involve intradiaphragmatic cytokine induction, adhesion molecule up-regulation, calpain activation, and reactive oxygen species formation [6].

Respiratory muscles also adapt when they become inactive, as happens during denervation or when a mechanical ventilator undertakes their role as force generator to create the driving pressure permitting airflow into the lungs. Inactivity and unloading of the diaphragm caused by mechanical ventilation is harmful, resulting in decreased diaphragmatic force-generating capacity, diaphragmatic atrophy, and diaphragmatic injury, which are described by the term ventilator-induced diaphragmatic dysfunction (VIDD) [7]. The mechanisms are not fully explained, but muscle atrophy, oxidative stress, and structural injury contribute to various extents in the development of VIDD [7].

## Testing respiratory muscle function

### Maximal static mouth pressures

Measurement of the maximum static inspiratory (PI,max) or expiratory (PE,max) pressure that a subject can generate at the mouth is a simple way to estimate inspiratory and expiratory muscle strength [3,5]. These are measured at the side port of a mouthpiece that is occluded at the distal end. A small leak is incorporated to prevent glottic closure and buccal muscle use during inspiratory or expiratory manoeuvres [5]. The pressure must be maintained for at least 1.5 seconds, so that the maximum pressure sustained for 1 second can be recorded [5]. The pressure measured during these manoeuvres (Pmo) reflects the pressure developed by the respiratory muscles (Pmus), plus the passive elastic recoil pressure of the respiratory system including the lung and chest wall (Prs). At functional residual capacity, Prs is 0 so that Pmo represents Pmus. Normal values are available for adults, children, and the elderly. The tests are easy to perform, yet exhibit significant between- and within-subject variability, as well as learning effect. Nervertheless, a PI,max of –80 cmH2O usually excludes clinically important inspiratory muscle weakness. In critically ill patients who cannot cooperate PI,max can be measured as the airway pressure developed after a prolonged (20 seconds) occlusion of the airway

### Transdiaphragmatic pressure

When inspiratory muscle weakness is confirmed, the next diagnostic step is to unravel whether this is due to diaphragmatic weakness. This is accomplished by the measurement of maximum transdiaphragmatic pressure (Pdi,max) [3,5]. Pdi,max is the difference between gastric pressure (reflecting abdominal pressure) and oesophageal pressure (reflecting intrapleural pressure) on a maximum inspiratory effort after the insertion of appropriate balloon catheters in the oesophagus and the stomach, respectively.

### Sniff pressure

A sniff is a short, sharp voluntary inspiratory manoeuvre performed through one or both unoccluded nostrils [5]. It achieves rapid, fully coordinated recruitment of the diaphragm and other inspiratory muscles. The nose acts as a Starling resistor, so that nasal flow is low and largely independent of the driving pressure that is the oesophageal pressure. Pdi measured during a sniff (Pdi,sn,max) reflects diaphragm strength, and Pes reflects the integrated pressure of the inspiratory muscles on the lungs. Pressures measured in the mouth, nasopharynx, or one nostril give a clinically useful approximation to oesophageal pressure during sniffs without the need to insert oesophageal balloons, especially in the absence of significant obstructive airway disease. There is a wide range of normal values, reflecting the wide range of normal muscle strength in different individuals. In clinical practice, Pdi,sn,max values greater than 100 cmH2O in males and 80 cmH2O in females are unlikely to be associated with clinically significant diaphragm weakness. Values of maximal sniff oesophageal or nasal pressure numerically greater than 70 cmH2O (males) or 60 cmH2O (females) are also unlikely to be associated with significant inspiratory muscle weakness.

### Electrophysiological testing

Electrophysiological testing helps determining whether weakness is due to muscle, nerve, or neuromuscular transmission impairment. This requires the measurement of Pdi in response to bilateral supramaximal phrenic nerve electrical or magnetic stimulation, with concurrent recording of the elicited electromyogram of the diaphragm with either surface or oesophageal electrodes [3,5].

## References

1. Vassilakopoulos T, Zakynthinos S, and Roussos C. (1998). Muscle function: basic concepts. In: Marini JJ and Slutsky A. (ed.) Physiologic Basis of Ventilator Support, pp. 103–52. New York, NY: Marcel Dekker.Find this resource:

2. Vassilakopoulos T, Zakynthinos S, and Roussos C. (1996). Respiratory muscles and weaning failure. European Respiratory Journal, 9, 2383–400.Find this resource:

3. Vassilakopoulos T and Roussos C. (2006). Neuromuscular respiratory failure. In: Albert R, Slutsky A, Ranieri M, Takala J, and Torres A. (eds) Clinical Critical Care Medicine, pp. 275–82. St. Louis, MO: Mosby.Find this resource:

4. Roussos C and Zakynthinos S. (1996). Fatigue of the respiratory muscles. Intensive Care Medicine, 22, 134–55.Find this resource:

5. ATS/ERS (2002). Statement on respiratory muscle testing. American Journal of Respiratory and Critical Care Medicine, 166, 518–624.Find this resource:

6. Vassilakopoulos T, Roussos C, and Zakynthinos S. (2004). The immune response to resistive breathing. European Respiratory Journal, 24, 1033–43.Find this resource:

7. Vassilakopoulos T. (2008). Ventilator-induced diaphragmatic dysfunction: the clinical relevance of animal models. Intensive Care Medicine, 34, 7–16.Find this resource:


text:
# Using TOP in INSERT INTO statement

I am reading a tutorial about TOP keyword in T-SQL. But I don't really understand the examples given in the tutorial.

Example 1:

INSERT TOP n INTO table_name1 (Col1, Col2)
SELECT Col3, Col4 FROM table_name2;

The tutorial mentions that the TOP here doesn't really achieve anything since the database doesn't have a concept of order, which I kind of get.

And is it correct to assume that the n rows that are chosen from table_name2 are completely random records?

Example 2:

The tutorial gives another example that improves the first statement.

INSERT INTO table_name1 (Col1, Col2)
SELECT TOP n  Col3, Col4
FROM table_name2
Order By Col1;

Here is the confusing part. Putting the TOP keyword inside the SELECT statement is supposed to give us a better control over what rows get chosen and inserted through the ORDER BY clause. So I would assume the ORDER BY clause is part of the SELECT statement in the second example. But Col1 isn't part of table_name2.

This confused the hell out of me. Thanks for any insight.

• I totally agree example 2 does not look like valid syntax to me – paparazzo Jul 1 '16 at 20:02
• I can't think of any valid use case for INSERT TOP – Martin Smith Jul 1 '16 at 20:42
• @MartinSmith Need some / any data for test. An insert you are looping to keep trans log from filling up. – paparazzo Jul 1 '16 at 20:45
• The 2nd statement is valid if table_name2 has a column named Col1. – ypercubeᵀᴹ Jul 2 '16 at 6:19

And is it correct to assume that the n rows that are chosen from table_name2 are completely random records?

When an order isn't specified, it will usually use the sort fields and directions from the design of the primary key of table_name2, but is not guaranteed to. As Aaron Bertrand said

It doesn't really matter what the clustered index is. SQL Server may still return the order based on some other index based on a wide variety of factors. Creating a primary key on some column DOES NOT guarantee that selects with no order by will suddenly come back ordered by that column always. Might you observe that most of the time? Sure. But that is not the same as a guarantee. I've never seen a polar bear on my street but there is no polar bear forcefield that prevents it from happening. – Aaron Bertrand♦ Sep 14 '11 at 20:41

It certainly wouldn't hurt to add your order clause in, even if you want them to return in the index order of the PK.

From the tutorial example

INSERT INTO table_name1 (Col1, Col2)
SELECT TOP n Col3, Col4
FROM table_name2
Order By Col1;

Gaaaah. That's horrible coding. That will order by Col1 ASC of table_name2, even though your SELECT clause isn't explicitly returning a Col1 from the second table. It is NOT ordered by Col3 of the 2nd table aka Col1 of the 1st table. The MS docs for INSERT INTO do not list an ORDER BY clause - the ORDER BY is part of the inner SELECT clause.

It's always better to explicitly specify which table you are inserting into and selecting from. E.g. this would be a slightly better example.

INSERT INTO
table_name1 (Col1, Col2)
SELECT TOP 3
t2.Col3
,t2.Col4
FROM
table_name2 AS t2
ORDER BY
t2.Col1 ASC, t2.Col3 ASC, t2.Col4 ASC

After this alteration there's no confusion about what Col1 means (nor the sort order of it). I'd still recommend throwing in a sort order of Col3 and Col4 if Col1 isn't unique for all entries in table_name2, as demonstrated above. You cannot alias the table that records are inserted into (e.g. table_name1 AS t1 (t1.Col1, t1.Col2) as that is not legal syntax for existing versions of SQL Server.

Opinion-based recommendation: avoid the tutorial website that you found.

• Thanks. A second sort order like you suggested would appear after the first sort order? – John Smith Jul 1 '16 at 20:10
• will edit above – mpag Jul 1 '16 at 20:12
• There is never ambiguity if only one table in involved. Even it it is the select of the insert. – paparazzo Jul 1 '16 at 20:25
• the ambiguity to which I was referring is the ambiguity of interpretation by the reader, not the ambiguity of the DB engine. Perhaps I should call it "confusion" instead :) – mpag Jul 1 '16 at 20:31

If the is what the book says then it is misleading at best
At least in MSSQL 2012

The insert (col1, col2) is just index based
The first item in the select goes into col1
The data type must be the same
The select stands on it own and is not aware of column names in the insert

Example1 would only be valid for just need some data and don't care
Just need some data for test

This would only be valid is there is a col1 in table_name2
If that is the case it is a terrible example as many people would assume it means table_name1.Col1

INSERT INTO table_name1 (Col1, Col2)
SELECT TOP n  Col3, Col4
FROM table_name2
Order By Col1;

A better example is

INSERT INTO table_name1 (Col1, Col2)
SELECT TOP (n) Col3, Col4
FROM table_name2
Order By Col3;

Let's say Col1 is clustered index you should sort on col3 even if inserting all

This is not a name conflict
that order by is table_name2

INSERT INTO table_name1 (Col3, Col4)
SELECT TOP (n) Col3, Col4
FROM table_name2
Order By Col3;

Here is a situation you might use top without a sort but it is a delete
You would do it to keep the transaction log from filling up

select 1
while (@@rowcount > 0)
begin
delete top(10000) from table1
end

an insert that is fill up a transaction log

select 1
while (@@rowcount > 0)
begin
INSERT INTO table_name1 (Col3, Col4)
SELECT TOP (n) T2.Col3, T2.Col4
FROM table_name2 T2
LEFT JOIN table_name1 T1
on T1.Col3 = T2.Col3
WHERE T1.Col3 is null
Order By Col3;
end

• you wouldn't want to INSERT INTO table_name1 (Col3, Col4) unless Col3 and Col4 are the names of fields in table_name1. If t1.Col1 or any other column in the destination table has a default value (e.g. is an autonumber or defaults to NULL), and all of the listed fields exist, it would be legal, but not recommended from a readability (and expected output) perspective. – mpag Jul 1 '16 at 20:44
• @mpag No kidding they need to be field names in table_name1. Do I imply otherwise? – paparazzo Jul 1 '16 at 20:47


text:
Location of Repository

## Bulk viscosity coefficients due to phonons and kaons in superfluid color-flavor locked quark matter

### Abstract

We evaluate the three bulk viscosity coefficients $\zeta_1, \zeta_2$ and $\zeta_3$ in the color-flavor locked (CFL) superfluid phase due to phonons and kaons, which are the lightest modes in that system. We first show that the computation is rather analogous to the computation of the same coefficients in superfluid $^4$He, as due to phonons and rotons. For astrophysical applications, we also find the value of the viscosities when there is a periodic disturbance, and the viscosities also depend on the frequency of the disturbance. In a temperature regime that might be of astrophysical relevance, we find that the contributions of both the phonons and kaons should be considered, and that $\zeta_2$ is much less that the same coefficient in unpaired quark matterComment: 13 pages, 6 figures; Explanations and one reference added; version to be published in Phys. Rev.

Topics: High Energy Physics - Phenomenology, Astrophysics - High Energy Astrophysical Phenomena
Year: 2011
DOI identifier: 10.1103/PhysRevD.84.023004
OAI identifier: oai:arXiv.org:1104.5624


text:
# Finding sequence of group generators that yields group element

Here is my permutation group that acts on lists of length 4, defined in terms of four generators:

permGroup = PermutationGroup[{Cycles[{{1, 3}, {2, 4}}],
Cycles[{{1, 2}}], Cycles[{{3, 4}}], Cycles[{{2, 4}}]}]

Given a list of four entires out of order, I can get the permutation required using FindPermutation or the position of the element in the group using GroupElementPosition:

outOfOrderExample = {3,1,2,4};

GroupElementPosition[permGroup, FindPermutation[outOfOrderExample,{1,2,3,4}]]
(*13*)

But, how do I get the precise sequence of group generators that when multiplied together puts the list outOfOrderExample back in order? Obviously, the answer is not unique. I just need any of the shortest answer.

An acceptable answer would be a list of numbers identifying the generators in permGroup, such as {2, 3, 4, 3} for this example. You can check the answer is correct by doing something like

Permute[outOfOrderExample,
PermutationProduct@@First[permGroup][[{2, 3, 4, 3}]]]

Use GroupElementToWord. There are some examples in the documentation, especially in the Neat Examples section which mentions Rubik's cube.

Below I express the permutation that takes {3,1,2,4} to {1,2,3,4} in terms of a 'word' or sequence of the group generators (and their inverses).

perms = {
Cycles[{{1, 3}, {2, 4}}],
Cycles[{{1, 2}}],
Cycles[{{3, 4}}],
Cycles[{{2, 4}}]
};

permGroup = PermutationGroup[perms];
generators = GroupGenerators[permGroup];

outOfOrderExample = {3, 1, 2, 4};
reversePerm = FindPermutation[outOfOrderExample, Sort@outOfOrderExample];
GroupElementQ[permGroup, reversePerm]
ge2word = GroupElementToWord[permGroup, reversePerm];
(** result: {-4, 3,-1} - e.g 3 means apply perm 3,
while -4 means apply inverse of perm 4 **)

reversePermSequence =
If[Positive@#, Identity, InversePermutation][
generators[[Abs[#]]]] & /@ ge2word;

Fold[Permute, outOfOrderExample, reversePermSequence]
(*result {1,2,3,4}*)

• Thank you! I did not know what the function was called. To be clear, -4 even though inverse of perm 4, is the same as 4 because it is self inverse. Right? Oct 6 '20 at 21:45
• @QuantumDot Yes the language of group theory and most modern algebra is needlessly byzantine. And yes, it just so happens that InversePermutation[perms[[4]]] is the same as perms[[4]]. Oct 6 '20 at 21:48
• I made some minor edits which uses the group generators instead of the original perms and fixes the order, since I noticed a bug when trying some different groups. I realize the generators are the same, but this is just so anybody passing by with a different set of perms finds this useful. Oct 6 '20 at 22:04


text:
# Is Wells Fargo "a criminal enterprise"?

• News
Staff Emeritus
2019 Award
This is rapidly turning into "Banks are evil. This act is evil. Therefore banks committed this act."

The FDIC has three options when bailing out a failed bank:

1. Simple payoff: the depositors get a direct payout for their deposits (small banks only).

2. Sell off: Another bank acquires the liabilities and assets of the failed bank.

3. Bail out: The failed bank is not closed, and all depositors (insured or not) are fully protected (Only a select few large banks). This is paraphrased from Irving Sprague, former Director of the FDIC.

This is rapidly turning into "Banks are evil. This act is evil. Therefore banks committed this act."
Not it's not. We're discussing the original post if Wells Fargo a criminal enterprise.My assertion is yes. If you care to continue the debate, please refute any of my statements.

https://www.fdic.gov/bank/analytical/banking/2000dec/brv13n2_2.pdf

Here is an analysis of the S&L crisis in the 1980's. S&Ls are insured by the FSLIC, a cousin to the FDIC for commercial banks. The FSLIC became insolvent in 1986. The resolution of over 1000 S&L failures cost the taxpayers an estimated $128B. The same will happen to the FDIC in the event of another big bank failure. mheslep Gold Member Before asserting the conditions of the S&L failures were the same as now, what changes were made in the wake of the S&L failures. Before asserting the conditions of the S&L failures were the same as now, what changes were made in the wake of the S&L failures. Are you asking me because you don't know, or are you testing my knowledge of S&L regulation? There was a whole bunch of legislation after the 2008 collapse too. Neither FIRREA nor Dodd Frank address the moral hazard of reserve requirements. I apologize for my link to the FDIC. I ran a report on bank failures, and copied the IP address. It takes you to the main page. You can go to bank failures and run a query yourself from the home page. mheslep Gold Member KM, you just implied the situation between the S&L collapse and now are the same. I'm asking you to back that assertion with some evidence. No I didn't. I asserted that currently the FDIC is in the same situation as the FSLIC was at the time of its insolvency. And that situation is the FDIC does not have enough funds to cover the failure of two or more large banks. mheslep Gold Member No I didn't. I asserted that currently the FDIC is in the same situation as the FSLIC was at the time of its insolvency. ... No, its not. Relative to the FDIC, the FSLIC had very little hands on control of S&Ls such as capital controls (3%), minimum number of investors (one for S&Ls at the time), time that insolvent firms were allowed to stay open (years). https://www.fdic.gov/bank/historical/history/167_188.pdf Thousands of banks have failed since the FDIC was created, and more will fail. The FDIC insures deposits, not all the assets of the bank. https://www.fdic.gov/bank/individual/failed/banklist.html I think there are many indications of problems with US banking, but that does not include that the FDIC is in the same position as the FSLIC was decades ago. I do have to stand corrected on statement I made. Since 2011 the FDIC has changed the assessment rates to reflect the relative risk of the institution. Now the minimums are about$3-4 per $100. And the problem remains the same, they are both underfunded. This is rapidly turning into "Banks are evil. This act is evil. Therefore banks committed this act." V50, you are an intelligent person. When you examine the facts pertaining to the banking system, you can only draw one conclusion. The banks can engage in risky behavior with no consequence. If the FDIC is incapable of making good its liabilities, history has proven that the government (i.e. the people) will make good the difference. The banks have been continuously bailed out by the taxpayers since the inception of the FDIC. The first time a government supported a bank in a time of failure was in 1696. There was run on the Bank of England which led to insolvency. The Parliament responded by making a law which suspended the "payment of specie". This means that depositors could not redeem their payments in gold (the standard of currency of the day). The precedent was set, and to this day there is an unholy alliance between govermnents and central banks that defies logic. Just because something is legal, does not make it right. In the words of the Mayer Amschel Rothschild ( the original bankster), "Give me control over the issuance of a nation's currency, and I care not who makes its laws." Vanadium 50 Staff Emeritus Science Advisor Education Advisor 2019 Award Kevin, I am afraid your argument is too slippery for me and you keep moving the goalposts. The fact that a bank commits some bad acts does not prove it commits other bad acts, just like the fact that a person is a thief does not allow you to hang him for murder. Fractional reserve banking, "too big to fail" and risky S&L loans in the 1980's have nothing to do with this particular Wells Fargo scandal. nsaspook and russ_watters Kevin, I am afraid your argument is too slippery for me and you keep moving the goalposts. The fact that a bank commits some bad acts does not prove it commits other bad acts, just like the fact that a person is a thief does not allow you to hang him for murder. Fractional reserve banking, "too big to fail" and risky S&L loans in the 1980's have nothing to do with this particular Wells Fargo scandal. Yes, of course you are right, FR banking has nothing to do with this scandal. Cheers. I used to have a bank account with Wells Fargo 8 months ago. I was incredulous when they took$12 dollars out of my account for no reason. The story: I had transferred some money from savings to checking to buy an item (I can't remember exactly what it was, probably a game to play with some friends) I knew the exact cost of. When I bought the item (online purchase) for the exact amount Wells Fargo gave me an overcharging fee. When I tried to get my my money back because I clearly had not over charged but paid the exact amount the Wells Fargo rep would only give me six dollars back. I was thoroughly upset and resorted to keeping my money away from Wells Fargo. The worst part is that I was powerless to do anything about it. They took the money I had entrusted them with. I can't imagine I am the only one this has happened to.

mheslep
Gold Member
The WF CEO was sacked couple days ago.

Staff Emeritus
2019 Award
But replaced by his right-hand man. Meet the new boss.

Borg, nsaspook and mheslep
Astronuc
Staff Emeritus
The bank stands to lose $99 billion in deposits,$4 billion in revenue and a customer base that could dwindle by up to 30 percent, a study released Monday by cg42 showed. Ultimately, about 14 percent of customers are actually projected to switch banks, an at-risk level that a cg42 principal still said is "dramatically higher" than what would be expected from any of Wells Fargo's competitors.


text:
# Question: What Are The Theories Of Family?

## What is the most important function of family?

One of the most important functions of the family is the socialization of children.

In most societies the family is the major unit through which socialization occurs.

Second, the family is ideally a major source of practical and emotional support for its members..

## How do Marxists view the family?

Marxists see families as essentially a conservative institution that helps to preserve capitalism. They also weaken the position of individual workers in relation to the boss.

## What is family perspective?

Description. Families share their children and themselves with us. They trust us with their hopes, dreams, fears, and challenges. … All families bring their beliefs and values to discussions about their child. A genuine partnership with families requires that we listen and pay attention to their perspectives.

## What is the family stress theory?

Family stress theory defines and explores the periodic, acute stressors that happen to all families. These positive factors help families to cope, so parents can continue to nurture their children despite chronic and acute stressors. …

## What is the feminist view on family?

Feminists argue that the so-called private realms of family, sex and reproduction must be part of the political realm and thus subject to principles of justice for three distinct reasons: Families are not “natural” orderings, but social institutions backed up by laws. For example, marriage is a social institution.

## What are the two types of theory?

There are countless theories but they can be clearly classified into two groups: Scientific Theories which are considered “true” or “facts” because they have been found experimentally to work and we know why they work, and Un-scientific Theories which have been found wanting when similarly experimentally tested.

## What are the levels of theory?

Theory in the human sciences has been used to delineate and legitimate the emerging disciplines and substantiate knowledge development. There are 4 levels of theoretical thinking in nursing: meta-theory, grand theory, middle-range theory, and micro-range theory.

## What is family development theory?

Family development theory focuses on the systematic and patterned changes experienced by families as they move through their life course. The term family as used here represents a social group containing at least one parent-child relationship.

## What are the four types of theories?

Sociologists (Zetterberg, 1965) refer to at least four types of theory: theory as classical literature in sociology, theory as sociological criticism, taxonomic theory, and scientific theory. These types of theory have at least rough parallels in social education. Some of them might be useful for guiding research.

## What is the functionalist view of family?

Functionalists see the family as a particularly important institution as they see it as the ‘basic building block’ of society which performs the crucial functions of socialising the young and meeting the emotional needs of its members. Stable families underpin social order and economic stability.

## What are the 5 functions of a family?

Societies around the world rely on the family to perform certain functions. The basic functions of the family are to: (1) regulate sexual access and activity; (2) provide an orderly context for procreation; (3) nurture and socialize children; (4) ensure economic stability; and (5) ascribe social status.

## What type of theories are there?

Type TheoryParadoxes and Russell’s Type Theories.Simple Type Theory and the $$\lambda$$-Calculus.Ramified Hierarchy and Impredicative Principles.Type Theory/Set Theory.Type Theory/Category Theory.Extensions of Type System, Polymorphism, Paradoxes.Univalent Foundations.

## What are the sociological theories of family?

The conclusions drawn from empirical observation and testing help individuals and society to be improved in the ways they lead their lives in this world. This essay is going to explain three mostly commonly mentioned sociological theories of the family which are Functionalism, Marxism and Feminism.

## What are the 6 functions of the family?

Terms in this set (6)physical maintenance. everyone receives the care and support they need.addition of new members. addition of new members through procreation or adoption.socialization of children. … values and behaviors. … family moral. … production and consumption of goods and services.

## What is Duvall’s theory of family development?

For example, Duvall’s (1957) widely‐cited model defined family development in terms of eight developmental stages: (1) married couple without children, (2) childbearing families with the oldest child between birth and 30 months, (3) families with preschool children, (4) families with school‐age children, (5) families …

## What are the family developmental stages?

The developmental phases of a family are referred to as the stages in a family life cycle. They include: unattached adult, newly married adults, childbearing adults, preschool-age children, school-age children, teenage years, launching center, middle-aged adults, and retired adults.

## What are the 4 basic functions of a family?

These four functions include regulation of sexual activity, socialization, reproduction, and economic and emotional security.


text:
# Bound in the proof of Schottky's Theorem

$$\textbf{Theorem(Schottky)}$$ Let $$M > 0$$ and $$r\in (0,1)$$ be given. Then there exists a constant $$C > 0$$ such that the following holds: If F is holomorphic in in the unit disk $$\mathbb{D}$$, omits 0 and 1 from its range, and if $$|F(0)| ≤ M$$, then $$|F(z)| ≤ C$$ for all $$z \in \mathbb{D_r}=\{z \in \mathbb{C}: |z|.

I am trying to understand the proof and here is how far I got: We define

\begin{align*} A &= \frac{\log F}{2\pi i} \\ B &= \sqrt{A} - \sqrt{A-1} \\ H &= \log{B} \end{align*}

One can show that these are well defined and both logs are chosen to have an argument in $$[-\pi,\pi]$$. We see that the definition $$\exp(H)=\sqrt{\frac{\log F}{2\pi i}} - \sqrt{\frac{\log F}{2\pi i}-1}$$ implies that $$\frac{\exp(H(z)) + \exp(-H(z))}2 = \sqrt{\frac{\log F}{2\pi i}}.$$ From here we get the estimate $$|F(z)| \leq \exp(\pi e^{2|H(z)|}).$$ Further one can show that $$|H(z)| \le |H(0)| -130 \log(1-r)$$ which shows that $$|F(z)|\leq C$$, where $$C$$ only depends on $$|H(0)|$$ and $$r$$.

So it remains to show that $$|H(0)|\leq C_1$$ where $$C_1$$ only depends on $$M$$. We have $$|\textrm{Im} (H(0))|\leq \pi$$ by construction of $$H$$.

We can assume that $$|F(0)| \geq \frac12$$ (otherwise we work with $$1-F$$). Since then $$|F(0)|$$ is bounded we get that $$C_2 \geq \left|\sqrt{\frac{\log F(0)}{2\pi i}}\right| = \left|\frac{\exp(H(0)) + \exp(-H(0))}2\right| \geq \sinh(\textrm{Re} (H(0)))$$ so that $$\textrm{Re} (H(0)) \leq \sinh^{-1}(C_2)$$ for some constant $$C_2$$ that depends only on M.

To complete the proof we need a lower bound for $$\textrm{Re} (H(0))$$, which is supposed to work similarly, but I don't see how. Can anyone help?

• You can't bound it on the entire $z\in\mathbb{D}$, because we can take $F$ to be the conformal equivalence $\mathbb{D}\to\mathbb{H}$ for example. You can only bound it on $z\in\mathbb{D}_r$. – user10354138 Jun 15 at 12:26
• Oh yes, that was a typo in the theorem, I fixed it, – EinStone Jun 15 at 12:40
• I don't see how you can bound the imaginary part of $\log F$ in any way. E.g., if $F(z) = e^{az-b}$ with $0<a<b$, then $F$ omits $0$ and $1$, and $\log F(z) = a z - b$ has imaginary part ranging in $(-a,a)$, so you can make that range arbitrarily big. (Geometrically, this function wraps the unit circle many times around $0$ in the punctured unit disk.) – Lukas Geyer Jun 17 at 23:08


text:
Cupid Rate

Introduction

This project was needed by Bluusun LLC company who served Cupid Media network. The customer wanted a rating system which could rate each user face photo by its internal alorithms (without involving other users' input). At that moment they were starting a pilot project aiming to introduce the new matching system and to use it with existing databases of the network of their *cupid webistes. The new project is supposed to appear at mightydating.com So I decided to developed a human facial beauty estimator, basing one of the existing facial feature extraction libraries.

Model search

The first atttempt was to use cmusatyalab OpenFace library for face feature extraction. The library is aimed for face recognition tasks, extracting features related to face geometry. Apparently this means loosing some useful info needed for beauty estimator like skin texture and hairstyling. However I gave it a try, given face geometry makes the greatest impact in overall facial beauty perception. The library uses dlib for face extraction/alignment and Torch as a deep learning framework.

Initially I used database of thaicupid.com website which was provided in JSON format. I wrote a Python script to scrape about 4000 images from this dating website. I've decided to start with binary classifier which would be able to choose top 10% images from all others. The images were manually labled by me with 1/0 rating.

OpenFace extracts 128 floats from an image containing human face. I ran it on my database and got resulting csv file with 129 columns (including image id).

OpenFace is distributed as Docker container, so I had to push my code into container each time to run it. The following script runs a python script provided as input argument in the openface directory inside container. It also mounts current directory in so that script can read needed inputs.

 1 2 INARGS="$@" docker run -t -i --rm -v "$(pwd)":/root/openface/openface-rate -w /root/openface/openface-rate openface sh -c "python \$INARGS"

I then used sklearn framework to train SVM classifier. I actually tested all provided classifiers but other performed worse than SVM. First of all the data was scaled with StandardScaler.

One have to use "balanced" parameter of Support Vector Regression for skewed data. This will give more weight to less-frequent ("1" or "beatiful" in this case) labels, otherwise they will have no effect compared to "0" samples, given summation in SVM loss formula.

 1 lf = GridSearchCV(svm.SVC(class_weight="balanced"), tuned_params, cv=cv, scoring="f1", verbose=True)

Then I used GirdSearchCV to perform hyperparameters C and gamma search for different SVM kernels. Since the data is skewed, I used F1 scoring. The matplotlib library was used to visualize heatmap (much more values were searhed actually):

Obviously F1 score value was exceptionally low. In order to diagnose bias/variance problem and determine future steps I've plot the learing curves:

Later I've discovered the model was suffering from high bias problem. But at that moment due to lack of experience and some ambiguity in the curves I've diagnosed high variance problem. So that I've decided to perform some feature selection based on finding correlations in density histograms, but with no avail (some transformations were applied to the graphs actually but I omit them).

The above model didn't prove being effective which I suppose is because of feature extraction engine, which is well-suited for face recognition. Looks like geometric traits only are not sufficient for the beauty estimation.

Model

Then I've decided to try more feature extraction algorithms/models. After some unsuccessfull attempts I've found the following working solution. In short, I use VGG-Very-Deep-16 convolutional neural network to extract face features. Above those features a Support Vector Regression with linear kernel is trained.

First the face is found and extracted from the image, reusing OpenFace code. I have modified the scaling part which uses OpenCV. Now it not only extracts face from an arbitrary image but also scales and rotates it so that eyes get to a predefined position. The described estimator is trained on SCUT-FBP dataset [1]. So the code places a face from arbitrary image at the same position in resulting 224x224 snippet.

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 """Find landmarks on the face image in source image coordinates""" landmarks = self.findLandmarks(rgbImg, bb) landmarks_np = np.float32(landmarks) """Choose eyes and mouth landmarks from template landmarks""" landmark_indices_np = np.array(chosen_landmarks_) """For chosen landmarks: get template landmark positions in 0..1 template coordinates; Multiply to image height/width (targret image is quadratic). Results in the position of template landmarks in target image coordinates """ tgt_landmarks = image_side * MINMAX_TEMPLATE[landmark_indices_np] """Shrink eyes and mouth position by 0.6 and move downwards by 18%. This transform template landmark positions into the approximate position inferred from the train database images""" tgt_landmarks = scale_transform(np.array(tgt_landmarks), np.float32([image_side/2, image_side/2]), 0.6) tgt_landmarks = move_transform(tgt_landmarks, np.float32([0, image_side*0.18])) """Create transformation so that eyes and nose positions on the source image (taken from landmarks_np) are transformed to corresponding scaled points on target image""" H = cv2.getAffineTransform(landmarks_np[landmark_indices_np], tgt_landmarks) """Apply transformation. Now we get extracted face with the following properties: -square form with width 224 -image is rotated and scaled so that the face is placed exactly at the position the target estimator expect it to be White background is added where image borders are exceeded. """ result_img = cv2.warpAffine(rgbImg, H, (image_side, image_side), borderValue=(255,255,255)) return result_img

Image affine transormation to align with train dataset images

---->>

Face features are then extracted by VGG-Very-Deep-16 convolutional neural network. FC layers 6 and 7 output 2622 floats. I use FC layer 7 output, so in my case the network extracts 2622 features. In the original work [2] this output is further passed to the Rectification Unit, dropout and one more FC layer, finally getting to the softmax classifier. Since we don't need classification, but only feature extraction, the last 4 layers are not used. Below is the overall structure of the CNN being used.

It has the following peculiarities:
-13 convolution layers, thus considered "very deep" network; The similar results can also be achieved with 5 convolution layers CNN.
-3 fully connected layers; They are actually the same as the convolution layers but each filter size matches the size of the input data and the number of filters is the desired output size. The last FC layer performs classification according to the number of persons being recognized (not used in this project).
-to add regulariztion, droupout takes place after relu6 and relu7 layers (not shown in the table);

The features were extracted from SCUT-FBP dataset resulting in 500x2622 resulting csv file.

Examples of SCUT-FBP samples

These are seemingly too much features so I apply dimensionality reduction with sklearn.decomposition.PCA. Choosing 99% threshold I have to leave the first 114 components:

Components Variance Exp.
...
107, 0.98932587865661736
108, 0.98943726944441035
109, 0.98954716901106854
110, 0.98965630293313933
111, 0.98976370390353152
112, 0.98987026446597537
113, 0.98997480147248007
114, 0.9900775904016651
115, 0.99017942865052888

Then I use pickle to save Ureduce matrix as part of PCA class and pandas to export resulting dataset to .csv file with the reduced dimensionality.

Now then, we have ready dataset, produced by our CNN feature extraction with dimensionality reduced to somewhat moderate values (still high-dimensional though). The dataset is labeled and labels are stored in .xlsx spreadsheet. Since we need continuous rating output values 1.0-5.0 I use Support Vector Regression as an estimator. I perform extensive hyperparameters search and get heatmaps similar to the picture above related to the previous model. Finally I come up with the following values:

 1 self._clf = svm.SVR(kernel="linear", C=0.00025)

Having image extraction procedure, trained SVR estimator and PCA Ureduce matrix saved, the actual usage is the following:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 """Extract image (repeated for a set of images actually)""" im = extract_image(img_path) ... im = np.asarray(im, dtype='float64') / 256 """Prepare input image""" MEAN_RGB = np.array([129.1863,104.7624,93.5940]) """Change axes so that dimensions correspond to those of the CNN input and subtract MEAN_RGB""" """Results in 1 x channels x height x width""" im = prepare_image(im) """Get fully-connected layer 7 output""" """ Apply Rectified Linear Unit to layer 6 output and combine outputs""" out = net_caffe.forward(data = floatX(image_list), end='fc7') """ Multiple resulting vector to pre-calculated Ureduce matrix""" img_features = out['fc7'].reshape((out['fc7'].shape[0],np.prod(out['fc7'].shape[1:]))) ... """Final design matrix for a set of images""" feat_mx = np.concatenate((feat_mx, img_features.copy), axis=0) ... """Make predictions for a set of images""" pred = clf.predict(feat_mx)

Pearsons correlation coefficient have been chosen as the metric to measure beauty ranking accuracy. The SVR estimator have been trained with images from SCUT-FBP dataset. When assessed on the same dataset, cross-validation with random shuffling is used. Predictably when assessed on the special Test 200 dataset (described in the next section), the scores are lower. But the last case only can be considered meaningful, because it is obtained on the real data. The pool5+fc6 layers output was tested as in [3]. The resulting accuracies are shown in the table below. Only the extract is shown.

The interesting observation is that data standardization yields lower score compared to just centered data.

The estimator demo

Test 200 dataset

In order to perform estimator testing a special dataset have been crafted. The pictures were taken from thaicupid.com database. The manual rating was performed on a small set of 20 pictures. Those samples are not used for training but rather only for approximate assessment of the estimator effectiveness. To ease rating process/decrease errors I've used the pairwise comparison technique similar to described in 2.2 [4] A Python script have been developed to obtain pairwise comparisons on a set of pictures. A pair of pictures is chosen randomly and shown to the user. The user is supposed to press either "z" of "m" on the keybord to chose left or right picture, whichever looks better. 200 comparisons are enough to proceed with absolute rating:

"To convert the scores from pairwise to absolute, we minimize a cost function defined such that as many of the pairwise preferences as possible are
enforced and the scores lie within a specified range. Let $s = \in\{s_1, s_2 ,..., s_N \}$ be the set of all scores assigned to images 1 to N . We formulate the problem into minimizing the cost function:

$$J(s) = \displaystyle\sum_{i=1}^{M} \phi(s_i^+ - s_i^-) + \lambda s^T s$$
where $(s_i^+ / s_i^-)$ denotes the current scores of the i th comparison and $\phi(d)$ is some cost function which penalizes images that have scores which disagree with one of M pairwise preferences and $\lambda$ is a regularization constant that controls the range of final scores. We define $\phi(d)$ as an exponential cost function $\phi(d) = e^{−d}$ " [4]

Below is the derivative of the cost w.r.t. to one of the variables $s_1$

$$\frac{dJ}{s_1} = e^{-s_1} \displaystyle\sum_{i : s_1^+} e^{s_i} + e^{s1} \displaystyle\sum_{j : s_1^-} e^{-s_j} + 2 s_1$$

where $s_i$ is taken from pairs where image 1 compares positive (better) and $s_j$ is taken from pairs where image 1 compares negative (worse).
Having derivative formula I can write Octave/MATLAB fucntion returning the cost and gradient for a given vector $s$:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 function [J, grad] = computeCost(s, id_list, pairs, lambda) J = 0; %"compute cost J" for p = pairs larger_id = p(1); s_i_plus = s * (id_list == larger_id); smaller_id = p(2); s_i_minus = s * (id_list == smaller_id); J += exp(-(s_i_plus - s_i_minus)); end J += lambda * s * s'; p_first_row = pairs(1, :); p_second_row = pairs(2, :); N = length(s); grad = zeros(N, 1); %"compute gradient w.r.t to each s" for i=1:length(s) id = id_list(i); %"id pairs, where id(i) (corresponding to s_i) compares +" s_more_pairs = pairs(:, find(p_first_row == id)); %"ids, where id(i) compares + to this id " s_more_ids = unique(s_more_pairs(2, :)); %"s_x corresponding to those ids" s_more = s(:, find(ismember(id_list, s_more_ids))); grad(i) += exp(-s(i)) * sum(exp(s_more)); %"same but comparing -" s_less_pairs = pairs(:, find(p_second_row == id)); s_less_ids = unique(s_less_pairs(1, :)); s_less = s(:, find(ismember(id_list, s_less_ids))); grad(i) += exp(s(i)) * sum(exp(-s_less)); grad(i) += 2 * s(i); end end

With the above cost/gradient function the minimization problem is solved in one call:

 1 [s, cost] = fminunc(@(s_var)(computeCost(s_var, id_list, pairs, lambda)), s);

The resulting $s$ contains absolute ratings according to the input pairwise comparisons. It may require some scaling to fit into the scale used by the estimator.

Conclusion

The developed estimator enables for facial beauty estimation of an arbitrary image (URL). The underlying convolutional NN is very deep network developed by VGG. scikit-learn library was used above its outputs. The Test 200 labeled dataset was composed from pairwise ratings obtained with a developed Python utility and an Octave script. Differrent CNN architectures/hyperparameters/preprocessing options were researched for maximum correlation between the estimator and human-produced rating. The project was successfully shipped and deployed on the customer site.

References

[1]Xie Duorui, Lingyu Liang, Lianwen Jin, Jie Xu, and Mengru Li. "SCUT-FBP: A Benchmark Dataset for Facial Beauty Perception." In Systems, Man, and Cybernetics (SMC), 2015
[2]Omkar M. Parkhi Andrea Vedaldi, Andrew Zisserman. Deep Face Recognition. 2015
[3]https://github.com/bknyaz/beauty_vision
[4] Douglas Gray, Kai Yu, Wei Xu and Yihong Gong. Predicting Facial Beauty without Landmarks. 2010


text:
2 Added reference and discussion of Halberstam paper; also fixed typo ("number", not "numbers") and changed address to OP from 2nd to 3rd person

Clearly $\Delta(r_i^2)$ can be no smaller than $1$ because each $r_i^2$ is an integer. A difference of $1$ is easily attained. You The proposer of the question asked about positive $m,n$, but the application to eigenmodes of a 2-dimensional cavity — presumably a square cavity — must allow $m=0$ or $n=0$ as well, and then it's clear that $r_i^2 = n^2 + 0^2$ and $r_{i+1}^2 = n^2 + 1^2$ works. Even if you insist on nonzero $m,n$, differences of 1 are easy to construct; e.g. if $n^2 = a^2 + b^2$ then $r_i^2 = a^2 + b^2$ and $r_{i+1}^2 = n^2 + 1^2$ differ by 1.

On the other hand, while the number of solutions of $m^2 + n^2 \leq r_0^2$ in positive $m,n$ is asymptotic to $\pi r_0^2 / 4$ as $r_0 \rightarrow \infty$, the set $R$ of possible $r$ values is not quite as dense as this suggests, because there's a lot of "degeneracy" (repetition) in the values of $m^2+n^2$; equivalently, as $x \rightarrow \infty$, the proportion of integers in $[1,x]$ that can be written as $m^2 + n^2$ goes to zero, so for those that do have such a representation the average number of representations must go to $\infty$. Indeed if $p$ is a prime congruent to $3 \bmod 4$ then no multiple of $p$ can be $m^2+n^2$ unless both $m$ and $n$ are multiples of $p$, which makes $m^2+n^2$ a multiple of $p^2$. This gives $p-1$ forbidden residues $\bmod p^2$. For any finite set $P$ of such primes, we deduce an upper bound $\beta_P := \prod_{p\in P} (1 - p^{-1} + p^{-2})$ on the density of integers representable as sums of two squares; since by Dirichlet the sum of $1/p$ over all such primes diverges, we find that $\log\beta_P$ can be made arbitrarily negative by taking $P$ large enough, which means that the density is less than any positive numbersnumber, and is thus zero. A more refined analysis shows that the density in $[1,x]$ decays as $1/\sqrt{\log x}$.

Another way to use a finite list $p_1,\ldots,p_k$ of primes congruent to $3 \bmod 4$ is to choose for each of them one of the forbidden residues, i.e. some $r(p_i)$ that's divisible by $p_i$ but not by $p_i^2$, and consider the simultaneous congruences $N+i \equiv r(p_i) \bmod p_i^2$. By Chinese Remainder, there's a solution $N < \prod_{i=1}^k p_i^2$, which gives $k$ consecutive integers none of which is the sum of two squares. If we use all the $3 \bmod 4$ primes up to $x$, we get $k \sim x / 2 \log x$, and $\prod_i p_i^2 < x^{2k}$ so $\log \prod_i p_i^2 < 2k \log x \sim x$, whence we've constructed a "$\log/\log \log$" gap as claimed. There may be enough freedom in the choices we've made (including the order of the $p_i$) to squeeze a bit more out of this argument, but — unless somebody can provide a reference for a paper that already proved such a result — it looks like more effort than one expects to exert on a MathOverflow question...

EDIT A quick Google search turned up a reference:

Heini Halberstam: Gaps in Integer Sequences, Math. Magazine 56 #3 (May 1983), 131-140

The "$\log / \log\log$" bound (with the same Chinese Remainder) argument appears on page 136, followed by an asymptotic formula $A(x) \sim (\pi/\sqrt{12}) (x / \sqrt{\log x})$ for the number $A(x)$ of sums of two squares less than $x$. This formula is attributed to Landau 1908, though there's no paper of Landau in the bibliography. The bibliography does cite Iwaniec's "On the half-dimensional sieve" (Acta Arith, 29 (1976), 69-95) for an alternative approach, and also a two-page paper "On the gaps between numbers that are sums of two squares" by I.Richards in Advances in Math. 46 (1982), 1-2.

1

There cannot be an asymptotic answer, because $\Delta r_i$ can be as small as $c/r_i$ (with $c \rightarrow 1/2$ as $i \rightarrow \infty$), but $\Delta r_i$ is of order $(\log r_i)^{1/2} / r_i$ on average. Equivalently, $\Delta(r_i^2)$ can be as small as $1$ but is of order $\sqrt{\log r_i}$ on average. One can also construct gaps of length $\gg \log r_i / \log \log r_i$.

Clearly $\Delta(r_i^2)$ can be no smaller than $1$ because each $r_i^2$ is an integer. A difference of $1$ is easily attained. You asked about positive $m,n$, but the application to eigenmodes of a 2-dimensional cavity — presumably a square cavity — must allow $m=0$ or $n=0$ as well, and then it's clear that $r_i^2 = n^2 + 0^2$ and $r_{i+1}^2 = n^2 + 1^2$ works. Even if you insist on nonzero $m,n$, differences of 1 are easy to construct; e.g. if $n^2 = a^2 + b^2$ then $r_i^2 = a^2 + b^2$ and $r_{i+1}^2 = n^2 + 1^2$ differ by 1.

On the other hand, while the number of solutions of $m^2 + n^2 \leq r_0^2$ in positive $m,n$ is asymptotic to $\pi r_0^2 / 4$ as $r_0 \rightarrow \infty$, the set $R$ of possible $r$ values is not quite as dense as this suggests, because there's a lot of "degeneracy" (repetition) in the values of $m^2+n^2$; equivalently, as $x \rightarrow \infty$, the proportion of integers in $[1,x]$ that can be written as $m^2 + n^2$ goes to zero, so for those that do have such a representation the average number of representations must go to $\infty$. Indeed if $p$ is a prime congruent to $3 \bmod 4$ then no multiple of $p$ can be $m^2+n^2$ unless both $m$ and $n$ are multiples of $p$, which makes $m^2+n^2$ a multiple of $p^2$. This gives $p-1$ forbidden residues $\bmod p^2$. For any finite set $P$ of such primes, we deduce an upper bound $\beta_P := \prod_{p\in P} (1 - p^{-1} + p^{-2})$ on the density of integers representable as sums of two squares; since by Dirichlet the sum of $1/p$ over all such primes diverges, we find that $\log\beta_P$ can be made arbitrarily negative by taking $P$ large enough, which means that the density is less than any positive numbers, and is thus zero. A more refined analysis shows that the density in $[1,x]$ decays as $1/\sqrt{\log x}$.

Another way to use a finite list $p_1,\ldots,p_k$ of primes congruent to $3 \bmod 4$ is to choose for each of them one of the forbidden residues, i.e. some $r(p_i)$ that's divisible by $p_i$ but not by $p_i^2$, and consider the simultaneous congruences $N+i \equiv r(p_i) \bmod p_i^2$. By Chinese Remainder, there's a solution $N < \prod_{i=1}^k p_i^2$, which gives $k$ consecutive integers none of which is the sum of two squares. If we use all the $3 \bmod 4$ primes up to $x$, we get $k \sim x / 2 \log x$, and $\prod_i p_i^2 < x^{2k}$ so $\log \prod_i p_i^2 < 2k \log x \sim x$, whence we've constructed a "$\log/\log \log$" gap as claimed. There may be enough freedom in the choices we've made (including the order of the $p_i$) to squeeze a bit more out of this argument, but — unless somebody can provide a reference for a paper that already proved such a result — it looks like more effort than one expects to exert on a MathOverflow question...


text:
# Extension : Extension 2.1: Image Processor With Iteration

Authors

## Manipulating an Image Raster

In the imagetransforms package, modify the provided Transforms Java program to implement the methods as described below. Your methods will use iteration (either while loops or for loops) to operate on the pixels of a picture.

### Notes

• To run this extension, right (control) click on Main and choose Run as... then Java Application.

This extension uses the same base code as the filter extension.

• The Picture class is a Sedgewick class. The coordinates are expressed using the standard in computer science graphics: the coordinate (x,y) denotes the pixel that is

• x pixels to the right of the leftmost edge of the picture
• y pixels down from the top edge of the picture

Thus, (0,0) is the top left corner of the picture.

• Pixel addressing follows the common Java convention: if there are w horizontal pixels, then 0 is the first (leftmost) and w-1 is the last (rightmost).

• Almost all of the methods are written in terms of two Picture parameters:

• source: the picture to be used as input to your transformation
• target: the picture area to be used as output from your transformation

There is just one exception: the gradient method produces its output without needing a source. Its only parameter is target.

• Each Picture has a width and a height, and these can be obtained for a Picture p as follows:

  int width  = p.width();
int height = p.height();

• To find the Color of a pixel at location x, y, you use

 Color c = source.get(x,y);

• To set the Color of a pixel at location x, y to the color c, you use

  target.set(x,y,c);

## Instructions

Each of the methods described below is found in the Transforms class.

1. The provided method flipHoriz(Picture source, Picture target) flips the image horizontally.

Look at the code given to you for this example carefully. It is broken into simple steps and the comments help explain why the pixel indexing works.

2. Complete the method flipVert(Picture source, Picture target) that flips the image vertically.

3. Complete the method flipHorizLeftHalf(Picture source, Picture target) that flips the left half of the image horizontally.

The left half of the target image should be same as the source, but the right half of the target image should be the mirror of the left half of the source.

4. Complete the method flipVertBotHalf(Picture source, Picture target) that flips the bottom half of the image vertically.

5. Complete the method gradient(Picture target) that takes a single Picture as a parameter.

Your code should create a color gradient by computing the following for each pixel:

• The amount of red in each pixel increases gradually from 0 at the left edge of the image to 255 at the right edge of the image.
• The amount of green in each pixel increases gradually from 0 at the top edge of the image to 255 at the bottom edge of the image.
• The amount of blue in every pixel should be 128.

Thus, each pixel will have a different color depending on its position. For example, the pixel at the top left will have red=0, green=0, and blue=128. The pixel about 1/4 of the way down on the right edge will have red=255, green=64, and blue=128.

Develop an expression for the amount of red and green in each pixel, given the x and y position of that pixel and the width and height of the image:

 int amountRed   = .....
int amountGreen = ....

Then set the pixel at (x,y) to a color based on those computations:

target.set(x, y, new Color(amountRed, amountGreen, 128));`


text:
# Uncovering “Nondiscernible” Differences: Empirical Research and the Jury-Size Cases

My point is not that verdict differences associated with jury size cannot be revealed through careful empirical investigation. Indeed, at several places in this article I will suggest research strategies likely to reveal such differences. Rather, it is that typical strategies of legal-impact research, such as those utilized in the Colgrove real-world studies, are unlikely to uncover differences associated with jury size however well they control for those plausible rival hypotheses that form the usual threats to the validity of impact research. The reason lies in the unamenability of the jury-size problem to the usual techniques of aggregate data analysis.


text:
# Crocheted Hyperbolic Planes

Two posts ago, I described my wonderful visit to the Double Helix STEAM school in Athens GA. My goal was to explore hyperbolic planes with the students. They can be hard to understand and visualize, so I thought I’d write another post with some further musings.

Take a piece of paper, and place the it on a flat surface like a table (or wall or board, or something). Notice that each point on the paper is above exactly one point on the table. Now take a ball (or something round – like the top of your head). Try do do the same thing with the paper. What do you notice?

You will notice that the paper needs to be creased in order for it lie smoothly against the ball. If you want to have exactly one point on the paper above one point on the ball, then you will need to remove some paper. The crocheted hyperbolic plane shown above is the exact opposite. There is “too much” plane for the paper. In order to have exactly one point on the paper above one point on the hyperbolic plane, then more paper needs to be added.

It is this idea of removing and adding paper that allows us to construct  paper models which approximate spheres and hyperbolic planes. The plane can be thought of as being tiled by hexagons, like a honeycomb. Now, replace one of the hexagons with a pentagon. If you keep doing this in the right way, you’ll end up with a soccer ball shown on the left below. There, each pentagon is surrounded by hexagons. Since hexagons have been “removed” (in comparison with the planar honeycomb), the surface curves inwards and around creating a spherical shape. If, on the other hand, you replace a pentagon with a heptagon (7-sides) and surround it by hexagons, then “extra” hexagons have been added.  The surface will open up and will approximate a hyperbolic plane, as shown below on the right.

The mathematical notion of intrinsic curvature is what lies behind these shapes. Spheres have positive curvature, planes are flat (zero curvature), and hyperbolic planes have negative curvature.  Many people have written wonderful explanations of these ideas. I’d like to just focus on just one consequence. At the end of this post I’ve included a list of resources where you can read more.

Let’s start by thinking about flat surfaces and traditional Euclidean geometry which we all learned (and forgot!) in school. There we learned that the angle sum of the interior angles of a triangle is $$180^\circ$$. That is $$\angle A+ \angle B + \angle C=180^\circ$$, as shown on the right in the figure below. In order to understand what happens on other surfaces, we need to understand triangles. These are geometric figures where three points, the vertices, have been joined by three straight-lines or geodesics.

On the sphere, it turns out that “straight lines”, or geodesic lines, are sub-arcs of great circles. These are circles formed by the intersection of the sphere with a plane through the center of the sphere. For example, if we think of the earth as a sphere, then the equator and lines of longitudes are all examples of geodesic lines. However the other lines of latitude are not geodesic lines, since they are the intersection of the sphere/earth with planes that do not go through the center of the sphere. In the figure above, you can see a spherical triangle with one side part-way around the equator and the other two from the north pole to the equator. Angles $$\angle A$$ and $$\angle C$$ are both $$90^\circ$$, and $$\angle B$$ is also $$90^\circ$$. This means that $$\angle A + \angle B + \angle C = 270^\circ>180^\circ$$! Indeed, for any spherical triangle the sum of the interior angles is bigger than $$180^\circ$$, that is $$\angle A + \angle B + \angle C >180^\circ$$.

Can you see that the red spherical triangle bounds two areas? (One smaller obvious one, and the larger one on the rest of the sphere.) Can you work out what is the largest possible sum of interior angles of a spherical triangle? It turns out that small spherical triangles approximate planar triangles, so their interior angle sum is close to, but still greater than $$180^\circ$$.

What about hyperbolic triangles? Turns out you can create them on a  crochet model by sewing straight lines for the triangle sides, as shown on the left.  Hyperbolic triangles are “skinny”; the sum of the interior angles is less than $$180^\circ$$. In the triangle shown below, you can clearly see the interior angles are small and their sum is much less than $$180^\circ$$. As in the spherical case, small hyperbolic triangles are approximately planar; here the interior angle sum is close to, but still smaller than $$180^\circ$$. Amazingly, the area of hyperbolic triangles whose vertices approach infinity is finite. The proof of this result can be found in any undergraduate textbook on hyperbolic geometry.

I promised to include some references, and here they are.

Two of my favorite undergraduate texts include:

Post Script: When crocheting these hyperbolic planes I weighed out three balls of the same yarn in different colors. Since the length of yarn was approximately the same, the number of crochet stitches were approximately the same, and hence the area made was the same.  Pretty amazing to think that the blue area and the green area around the edge are the same! It just shows how much extra fabric is created as the hyperbolic plane is crocheted.

# Flowers everywhere

In early May, the IQ center at W&L was filled with 3D-printed flowers. Dave Pfaff and his work study students printed flowers in many bright colors on the Cura 3D printer. They are from Super Flowers found on Thingiverse. The fine filaments are created by printing in the air. That’s right, the printer puts down a single layer of material, then returns to the center. Since there are no supports underneath, a “droop-loop” of filament is created.

The vases were also designed by Dave Pfaff. He started with a flower shape on the base, then expanded and twisted the shape around creating the vase shape we see. Fabulous work!


text:
# parameter tuning using nested cross validation

Parameter tuning in SVM has been performed using a nested cross-validation(CV) approach with 45 folds(outer loop) and 13 folds(inner loop). In this process, the outer loop will have 45 prediction tasks with a chosen best value for C from the inner loop. I have taken the values 0.5, 5, 50, 500 for tuning the parameter C and observed that F1-score was highest 34 times for value 5, 6 times for value 50, 5 times for value 500.

Would it be a good idea to test the model on an external dataset(not involved in nested CV) with value 5 for C(highest frequent best value) ?

PS: as you are only tuning C I'm assuming you are using a linear kernel?