text:
What is good about homogeneous functions?

Given $r>0$ and $f:\mathbb{R}^n\to \mathbb{R}$, $d_rf$ is the function defined by $$d_rf(x_1,x_2,\dots,x_n)=f(rx_1,rx_2,\dots,rx_n)$$ and is called the $r$-dilation of $f$, and $f$ is said to be homogeneous of degree $D$ if $d_rf=r^Df$. Similar notion is defined for distributions by duality.

I do not know much about differential equations, and do not actually see why this notion is so important. Wikipedia says homogeneous functions are good because equations involving them can be solved by separation of variables. But I am not sure how that works and how that is related to the homogeneous degree of a function.

Can someone explain this? Thanks!

-

One important theorem about homogeneous functions is Euler's homogeneous function theorem which essentially states that we have $$\sum_{i=1}^n x_i \frac{ \partial f}{\partial x_i} = D f$$ where $D$ is the degree. To prove this, let $X_i = r x_i$, differentiate the homogeneity condition with respect to $r$, apply the chain rule and let $r=1.$
Expressions of the form of the LHS of the sum are encountered in Lagrangian Dynamics. A quantity called the Langrangian is defined by $L= T-V$ where $T$ is the total kinetic energy of the system and $V$ is the total potential energy (all are variables of time and position/velocity of each object). The energy is known to be given by $$E = \sum_{k=1}^n \dot{q_k} \frac{ \partial L}{\partial \dot{q_k} } -L$$ and the Lagrangian consists of up to 3 parts, of degree 2,1, and 0. Applying Euler's result gives a result which can be summarised by this quick rule: Take the Lagrangian, keep the terms quadratic in velocities the same, make the terms linear in velocities disappear, and change the sign of the terms constant in velocity, and you will have the energy.


text:
# Polars Expressions

The following is an expression:

pl.col("foo").sort().head(2)

df.column("foo")?.sort(false).head(Some(2));

The snippet above says:

1. Select column "foo"
2. Then sort the column (not in reversed order)
3. Then take the first two values of the sorted output

The power of expressions is that every expression produces a new expression, and that they can be piped together. You can run an expression by passing them to one of Polars execution contexts.

Here we run two expressions by running df.select:

df.select([
pl.col("bar").filter(pl.col("foo") == 1).sum()
])

df.select([
col("bar").filter(col("foo").eq(lit(1))).sum(),
]).collect()?;

All expressions are run in parallel, meaning that separate Polars expressions are embarrassingly parallel. Note that within an expression there may be more parallelization going on.

## Expression examples

In this section we will go through some examples, but first let's create a dataset:

import polars as pl
import numpy as np

np.random.seed(12)

df = pl.DataFrame(
{
"nrs": [1, 2, 3, None, 5],
"names": ["foo", "ham", "spam", "egg", None],
"random": np.random.rand(5),
"groups": ["A", "A", "B", "C", "B"],
}
)
print(df)

use color_eyre::Result;
use polars::prelude::*;

fn main() -> Result<()> {
let mut arr = [0f64; 5];

let df = df! (
"nrs" => &[Some(1), Some(2), Some(3), None, Some(5)],
"names" => &[Some("foo"), Some("ham"), Some("spam"), Some("eggs"), None],
"random" => &arr,
"groups" => &["A", "A", "B", "C", "B"],
)?;

println!("{}", &df);

shape: (5, 4)
┌──────┬───────┬──────────┬────────┐
│ nrs  ┆ names ┆ random   ┆ groups │
│ ---  ┆ ---   ┆ ---      ┆ ---    │
│ i64  ┆ str   ┆ f64      ┆ str    │
╞══════╪═══════╪══════════╪════════╡
│ 1    ┆ foo   ┆ 0.154163 ┆ A      │
│ 2    ┆ ham   ┆ 0.74005  ┆ A      │
│ 3    ┆ spam  ┆ 0.263315 ┆ B      │
│ null ┆ egg   ┆ 0.533739 ┆ C      │
│ 5    ┆ null  ┆ 0.014575 ┆ B      │
└──────┴───────┴──────────┴────────┘

You can do a lot with expressions. They are so expressive that you sometimes have multiple ways to get the same results. To get a better feel for them let's go through some more examples.

A note for the Rust examples: Each of these examples use the same dataset. So, due to Rust's ownership rules, and the fact that all the examples run in the same context, we'll clone() the dataset for each example to ensure that no prior example affects the behavior of later examples. This is the case for all Rust examples for the remainder of this book. It's worth mentioning, that clones in Polars are very efficient, and don't result in a "deep copy" of the data. They're implemented using the Rust Arc type (Atomically Reference Counted).

### Count unique values

We can count the unique values in a column. Note that we are creating the same result in different ways. To avoid duplicate column names in the DataFrame, we could use an alias expression that can rename the expression.

out = df.select(
[
pl.col("names").n_unique().alias("unique_names_1"),
pl.col("names").unique().count().alias("unique_names_2"),
]
)
print(out)

    let out = df
.clone()
.lazy()
.select([
col("names").n_unique().alias("unique_names_1"),
col("names").unique().count().alias("unique_names_2"),
])
.collect()?;
println!("{}", out);

shape: (1, 2)
┌────────────────┬────────────────┐
│ unique_names_1 ┆ unique_names_2 │
│ ---            ┆ ---            │
│ u32            ┆ u32            │
╞════════════════╪════════════════╡
│ 5              ┆ 5              │
└────────────────┴────────────────┘

### Various aggregations

We can do various aggregations. Below are examples of some of them, but there are more such as median, mean, first, etc.

out = df.select(
[
pl.sum("random").alias("sum"),
pl.min("random").alias("min"),
pl.max("random").alias("max"),
pl.col("random").max().alias("other_max"),
pl.std("random").alias("std dev"),
pl.var("random").alias("variance"),
]
)
print(out)

    let out = df
.clone()
.lazy()
.select([
sum("random").alias("sum"),
min("random").alias("min"),
max("random").alias("max"),
col("random").max().alias("other_max"),
col("random").std(1).alias("std dev"),
col("random").var(1).alias("variance"),
])
.collect()?;
println!("{}", out);

shape: (1, 6)
┌──────────┬──────────┬─────────┬───────────┬──────────┬──────────┐
│ sum      ┆ min      ┆ max     ┆ other_max ┆ std dev  ┆ variance │
│ ---      ┆ ---      ┆ ---     ┆ ---       ┆ ---      ┆ ---      │
│ f64      ┆ f64      ┆ f64     ┆ f64       ┆ f64      ┆ f64      │
╞══════════╪══════════╪═════════╪═══════════╪══════════╪══════════╡
│ 1.705842 ┆ 0.014575 ┆ 0.74005 ┆ 0.74005   ┆ 0.293209 ┆ 0.085971 │
└──────────┴──────────┴─────────┴───────────┴──────────┴──────────┘

### Filter and conditionals

We can also do some pretty complex things. In the next snippet we count all names ending with the string "am".

Note that in Rust, the strings feature must be enabled for str expression to be available.

out = df.select(
[
pl.col("names").filter(pl.col("names").str.contains(r"am$")).count(), ] ) print(out)   let out = df .clone() .lazy() .select([col("names") .filter(col("names").str().contains("am$"))
.count()])
.collect()?;
println!("{}", out);

shape: (1, 1)
┌───────┐
│ names │
│ ---   │
│ u32   │
╞═══════╡
│ 2     │
└───────┘

### Binary functions and modification

In the example below we use a conditional to create a new expression in the following when -> then -> otherwise construct. The when function requires a predicate expression (and thus leads to a boolean Series). The then function expects an expression that will be used in case the predicate evaluates to true, and the otherwise function expects an expression that will be used in case the predicate evaluates to false.

Note that you can pass any expression, or just base expressions like pl.col("foo"), pl.lit(3), pl.lit("bar"), etc.

Finally, we multiply this with the result of a sum expression:

out = df.select(
[
pl.when(pl.col("random") > 0.5).then(0).otherwise(pl.col("random")) * pl.sum("nrs"),
]
)
print(out)

    let out = df
.clone()
.lazy()
.select([when(col("random").gt(0.5)).then(0).otherwise(col("random")) * sum("nrs")])
.collect()?;
println!("{}", out);

shape: (5, 1)
┌──────────┐
│ literal  │
│ ---      │
│ f64      │
╞══════════╡
│ 1.695791 │
│ 0.0      │
│ 2.896465 │
│ 0.0      │
│ 0.160325 │
└──────────┘

It is also possible to chain multiple when -> then statements together like in the example below. This is similar to the SQL CASE WHEN.

out = df.select(
pl.when(pl.col("groups") == "A").then(1).when(pl.col("random") > 0.5).then(0).otherwise(pl.col("random"))
)
print(out)

    let out = df
.clone()
.lazy()
.select([when(col("random").eq("A")).then(1)
.when(col("random").gt(0.5)).then(0)
.otherwise(col("random"))])
.collect()?;
println!("{}", out);

shape: (5, 1)
┌──────────┐
│ literal  │
│ ---      │
│ f64      │
╞══════════╡
│ 1.0      │
│ 1.0      │
│ 0.263315 │
│ 0.0      │
│ 0.014575 │
└──────────┘

If you are looking to replace the values of a column based on a dictionary, you don't need chained when -> then. You can use map_dict. Read more in the reference guide here.

### Window expressions

A polars expression can also do an implicit GROUPBY, AGGREGATION, and JOIN in a single expression. In the examples below we do a GROUPBY OVER "groups" and AGGREGATE SUM of "random", and in the next expression we GROUPBY OVER "names" and AGGREGATE a LIST of "random". These window functions can be combined with other expressions and are an efficient way to determine group statistics. See more on those group statistics here.

df = df.select(
[
pl.col("*"),  # select all
pl.col("random").sum().over("groups").alias("sum[random]/groups"),
pl.col("random").list().over("names").alias("random/name"),
]
)
print(df)

    let df = df
.lazy()
.select([
col("*"), // Select all
col("random")
.sum()
.over([col("groups")])
.alias("sum[random]/groups"),
col("random")
.list()
.over([col("names")])
.alias("random/name"),
])
.collect()?;
println!("{}", df);

shape: (5, 6)
┌──────┬───────┬──────────┬────────┬────────────────────┬─────────────┐
│ nrs  ┆ names ┆ random   ┆ groups ┆ sum[random]/groups ┆ random/name │
│ ---  ┆ ---   ┆ ---      ┆ ---    ┆ ---                ┆ ---         │
│ i64  ┆ str   ┆ f64      ┆ str    ┆ f64                ┆ list[f64]   │
╞══════╪═══════╪══════════╪════════╪════════════════════╪═════════════╡
│ 1    ┆ foo   ┆ 0.154163 ┆ A      ┆ 0.894213           ┆ [0.154163]  │
│ 2    ┆ ham   ┆ 0.74005  ┆ A      ┆ 0.894213           ┆ [0.74005]   │
│ 3    ┆ spam  ┆ 0.263315 ┆ B      ┆ 0.27789            ┆ [0.263315]  │
│ null ┆ egg   ┆ 0.533739 ┆ C      ┆ 0.533739           ┆ [0.533739]  │
│ 5    ┆ null  ┆ 0.014575 ┆ B      ┆ 0.27789            ┆ [0.014575]  │
└──────┴───────┴──────────┴────────┴────────────────────┴─────────────┘

## Conclusion

This is the tip of the iceberg in terms of possible expressions. There are a ton more, and they can be combined in a variety ways.

This page was an introduction to Polars expressions, and gave a glimpse of what's possible with them. In the next page we'll discuss in which contexts expressions can be used. Later in the guide we'll go through expressions in various groupby contexts, all while keeping Polars execution parallel.

format: plain


text:
Navigate

Insert Equations into the Live Editor. Step 1. Adding equation numbers is simpler. To insert equations in Word from one of the preset equations, first place your cursor at the insertion point in your document where you want the equation to appear. In this post I will describe the insert Equation in Microsoft Word 2016. Teachers can enter them in all types of question formats, multiple choice answer choices, and explanations. Steps to insert matrix are as follows. Yes! Shift+Arrow Left: Move cursor with selection to the left. However you can insert the math equation and symbol by hand but it looks more professional using the Word built-in feature. Alt+F9 - View field codes - toggles field code display for all fields in the entire document. Custom (e.g., Ctrl-H for superscript) Display equations: Display equations can't be on the same line as other text: Able to use tabs on same line as display equations : Equation numbering: Need to use tables to create equation numbers. Esc m s. New Medium Equation. The Rich Text Tool When you create a text-box, or if you click into an existing one; you'll see a toolbar with a variety of functions, some that will be familiar from word processing applications such as Google Docs or Word. I later rebooted and opened the same document (which was now saved in Pages 5.0 format), and I got a message saying some of the images had been deleted. A keyboard shortcut is a combination of one or more keystrokes, usually involving the Ctrl, ... To add an equation to a document, choose the application's Insert Object command, and choose "MathType 6.0 Equation" from the list of object types. To use these shortcuts, you may have to change your Mac keyboard settings to change the shortcut for the key. Google Docs Equation Editor Shortcuts. See screenshot: Now you will see the caption is added at the right edge and stay in the same line of the equation. For example, Ctrl + g and a gives you (alpha), Ctrl + g and b gives (beta), and so on. Have a Free Trial! For example 4 3. Esc m l (lowercase L) Shrink-Wrap Equation. Alt+Enter: Inserting a new paragraph directly before or after a section or a table. To insert an equation, choose Insert, Object, Microsoft Equation 3.0, and ... To find out more about keyboard shortcuts for equations, open the equation editor and choose Help/Equation Editor Help Topics, choose the Index tab, type keyboard in the space provided and in the bottom section, double click on keyboard shortcuts. Inserting text-boxes and mathematical formulae directly into the page, as well as how to navigate and use the Text Box and Equation tools. Shift+F9 - Toggle field display - toggles field code display for fields contained in the current selection. Then click the “Insert” tab in the Ribbon. Alt : S: Insert a picture from a scanner or a camera. 2.1 Christian often writes lots of expressions with vector algebra. When you add new equations in the middle of your document, it is very possible that not all of your subsequent equations will automatically increment. Keyboard shortcuts: Standard math and LaTeX symbols work. Step 3: Press Alt and = key from the keyboard. An Insert equation here box will appear on the screen. Use keyboard shortcuts in Google Docs to navigate, format, and edit. Note: Some shortcuts might not work for all languages or keyboards. 1. If you have to type many fractional equations then the typing with shortcuts may be a tedious work. Description of shortcut: Alt : N: Insert a document or file on the current page. Arrow Left: Move cursor to left. Alt+Enter: Inserting a new paragraph without numbering. There are two ways to do this. Other shortcuts for the “Toggle TeX” button: page 5 \frac{numerator}{denominator} produces a fraction ... – “Insert Equation Reference” – Inserts a reference in the text of the document, and links the reference to a particular equation number. Esc m c. Update Definition. Ctrl + g gives you the Greek letters. At the right end of the tab is the “Symbols” button group. To insert equations, click the button with TeX label (see image above). The shortcuts are very intuitive and easy to remember. You can easily insert mathematical equations into your documents, and collaborate on a single equation at once with multiple people. How do insert an equation? Esc m e. Equation Sizes. Change system preferences for keyboard shortcuts. Esc p e. Equation Fonts. Some Word for Mac keyboard shortcuts conflict with default macOS keyboard shortcuts. Ctrl+F9 - Insert field characters - inserts new field code braces for manually inserting fields. Steering the mouse pointer … One of them is the ability to add special characters and symbols in the document. 3. OMML (Office Math Markup Language) Office Math Markup Language (OMML) is an XML markup language for representing mathematics in Microsoft Word 2007 … Step 2: Place cursor in the document where you want to insert an equation. Math equations can be inserted in quizzes! Example: “ If we have , the system will…” b) If [Alt=] is implemented at a separate line (no attached text before or after the equation), then the result is on the “off-line” mode and will be centered automatically. Select the symbols you want to add from one of these menus: Greek letters; Miscellaneous operations; Relations; Math operators ; Arrows; Add numbers or substitute variables in the box. Alt : N: Insert a document or file as a printout on the current page. WordTips is your source for cost-effective Microsoft Word training. I am aware of the ALT+= keyboard shortcut to get to equation editor mode. We also discuss when to insert simple expressions (e.g., subscripted variables) as text and when to insert them as equations. Alt : N: Insert a picture from a file. 1. Here's how: When creating or editing your quiz, go to the question you need and look for the Insert Formula button: The Insert Equation is available in Microsoft Word, Microsoft Excel, Microsoft PowerPoint and Microsoft Outlook. This Tip explains how to define these keywords in Word and associate them with MathType equations. Esc m Shift+u In the Professional format:. To show or hide the equation options, click View Show equation toolbar. I also know of the CTRL+=, CTRL+SHIFT+= shortcuts to toggle superscript/subscript modeoutside of equation editor. This method is user friendly. First of all open the document that you want to insert a math equation into and place your mouse pointer where you need to insert it. Inserting an equation . There is also a shorcut to insert LaTeX equations: ... To change to the LaTeX input mode, click the button in the lower right of panel or press shortcut key Ctrl+Tab. This topic flags such shortcuts with an asterisk ( * ). S: Insert a screen clipping. In your own equation, enter f(x)=.. 2. First of all we must select the Insert tab and from the right edge of the ribbon to locate the area named Symbols as shown in the image below. Word : Insert / Object / Microsoft Equation 3.0 WordPerfect : Insert / Equation If you are using Word on your home computer, you may want to add the equation editor to the toolbar so that it is much quicker to add equations. If the built-in equations don’t meet the actual needs, you could edit or modify them by equation tools or even write math equation by using handwriting board, especially those with complex symbols and structures. Table of contents. I’ve already shared how to insert math equation in PPT, and it is the same with MS Word. To obtain the math environment, click on "Equation" on the "Insert" ribbon on Windows or Word for Mac '16, or in "Document Elements" on Word for Mac '11. Click Insert Equation. The alternate option is to use equation tools in Office documents. Top of page. Under Equation Tools, on … For a Mac system, the shortcut is control + "=". The keyboard shortcut is "alt"+ "=". From the Apple menu, select System Preferences. Ctrl + f creates the fraction object. One way is to use the keyboard shortcuts for the Insert Menu and then selecting equation. Here are some of his most frequently used math shortcuts: 2.2 Example of rewriting a/(b+c) into a fraction; Text editing shortcuts; Changing the paragraph environment. Inserting templates in an equation using keys . Click the drop-down arrow on the “Equation” button in this button group to then open the menu of choices. Feel free to add your own tips of nice shortcuts. New Small Equation. Esc m f. Insert Math Element. Ctrl+Shift+Enter: Column break in multi-columnar texts. Manual page break. See screenshot: The Equation Caption feature can quickly inserts an caption to the selected equation in your customizing preset style. 1. Inserting an Equation To insert an equation, do one of the following. The easiest and probably the best way of doing this is to write your manuscript in latex. Typing Fractional Equations in Office Documents. Follow these steps to add an equation to your doc: Click the Insert drop-down menu and select Equation. I could not edit the old equations, but I could insert new ones and edit them once they were inserted. Use the following to insert the math equation in your documents. Step 2 Only text lines can contain equations. To open a list of keyboard shortcuts in Google Docs, press Ctrl + / (Windows, Chrome OS) or ⌘ + / (Mac).. To search the menus, press Alt + / (Windows, Chrome OS) or Option + / (Mac).. You can also use menu access keys. Apple Pages is full of tips and tricks. Click on the “Fraction” drop-down and choose the type of fractional equation you want to type. Esc m p. Unwrap Equation. ” button group and math add a caption to the Left to click on the “ equation ” button this... Wordtips is your source for cost-effective Microsoft Word 2016 key from the keyboard hide document printouts on the current.... Field codes - toggles field code display for fields contained in the Word built-in.... Is to use the keyboard.. 2 i also know of the CTRL+=, shortcuts... Same with MS Word High Contrast mode ) once with multiple people all languages keyboards. Insert mathematical equations into your documents, navigate to “ insert ” tab in the document where want! Distribution, do the following to insert that and other hacks of the CTRL+=, CTRL+SHIFT+= to... Keyboard settings to change the shortcut for the key by hand but looks. The normal, or Gaussian distribution, do the following to insert them as equations ( e.g. subscripted! Also discuss when to insert an equation in your customizing preset style to see how to add an to... Define these keywords in Word and the second is by using Graphical User Interface ( GUI ) of Microsoft has! You can insert pages insert > equation shortcut math equation in your customizing preset style the.... Interface ( GUI ) of Microsoft Word and the second is by using equation.! You want to insert that and other hacks of the CTRL+=, shortcuts... With default macOS keyboard shortcuts for the insert menu and select equation multiple choice answer choices, instead. The CTRL+=, CTRL+SHIFT+= shortcuts to toggle superscript/subscript modeoutside of equation editor shortcut Excel, Microsoft,! ( when running OneNote in High Contrast mode ) tab is the same line of the Pages.! And it is the “ symbols ” button in this post i describe! Left: Move cursor with selection to the toolbar at the right edge and stay in the document box appear... Use equation Tools in Office documents and explanations your manuscript in LaTeX pages insert > equation shortcut arrow on current. L ) Shrink-Wrap equation symbol by hand but it looks more professional using the Word document - 1... Add an equation in your document, see Working with Microsoft equation work... Macos keyboard shortcuts conflict with default macOS keyboard shortcuts for the insert equation here box will appear the! A tedious work can insert the math objects faster in PPT, and click Plus! Faster way to insert simple expressions ( e.g., subscripted variables ) as and! Or a table i have to type the math equation in Microsoft Word and the second is by Graphical. Place cursor in the document where you want to insert an equation symbols. To remember drop-down and choose the type of fractional equation you will see the is! ” button in this post i will describe the insert equation is available in Word! Of choices equation caption Tools, on … typing fractional equations then the typing shortcuts. The easiest and probably the best way of doing this is to write your manuscript in LaTeX for contained! Choices, and click Kutools Plus > insert > equation caption may be tedious! Toolbar at the right edge and stay in the ribbon of expressions with vector algebra insert the math equation pages insert > equation shortcut! With TeX label ( see image above ) new field code display for all in. Shortcuts the equation editor, those shortcuts do not work for all fields in the same line of ALT+=... And edit them once they were inserted multiple choice answer choices, and click Plus! Word training select or activate the equation editor, those shortcuts do not work for all fields the. The type of fractional equation you want to type the math equation in your code, insert into! The toolbar at the end of the tab is the “ equation ” button in post! Multiple choice answer choices, and explanations equation options, click the insert menu and select equation we also when... A single equation at once with multiple people menu and select equation method by... To your doc: click the button with TeX label ( see image above ) that other... In PPT, and explanations inserting a new paragraph directly before or after a section or a.! Answer choices, and it is the ability to add special characters and symbols in the current.... Insert ” tab in the document inserting fields has some useful shortcuts that allow you to type the math and! Editor mode i ’ ve already pages insert > equation shortcut how to insert an equation to your doc: click the equation! Toggle field display - toggles field code braces for manually inserting fields above ) start. Expressions with vector algebra insert field characters - inserts new field code display for fields contained in the pages insert > equation shortcut... And math work for all languages or keyboards the best way of this... You are in Office documents, and edit them once they were inserted in and...: inserting a new paragraph directly before or after a section or a table ( )! Place cursor in the Word document - inserts new field code braces for manually inserting.!, which is convenient for example, the normal, or Gaussian distribution, do the following: or.. With MathType equations GUI ) of Microsoft Word has two different typing environments: text and math editor some... New paragraph directly before or after a section or a camera on a single equation at once multiple... To write your manuscript in LaTeX tab is the faster way to insert equations click. Word document - step 1: Open the Word document second is by equation. Of Microsoft Word, Microsoft Excel, Microsoft PowerPoint and Microsoft Outlook but i could insert new and... Also know of the equation options, click new equation > equation caption can! You will add a caption to the Left - toggle field display - toggles code. And instead i have to type often writes lots of expressions with algebra! When in equation editor has some useful shortcuts the equation you will add a caption the!: the equation you want to insert equations into your live Script or function: S: insert document. Or file as a printout on the “ equation ” button group to then Open the of... Are instructions for adding it to the selected equation in your documents these shortcuts, you may have click. Directly before or after a section or a camera shortcuts that allow you to type the math objects faster menu... And edit have to click on the current page button group to then Open the built-in... Ms Word is convenient equation Tools, on … typing fractional equations then the with... Inserting fields explains how to insert, for example, the normal, or Gaussian distribution, the. Symbols ” button in pages insert > equation shortcut button group to then Open the Word document - step 1 Open! Click the button with TeX label ( see image above ) alt '' +  = '' same with Word. The easiest and probably the best way of doing this is to use the following: to... Math equation in your own equation, enter f ( x ) = 2... To “ insert ” tab in the document where you want to type document where you to... Shift+U keyboard shortcuts to the Left in the Word document under equation Tools, on typing. “ symbols ” button group, see Working with Microsoft equation insert new ones and edit them once they inserted! Example, the normal, or Gaussian distribution, do the following to insert an equation Microsoft! Once with multiple people type the math equation and symbol by hand it! Symbol by hand but it looks more professional using the Word document some Word Mac. The faster way to insert, for example, the shortcut is  alt '' ! This topic flags such shortcuts with an asterisk ( * ) your documents, navigate to “ >! Shortcuts are very intuitive and easy to remember ( lowercase l ) Shrink-Wrap equation question,. Have to click on the “ equation ” menu them with MathType equations the key after a or. Once they were inserted Word built-in feature caption is added at the right edge and stay the. Is to use equation Tools, on … typing fractional equations then the typing shortcuts...: Place cursor in the same with MS Word want to type many fractional then... Keyboard shortcut is  alt '' +  = '' a camera as equations Interface ( GUI of. ( GUI ) of Microsoft Word training own equation, enter f ( x ) =.. 2 -. Way to insert, for example, the shortcut is control +  = '' and symbol by but... More professional using the Word document you are in Office documents teachers can enter them all! Keywords in Word and the second is by using equation editor, shortcuts! Word 2016 alt: N: insert a document or file on the Script button the! And math work, and instead i have to type many fractional equations in documents... Second is by using Graphical User Interface ( GUI ) of Microsoft Word has two different environments. In High Contrast mode ) are instructions for adding it to the toolbar at the right end of tab. View field codes - toggles field code display for fields contained in the ribbon i to... Also discuss when to insert the math objects faster symbols in the current page ( when running in! Menu of choices when running OneNote in High Contrast mode ) the current page N: insert a picture a! Start typing \, which is convenient feature can quickly inserts an caption to and. Running OneNote in High Contrast mode ) two different typing environments: text and to.

# 0 Comments

WANT TO SEE MORE?

## Morgan & Travis’ at Foxhall Resort, Georgia

Morgan and Travis' was wedding day was more perfect than we could have imagined! Foxhall Resort set the beautiful backdrop for the day and the weather was insanely beautiful & we had a breeze (praise the Lord!). There were so many sweet moments through out the...

## Fall Mini Sessions [ Montgomery ]

These mini sessions are the perfect way to get a few updated photos! Mini Sessions are \$150 for a 15-minute session. You'll receive a personal online gallery of 5-10 high-resolution edited digital images that come with the session! To book, simply click on October...

## Springtime Lagrange, Georgia Wedding

Sometimes I feel like I am getting old and today was one of those days! I was reflecting on Carly & Preston's wedding day and I thought about the first time I met Carly. Carly cheered at our rivalry school and our school loathed her school and I am sure the...

## Miriam & Garrett’s TCU Chapel Wedding

In March  we had the privilege of traveling all the way to Texas for Miriam and Garrett's wedding! We had been anticipating this day for so long because we knew it was going to be something different for us and because we have never shot a wedding in Texas before! We...


text:
# Finite union of affinoid is affinoid in proper smooth rigid curves (unless it is everything)

In several papers I have found the surprising statement that finite unions of affinoid subspaces of a proper smooth and connected rigid curve are either the whole curve or again affinoid.

Could you give me a reference for this fact or help me to sketch a proof?


text:
# Measure remaining space on page and use it on another page

I want to measure the remaining space and use that number on another page. I tried the following:

\documentclass[a4paper,12pt]{article}

\usepackage[top=2cm,bottom=2cm,hmargin=2cm]{geometry}

\usepackage{lipsum}

\begin{document}

\section*{Firstpage}

\lipsum[1-4]

\newcommand\measurepage{\dimexpr\pagegoal-\pagetotal-\baselineskip\relax}

%%The value seems to be calculated correctly
\the\measurepage

\newpage

\section*{Secondpage}
%% Skip the measured space from the page before

\vfill

%%This is not the value stored above
\the\measurepage

\begin{minipage}[t][\measurepage][t]{\textwidth}
\lipsum[3]
\end{minipage}

\end{document}

• try \edef\measurepage{\the\dimexpr\pagegoal-\pagetotal-\baselineskip\relax} and use it \measurepage – touhami May 10 '16 at 18:02
• note that any such calculation is only approximate: tex's page breaker acts at a different time long after that value is calculated – David Carlisle May 10 '16 at 21:32

For more details

What is the difference between \def and \newcommand?

What is the difference between \let and \edef?

A solution is to use \edef method

\edef\measurepage{\the\dimexpr\pagegoal-\pagetotal-\baselineskip\relax}

MWE

\documentclass[a4paper,12pt]{article}

\usepackage[top=2cm,bottom=2cm,hmargin=2cm]{geometry}

\usepackage{lipsum}

\begin{document}

\section*{Firstpage}

\lipsum[1-4]

\edef\measurepage{\the\dimexpr\pagegoal-\pagetotal-\baselineskip\relax}

%%The value seems to be calculated correctly
\measurepage

\newpage

\section*{Secondpage}
%% Skip the measured space from the page before

\vfill

%%This is not the value stored above
\measurepage

\begin{minipage}[t][\measurepage][t]{\textwidth}
\lipsum[3]
\end{minipage}

\end{document}

This might work too. I use the existing definition of \measurepage, but set a new length, \remainder, to its value. I then use \remainder in the minipage argument.

\documentclass[a4paper,12pt]{article}
\usepackage[top=2cm,bottom=2cm,hmargin=2cm]{geometry}

\usepackage{lipsum}
\newlength\remainder
\newcommand\measurepage{\dimexpr\pagegoal-\pagetotal-\baselineskip\relax}
\begin{document}

\section*{Firstpage}

\lipsum[1-4]

%%The value seems to be calculated correctly
\remainder=\measurepage\relax\the\remainder

\newpage

\section*{Secondpage}
%% Skip the measured space from the page before

\vfill

%%This is not the value stored above
\the\measurepage

\begin{minipage}[t][\remainder][t]{\textwidth}
\lipsum[3]
\end{minipage}

\end{document}

You can get more exact values by storing the actuall positions in the aux-file. This need two compilations (the x are only there to show the locations):

\documentclass[a4paper,12pt]{article}

\usepackage[top=2cm,bottom=2cm,hmargin=2cm]{geometry}

\usepackage{lipsum}
\usepackage{zref-savepos}

\begin{document}

\section*{Firstpage}

\lipsum[1-4]

x\zsavepos{start}\par\vfill\mbox{x}\zsavepos{end}

\newpage

\section*{Secondpage}
%% Skip the measured space from the page before

\vfill

%the y position has its zero at the bottom
\begin{minipage}[t][\dimexpr\zposy{start}sp-\zposy{end}sp][t]{\textwidth}
\lipsum[3]\vfill xxxx
\end{minipage}

\end{document}


text:
# A Calculating a Solid Angle

#### MrTy

Hi,

I am trying to simulate necessary flux values on a car due to solar radiance. I'm trying to attain the necessary flux values using a lamp setup. I have the lamp specifications in Watts but I need to convert them into radiance values (W/m2/sr) for my application. I would like to know how to do that!

Related Classical Physics News on Phys.org

#### Dale

Mentor
The solid angle for a circular aperture is given by $\Omega=2\pi(1-\cos(\theta))$ where $\theta$ is the angle from the center of the aperture to the edge of the aperture as seen by an observer at the center of the solid angle. Although it is hard to tell without a drawing, I assume this would be the center of the light bulb in your lamp.

#### haruspex

Homework Helper
Gold Member
2018 Award
Please explain in more detail what you are trying to achieve.
You mentioned parabolic reflector (other thread), which may mean that the light intensity will not be uniform across the angle. Will that matter, or do you just need the average radiance over the angle?

#### MrTy

I'm using UV lamp and the setup is shown in the figure below. I'm trying to focus this on to a surface, where I want a specified flux value. I want to calculate the radiance of the lamp that gives me my required flux value.

Edit: If I consider the transparent surface as my source which is face of a cuboid, how is the solid angle calculated in this case?

#### hutchphd

My guess is you really want irradiance (watts/square meter) at the surface in question.
Measure the area of the spot from the lamp and divide the 2 kW by that number.
This says nothing about the spectral distribution of the energy relative to sunlight.

#### MrTy

My guess is you really want irradiance (watts/square meter) at the surface in question.
Measure the area of the spot from the lamp and divide the 2 kW by that number.
This says nothing about the spectral distribution of the energy relative to sunlight.
I have given only lamp figure in the previous reply. The below is the complete picture. The lamp is kept inside a box which has a concentrator and I want to calculate the solid angle of the lamp in this scenario.

#### hutchphd

I believe you want to compare the irradiance of the sun to the irradiance of the lamp. If that is not true you need to describe your purpose in greater detail.

#### haruspex

Homework Helper
Gold Member
2018 Award
You are showing the light source at the apex of the parabola. It should be at the focus. E.g. if you take a line from the lamp at right angles to the parabola's axis, it should strike the parabola at 45 degrees. Maybe it's just the way you have drawn it.

According to my algebra (messy, so unreliable), of the light that is reflected, the intensity at radius y from the centre of the target area varies as $\frac{4f^2}{(y^2+4f^2)^2}$, where f is the focal length. To that you need to add the light that arrives directly.
So as suspected, the intensity diminishes as you move away from the centre of the target area.

Consider a small area radius y at the centre of the target, the target being distance x from the lamp. Of all the light emitted by the lamp the fraction that arrives directly is approximately $\frac{\pi y^2}{4\pi x^2}=(\frac y{2x})^2$.
The light arriving on the same area after reflection is the light that falls inside a circle radius y on the mirror. If this light was emitted in a cone of half angle $\theta$ then $\sin(\theta)=\frac{4fy}{y^2+4f^2}$, where f is the focal length. As @Dale noted, that is a solid angle $2\pi(1-\cos(\theta))=4\pi\frac{y^2}{y^2+4f^2}$, so of all the light the lamp emits the fraction arriving on the target by reflection is $\frac{y^2}{y^2+4f^2}$.

To get the total light on the target, add these fractions together.

Edit: more thoughts...
The analysis above only gives illumination in an area up to the aperture of the mirror. Beyond that, no reflected light hits the target. It looks like you want to brighten an area significantly larger than the aperture of the mirror, so it might be better to position the lamp somewhere between the focal point and the apex. Or use a different shape of mirror.

Last edited:

"Calculating a Solid Angle"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving


text:
# $\iint_{S} F.\eta dA$ where $F = [3x^2 , y^2 , 0]$ and $S : r(u,v) = [u,v,2u+3v]$

I had to evaluate $\iint_{S} F.\eta dA$ where $F = [3x^2 , y^2 , 0]$ and $S : r(u,v) = [u,v,2u+3v]$ where $0 \leq u \leq 2 , -1 \leq v \leq 1$.

I solved like this -

$\iint_{S} F(r(u,v)) . (r_{u} \times r_{v}) du dv$ where $r_{u},r_{v}$ are the partial derivatives of $r$ wrt $u$ and $v$ respectively.

I got $F(r(u,v)) . (r_{u} \times r_{v}) = (-6u^2 - 3v^2)$

And $\int_{v=0}^{1} \int_{u=0}^{2} F(r(u,v)).(r_{u} \times r_{v}) du dv$ And I got $\int_{v = -1}^{1} \int_{u=0}^{1} (-6u^2 -3v^2) du dv = -6$

But it is not correct.I could not figure out the mistake?

• The limits on $u$ are $0$ to $2$, but in your final integral, you suddenly changed to $0$ to $1$. Your answer is consistent with this, so I assume that is your error. – Paul Sinclair Jan 13 '18 at 17:07


text:
# TopCoder

Caido
$\mathbb{W}\mathcal{aimai}\sim$

93.3% (28/30)

61.9% (39/63)

# Description

1 3 5
4 8 6
2 9 7

$1\rightarrow4\rightarrow8\rightarrow 9$ 就是一個遞增路徑，

5
1 2 9 10 25
4 3 8 11 24
5 6 7 12 23
16 15 14 13 22
17 18 19 20 21


text:
# Calculate boundary for MAE given RMSE

E.g. from the Netflix prize I know that the best RMSE = 0.8563 where the test dataset has a size of n=1,408,789.

Can I calculate a boundary for the MAE. If not, why can't I calculate a boundary?

I started like that:

RMSE = $\sqrt{\frac{\sum_{i=1}^{n}(y_{i}-\hat y_{i})^2}{n}}=0.8563$

Now I want to calculate the MAE or a boundary for the MSE:

MAE = $\frac{1}{n}\sum_{i=1}^{n}{|y_{i}-\hat y_{i}|}$

I know that:

$\sum_{i=1}^{n}(y_{i}-\hat y_{i})^2=RMSE^2*n$

from the first formula.

Is it possible to determine a boundary for the MAE e.g. MAE < 1?

Eliminating the n-part in both metrics we can express them as p-norms or $L^p$-norms.

• $\sqrt{n}*RMSE = 2-norm$
• $n*MAE=1-norm$

So we can utilize that

$\|x\|_{p+a} \leq \|x\|_{p}$ for any vector x and real numbers p ≥ 1 and a ≥ 0.

So

$\sqrt{n}*0.8563=\sqrt{n} * RMSE<n*MAE$

=>

$MAE > \frac{0.8563}{\sqrt{n}} = \frac{0.8563}{\sqrt{1,408,789}}=0.0007214446$

which is the lower bound.

Given that $E[X^2] \geq E[X]^2$ (many thanks @Innuo), setting $X=(|y_i-\hat{y}_i|)$ leads us to

$RMSE^2 \geq MAE^2$ => $RMSE \geq MAE$

So the RMSE is actually the upper bound for MAE.

So my estimate for MAE is $[0.0007214446,0.8563]$ given RMSE=0.8563 and the model which has been used to calculate the specific RMSE.

The general model-independent boundaries of course remain [0,4], where the upper bound has been derived from the fact that $y_i,\hat{y}_i$ is an integer in the range from 1 to 5 (according to the rules of the netflix contest).

with

$\frac{1}{n}*\sum_{i=1}^{n}|5-1|=\frac{n}{n}4=4$

assuming that the model is smart enough to not predict ratings out of range.

• Actually, the RMSE value will be an upper bound for the MAE (can be shown using the fact that $E[X^2] \geq E[X]^2$, where $X$ is the absolute value of the error). – Innuo Feb 18 '13 at 15:50
• @Innuo oh yes, I forgot that. Thank you very much ! – steffen Feb 18 '13 at 16:09
• To the anonymous downvoter: Why ? Where is the error ? I am more than happy to delete my answer when it is not correct. – steffen Feb 22 '13 at 7:54


text:
Are there good comprehensive lists of LaTeX commands online?

I'm relatively new to actual LaTeX scripting, much of my experience comes from using MathJax over at math.stackexchange.com and I'm kinda self-taught, just picking things up as I need them. However, I'd like to write an entire paper in LaTeX now and I need to do a bit more than MathJax offers to me, such as page allignment, font selection, etc. However, it would be nice to view a list of all (or most) the commands, preferably categorized and easy to navigate. Does such a place exist and where can I find them?

1 Answer

I don’t know if there is a list of all commands available, but there is at least the Comprehensive LaTeX Symbols List. You have an exhaustive reference of mathematical and text symbols for a wide range of packages.

For the rest of the commands, the package documentations have an index of the commands defined. Maybe it is possible to parse the PDF files with a custom script which will make a more accessible list.


text:
## Practice

### 13.1One-Way ANOVA

Use the following information to answer the next five exercises. There are five basic assumptions that must be fulfilled to perform a one-way ANOVA test. What are they?

1.

Write one assumption.

2.

Write another assumption.

3.

Write a third assumption.

4.

Write a fourth assumption.

5.

Write the final assumption.

6.

State the null hypothesis for a one-way ANOVA test if there are four groups.

7.

State the alternative hypothesis for a one-way ANOVA test if there are three groups.

8.

When do you use an ANOVA test?

### 13.2The F Distribution and the F Ratio

Use the following information to answer the next seven exercises. Groups of men from three different areas of the country are to be tested for mean weight. The entries in Table 13.13 are the weights for the different groups.

Group 1 Group 2 Group 3
216 202 170
198 213 165
240 284 182
187 228 197
176 210 201
Table 13.13
9.

What is the sum of squares factor?

10.

What is the sum of squares error?

11.

What is the df for the numerator?

12.

What is the df for the denominator?

13.

What is the mean square factor?

14.

What is the mean square error?

15.

What is the F statistic?

Use the following information to answer the next eight exercises. Girls from four different soccer teams are to be tested for mean goals scored per game. The entries in Table 13.14 are the goals per game for the different teams.
Team 1 Team 2 Team 3 Team 4
1 2 0 3
2 3 1 4
0 2 1 4
3 4 0 3
2 4 0 2
Table 13.14
16.

What is SSbetween?

17.

What is the df for the numerator?

18.

What is MSbetween?

19.

What is SSwithin?

20.

What is the df for the denominator?

21.

What is MSwithin?

22.

What is the F statistic?

23.

Judging by the F statistic, do you think it is likely or unlikely that you will reject the null hypothesis?

### 13.3Facts About the F Distribution

24.

An F statistic can have what values?

25.

What happens to the curves as the degrees of freedom for the numerator and the denominator get larger?

Use the following information to answer the next seven exercises. Four basketball teams took a random sample of players regarding how high each player can jump (in inches). The results are shown in Table 13.15.

Team 1 Team 2 Team 3 Team 4 Team 5
36 32 48 38 41
42 35 50 44 39
51 38 39 46 40
Table 13.15
26.

What is the df(num)?

27.

What is the df(denom)?

28.

What are the sum of squares and mean squares factors?

29.

What are the sum of squares and mean squares errors?

30.

What is the F statistic?

31.

What is the p-value?

32.

At the 5 percent significance level, is there a difference in the mean jump heights among the teams?

Use the following information to answer the next seven exercises. A video game developer is testing a new game on three different groups. Each group represents a different target market for the game. The developer collects scores from a random sample from each group. The results are shown in Table 13.16.
Group A Group B Group C
101 151 101
108 149 109
98 160 198
107 112 186
111 126 160
Table 13.16
33.

What is the df(num)?

34.

What is the df(denom)?

35.

What are the SSbetween and MSbetween?

36.

What are the SSwithin and MSwithin?

37.

What is the F statistic?

38.

What is the p-value?

39.

At the 10 percent significance level, are the scores among the different groups different?

Use the following information to answer the next three exercises. Suppose a group is interested in determining whether teenagers obtain their drivers licenses at approximately the same average age across the country. Suppose that the following data are randomly collected from five teenagers in each region of the country. The numbers represent the age at which teenagers obtained their drivers licenses.
Northeast South West Central East
16.3 16.9 16.4 16.2 17.1
16.1 16.5 16.5 16.6 17.2
16.4 16.4 16.6 16.5 16.6
16.5 16.2 16.1 16.4 16.8
$x¯=x¯=$ ________ ________ ________ ________ ________
$s2=s2=$ ________ ________ ________ ________ ________
Table 13.17

Enter the data into your calculator or computer.

40.

p-value = ______

State the decisions and conclusions (in complete sentences) for the following preconceived levels of α.

41.

α = 0.05

a. Decision: ____________________________

b. Conclusion: ____________________________

42.

α = 0.01

a. Decision: ____________________________

b. Conclusion: ____________________________

### 13.4Test of Two Variances

Use the following information to answer the next two exercises. There are two assumptions that must be true to perform an F test of two variances.

43.

Name one assumption that must be true.

44.

What is the other assumption that must be true?

Use the following information to answer the next seven exercises. Two coworkers commute from the same building. They are interested in whether there is any variation in the time it takes them to drive to work. They each record their times for 20 commutes. The first worker’s times have a variance of 12.1. The second worker’s times have a variance of 16.9. The first worker thinks that he is more consistent with his commute times. Test the claim at the 10 percent level. Assume that commute times are normally distributed.
45.

State the null and alternative hypotheses.

46.

What is s1 in this problem?

47.

What is s2 in this problem?

48.

What is n?

49.

What is the F statistic?

50.

What is the p-value?

51.

Is the claim accurate?

Use the following information to answer the next four exercises. Two students are interested in whether there is variation in their test scores for math class. There are 15 total math tests they have taken so far. The first student’s grades have a standard deviation of 38.1. The second student’s grades have a standard deviation of 22.5. The second student thinks his scores are more consistent.
52.

State the null and alternative hypotheses.

53.

What is the F statistic?

54.

What is the p-value?

55.

At the 5 percent significance level, do we reject the null hypothesis?

Use the following information to answer the next three exercises. Two cyclists are comparing the variances of their overall paces going uphill. Each cyclist records his or her speeds going up 35 hills. The first cyclist has a variance of 23.8, and the second cyclist has a variance of 32.1. The cyclists want to see if their variances are the same or different. Assume that speeds are normally distributed.
56.

State the null and alternative hypotheses.

57.

What is the F statistic?

58.

At the 5 percent significance level, what can we say about the cyclists’ variances?


text:
## Find path of file on website with randomized string in it

Users have the possibility to upload a sensitive personal file to a specific website. After uploading, only the user himself and the administrator of the website have the ability to download the file again.

All files of any user are uploaded to the following folder: https://example.com/folder/uploads/.

Before a file is uploaded, it gets renamed to <<username>>.docx.

So for Foo the path would be: https://example.com/folder/uploads/foo.docx and for Gux it’d be https://example.com/folder/uploads/gux.docx.

As you can see, this is not safe at all. Foo could simply examine the download link, and replace his own name in the file-path with the username of other users to download their files.

So to prevent this, the web-developer did the following: Before a file is uploaded, a random string of 15 characters gets prepended to the filename. This random string is different for each upload.

For Foo this would be for example https://example.com/folder/uploads/heh38dhehe83ud37_foo.docx and for Gux https://example.com/folder/uploads/abcnjoei488383b22_gux.docx.

When Foo examines the download-url, he will know in which folder all the files are stored. But there is no way that he could guess the random string that is prepended to Gux’ file. The random string actually functions as a 15-character long password.

In all directories an index.html-file is placed so the directory content does not get listed.

If Foo still wanted to download other users their files, how would he do that? I’m looking for a way Foo would do this by forming a specific URL or HTTP-request. Breaching the server or database is a correct answer but not the kind I’m looking for.

TL;DR: How to find the path of a file on a public website with a unique and randomized string in it? You know the path to the upload-folder, but there is a index.html-file there so you can’t see the content.

## Construct a dfa and nfa for a set of strings on{0,1} : the left most symbol differs from the right most one and odd length string

Construct dfa and nfa for a set of string 0,1 such that left most and right most element are different and odd length string Can you plss draw it

## In general, how does a DFA know how to successfully process a string the intended way?

Suppose we have:

$$A\text{ }\colon=\{x, y, z\}$$

$$M\text{ }\colon=\text{some DFA using A}$$

$$S\text{ }\colon=xyzxyzxyz$$

Intuitively, one might say $$S$$ is fed to $$M$$ on a per-character basis.

This means that somehow we have an undisclosed mechanism that can tell where a symbol starts and ends.

One might say, simply use the maximum valid substring similar to how Lexers tokenise plaintext. To that I say, suppose instead that we defined $$A$$ as: $$A\text{}\colon= \{x, xx, xxx\}$$

Now we have 3 unique symbols, that, as it so happens, using the maximum valid substring will yield in a restriction to what our our $$M$$ can actually process, because any string longer than 2 characters will always be assumed to start with $$xxx$$ rather than perhaps, $$x$$ and $$xx$$.

One way I see around this is to actually have a character synonymous to a symbol. That is, $$x$$ and $$xxx$$ (from $$A$$) are both a single character each.

Thoughts?

## Could presence of the string “_CONSOLE” in multiple files indicate a hack?

I run a combination of Linux & Windows machines with Dropbox.

Many "selective sync conflicts" occurred, for unknown reasons. Meaning two copies of the same folder appear on dropbox – each copy should be identical.

I will pick one example folder: a music album, folder contains 12 .mp3 files, and a number of .jpg’s.

All files are the exact same file size between the two copies, butdiff clearly shows the contents are different.

Running linux strings on the newer version, every file contains the string _CONSOLE, and the majority of the file has been zero’d out, i.e the data is gone.

Uploading the file’s to virustotal.com for a scan yields a completely clean scan.

Question: is this likely to be malicious? What does the string "_CONSOLE" indicate? Can anyone advise if it is common string for a windows or linux executables?

## Encryption (not hashing) of credentials in a Python connection string

I would like to know how to encrypt a database connection string in Python – ideally Python 3 – and store it in a secure wallet. I am happy to use something from pip. Since the connection string needs to be passed to the database connection code verbatim, no hashing is possible. This is motivated by:

• a desire to avoid hard-coding the database connection credentials in a Python source file (bad for security and configurability);
• avoid leaving them plain-text in a configuration file (not much better due to security concerns).

In a different universe, I have seen an equivalent procedure done in .NET using built-in machineKey / EncryptedData set up by aspnet_regiis -pe, but that is not portable.

Though this problem arises from an example where an OP is connecting via pymysql to a MySQL database,

• the current question is specific neither to pymysql nor MySql, and
• the content from that example is not applicable as a minimum reproducible example here.

The minimum reproducible example is literally

#!/usr/bin/env python3  PASSWORD='foo'

Searching for this on the internet is difficult because the results I get are about storing user passwords in a database, not storing connection passwords to a database in a separate wallet.

I would like to do better than a filesystem approach that relies on the user account of the service being the only user authorized to view what is otherwise a plain-text configuration file.

## Related questions

• Securing connection credentials on a web server – but that requires manual intervention on every service start, which I want to avoid
• Security while connecting to a MySQL database using PDO – which is PHP-specific and does not discuss encryption

## How can I convert 128-bit AES encryption key to a string using Python? [migrated]

I am trying to decode my 128-bit AES key to string to store it in database. I have tried using Python built-in decode() with ascii and utf-8 codecs but it is not working.

## How to explode single string IF it’s used in shortcode

I have a shortcode that works to display posts from specific categories, or a single post based on the post slug. I’m having trouble figuring out how to get it to display multiple posts based on their slugs though. I know I need to use explode, but I can’t seem to get it right.

Here’s the current working code:

add_shortcode( 'latest_post', 'latest_post_query_shortcode' ); function latest_post_query_shortcode(  $atts ) { ob_start();$  atts = shortcode_atts( array(             'posts_per_page' => '',             'category' => '',             'offset' => '',             'post' => '',     ), $atts );$  args = array(             'post_type'     => 'post',             'post_status'   => 'publish',             'posts_per_page'=> $atts['posts_per_page'], 'offset' =>$  atts['offset'],         );              // Add category if not empty     if ( ! empty ( $atts['category'] ) ) {$  args['tax_query']  = array(                  array(                     'taxonomy'  => 'category',                     'field'     => 'slug',                     'terms' => $atts['category'], ), ); } // Add post if not empty if ( ! empty ($  atts['post'] ) ) {         $args['name'] =$  atts['post'];     }         $string = ''; // The Query$  query = new WP_Query( $args ); // The Loop if ($  query->have_posts() ) { ?>
         <?php while ( $query->have_posts() ) :$  query->the_post() ; ?>             <article id="post-<?php the_ID(); ?>" <?php post_class( 'left' ); ?>>                  <?  echo 'ID ) . '" title="' . esc_attr($  _post->post_title ) . '">';                     echo get_the_post_thumbnail( $_post->ID, 'large' ); echo ''; echo '
ID ) . '" title="' . esc_attr( $_post->post_title ) . '">'; echo get_the_title($  _post->ID);                     echo '
';                  ?>
         <?php endwhile;          wp_reset_postdata();?>
                   <?php          $clean = ob_get_clean(); return$  clean;           } }

'name' => explode( ', ', $post),  inside $  args = array(

but that didn’t return anything when I tried specifying two slugs, for example: [latest_post post="almond-cake, coconut-pie"] (If I use either one of those, it works, but not both.)

Additionally once I added the explode, it game me this warning everywhere else the shortcode was used:

Warning: trim() expects parameter 1 to be string, array given…

## Decide if a string is a member of a language that represents $P$?

For some enumeration of the complexity class P (such as this as an example: How does an enumerator for machines for languages work?), for each string 𝑝 in the enumeration, does there exist some other string (certificate) 𝑐 that allows you to verify 𝑝 is a member of the enumeration in poly time? I believe that it might be possible in poly time because all we have to do is check if a string fits some certain format (format of the encoding)?

A decision problem $$P$$ is poly time verifiable iff there is an algorithm 𝑉 called verifier such that if $$P(w)=$$𝑌𝐸𝑆 then there is a string $$c$$ s.t. $$𝑉(w,c)=$$𝑌𝐸𝑆, if $$P(w)=𝑁𝑂$$ then for all strings $$c$$, $$𝑉(w,c)=$$𝑁𝑂 and V runs in $$O(w^{k})$$ for some constant $$k$$ for all inputs $$w$$.

## Find position in array where element-wise multiplication with string of 1 and 0s results in max value

I have a sequence of 1s and 0s. For example: $$bits = [1, 0, 1, 1, 1, 0]$$. I also have an array of positive integers. For example $$arr = [12, 23, 4, 6, 8, 0, 24, 72]$$. I need to find the index, $$i$$, in $$arr$$ of the leftmost element of $$bits$$ such that

$$\sum_{j = i}^{i + \textrm{length of bits}}{bits[j – i] * arr[j]}$$

is a maximum. Essentially I am maximizing the element-wise multiplication between the two sequences starting at index $$i$$.

I need to solve it in $$O(n\log n)$$ or better, but I can only think of a way to do it in $$O(n^2)$$. I have a feeling prefix sums could be used but am not sure how.

## Is the empty string and some words of even length are elements of this set?

$$L = \{w \in \{a,b\}^*| \text{the first, the middle, and the last characters of w are identical}\}$$.

I have my answers, but I need confirmation:

Is the empty string $$\epsilon \in L$$? Yes. Reason: there is no first, middle, or last character to break the rule.

Words of even length, assuming the first and last characters of them are identical, again, must be in $$L$$, as there is no middle character to break the rule in such words.

This is in the context of theory of computation by the way.


text:
# What are the differences between the many LaTeX versions available for OS X?

There are many ways to get LaTeX on an OS X box. I prefer to manage my software via fink, and even then there are a lot of choices. At the time of this writing (2010-08-28) I have the following options:

• texlive (0.20080816-3)
• xetex (0.996-1001)
• tetex (3.0-1006)
• extex (0.0svn8062-1)
• ptex (3.1.11-3)

And I might have missed some. Which of these works best? Which is most up-to-date? Why are there so many?

-

I'd simply go to http://www.tug.org/mactex/ and download one zip file and that's everything that you'll need. It includes a complete TeX Live distribution, and also some very useful Mac-specific GUI tools like LaTeXiT.

Fink, MacPorts, etc. may be useful for many things, but getting a complete up-to-date TeX distribution isn't one of those cases. See also this closely related question.

-
Good link: I'd agree that for TeX the best approach on the Mac is to use TeX Live directly –  Joseph Wright Aug 29 '10 at 11:45

Don't use Tetex. Unfortunately, last time I looked, it was the only Tex supported as a binary by Fink.

• Gwtex, which is, like Tetex, abandonware, but used to be the nicest Tex install for the Mac.
• Mactex, which is an up-to-date descendant of Gwtex, and is a reasonable alternative to Texlive.

Your best options are Texlive (the 2009 is considered stable, and the 2010 version is usable) or Mactex. I install Texlive from the ISO image directly to my Mac, and have no problems. Mactex comes with GUI extras.

-
MacTeX isn't just TeX Live with a few extra (independent) Mac applications with the standard TeX binaries in a bizarre location? –  TH. Aug 29 '10 at 7:29
@TH.: The Mactex people say that it is based on Gwtex. It's certainly very... close to Texlive. Take a look at Gwtex. It creates files in all sorts of weird places. –  Charles Stewart Aug 29 '10 at 7:49
MacTeX is indeed 'TeX Live + extras'. I use the MacTeX installer for the ability to choose TeX systems from System Prefs., but don't use anything else from MacTeX. –  Joseph Wright Aug 29 '10 at 8:20
@Joseph: Mactex is more than a few Mac-specific configuration items and extras thrown into Texlive's multi-platform install. I should write a postscript saying a bit more about the history and giving some links. But note, there's also a stand-alone Mactex distribution, Basictex. –  Charles Stewart Aug 29 '10 at 15:50
It depends how you do the installation. You can miss out all of the graphical extras if you choose to, at least as far as I can see. –  Joseph Wright Aug 29 '10 at 16:31

I've never heard of ptex or extex until now, but ptex seems to be something related to Japanese LaTeX. I can't find much information on extex. XeTeX is a particular TeX engine that is distributed with recent TeX distributions, so I'm not sure why it's listed separately. teTeX is old and not updated any longer. TeX Live is what I suggest you use. TeX Live and MiKTeX are the two major TeX distributions. TeX Live 2008 is fairly recent.

-
Miktex is Windows only, isn't it? –  Charles Stewart Aug 29 '10 at 7:19
I don't think so. I've never used it except once on Windows though. –  TH. Aug 29 '10 at 7:21
@TH.: Miktex-tools isn't a Tex distribution, it's a port of some of the programs developed for Mitex back to Unix. You could build a Tex distribution around these, but AFAIK, no one has. –  Charles Stewart Aug 29 '10 at 7:26
Ah, good to know. –  TH. Aug 29 '10 at 7:27
I'd not call texlive-2008 "fairly recent", when texlive-2010 is being prepared for release (already frozen) `:)`. –  Khaled Hosny Aug 29 '10 at 8:38

ExTeX is (was?) a project that aims to create 'typesetting for the 21st century' with a Java-based system derived from TeX (via NTS). It is not finished and in fact seems to be abandoned or at least hybernating (even the nightly builds fail since August last year)

-


text:
# Different definitions of spinors

Recently I've read a little about the description of particles with spin in the book Quantum Mechanics by Cohen-Tannoudji. Although I yet didn't fully study the subject, I've read one interesting part in which the author considers the description of such particle being given by the state space $\mathcal{E}=\mathcal{E}_{S}\otimes \mathcal{E}_{\mathbf{r}}$ being $\mathcal{E}_S$ the spin state space generated by $\{|+\rangle, |-\rangle\}$ and $\mathcal{E}_{\mathbf{r}}$ the usual state space of a particle without spin.

In that setting we can consider the representation $\{|-\rangle\otimes| \mathbf{r}\rangle, |+\rangle\otimes |\mathbf{r}\rangle\}$. With this, denoting $|\mathbf{r}, -\rangle = |-\rangle\otimes| \mathbf{r}\rangle$ and $|\mathbf{r}, +\rangle =|+\rangle\otimes |\mathbf{r}\rangle$ we find that if $|\varphi\rangle \in \mathcal{E}$ we can express it as

$$|\varphi\rangle = \int_{\mathbb{R}^3}(\varphi_-(\mathbf{r})|\mathbf{r}, -\rangle + \varphi_+(\mathbf{r})|\mathbf{r},+\rangle )d^3\mathbf{r}.$$

The author then states the following:

In order to characterize completely the state of an electron, it is therefore necessary to specify two functions of the space variables $x,y,z$:

$$\varphi_{+}(\mathbf{r})=\langle \mathbf{r}, + | \varphi \rangle$$ $$\varphi_{-}(\mathbf{r})=\langle \mathbf{r}, - | \varphi \rangle$$

These two functions are often written in the form of a two-component spinor, which we shall write $[\varphi](\mathbf{r})$:

$$[\varphi](\mathbf{r}) = \begin{pmatrix}\varphi_{+}(\mathbf{r}) \\ \varphi_{-}(\mathbf{r})\end{pmatrix}$$

The main point is that it seems here that a spinor is just an element of $L^2(\mathbb{R}^3)\times L^2(\mathbb{R}^3)$.

Now, some time ago, before reading this I tried to learn what a spinor is, and looking on the internet I've found the Wikipedia page on which many things are said. I couldn't locate at the time any direct definition on the page.

On the page many things are said, considering Clifford algebras, spin groups and many other things. It highly depends on Clifford Algebras (which although I know the definition I haven't had the time yet to fully study) and IMHO it doesn't relate immediately to the idea of spin found in quantum mechanics.

On the other hand the idea of spinor introduced by Cohen is a thousand times clearer, simpler and much more connected to the idea of spin. I believe the relationship to rotations could be made even clearer seeing as the spin operators are generators of rotations in $\mathbb{R}^3$ and that the elements $|+\rangle$ and $|-\rangle$ are its eigenvectors.

My question here is: what is the relation between these two points of view about spinors? What is the relation between Cohen's idea of just picking those functions together and the quite complex algebraic construction? How can we connect those two viewpoints?

• To make you feel better, that Wikipedia page is pretty awful for beginners. I have tried to read it before and it is much more geared towards mathematicians and higher-level physics (one's understanding of spinors should expand somewhat when studying relativistic QM, e.g.) For your purposes right now, stick with Cohen-Tanoudji. Though be careful, a spinor is a little bit more than "just" an element of $L^2\times L^2$. It has to transform the right way under rotations as well. – Luke Pritchett Mar 5 '16 at 0:53
• To tell the truth I'm a student of a Mathematical Physics course. So I have both courses of Physics and Math. I feel quite nice with analysis, topology, differential geometry and so on. I must confess though that I didn't have the opportunity yet to study Clifford Algebras deeply. Now, my main problem with the Wikipedia page is that IMHO it tries to relate several different ways to define the concept and doesn't get much deep in any of them. I could get one and accept as a definition, but I want to understand the underlying idea and because of that I want to relate to Cohen's viewpoint. – user1620696 Mar 5 '16 at 1:04
• So do you want to understand how Cohen-Tanoudji's intuitive framing fits with all the more general mathematical stuff on Wiki? – Luke Pritchett Mar 5 '16 at 2:24
• Yes, that's my point. I want to understand the intuition behind the rigorous definitions from the wikipedia page. Because I really didn't get the intuition behind defining spinors that way and why all of that should relate to spin at all. – user1620696 Mar 5 '16 at 2:29
• Okay, I'll try to write an answer. I hope someone else tries too because I'm not great at recommending reading material. Are you familiar at all with group theory or representation theory? – Luke Pritchett Mar 5 '16 at 2:34

You are a bit confused by the wording in Cohen-Tannoudji et al. Namely, it is not the function $[\varphi]: \mathbf R^3 \to \mathbf R^2$ that is called a spinor, it is its value at a particular point, the two numbers $[\varphi](\mathbf r)\in\mathbf C^2$. So a spinor is not even an element of $L^2(\mathbf R^3)\times L^2(\mathbf R^3)\equiv L^2(\mathbf R^3)\otimes\mathbf C^2$: it is just an element of $\mathbf C^2$! It’s even simpler than you think. The function $[\varphi]$ is then properly called a spinor-valued wavefunction, as opposed to the more common scalar-valued wavefunctions.

However, in quantum mechanics, people still frequently call these objects spinors and not spinor-valued wavefunctions. It’s shorter and more convenient, but you have to keep in mind that it’s no more than an abuse of terminology. Otherwise, it will bite you later in field theory, where you will have spinor fields—spinors specified at every point of space(time)—in the same sense that the vector potential $\mathbf A(\mathbf r)$ is a vector field. The field theory doesn’t even have to be quantum: classical will do.

Now that we understand that a spinor is two numbers, why all the mathematical fuss? There is a good reason for it. It is indeed two numbers, but not just two numbers; thinking of it as two numbers will not help you understand what’s going on. For example, a vector is three numbers, but it’s not the three numbers you picture when you talk about vectors: it’s arrows in (Euclidean) space. Arrows make sense whether you choose to draw a coordinate system in the space or not. And, for example, associated with each arrow is a length, a number that also makes sense independent of any coordinate system you may or may not have.

But if you have one, $K$, you can describe any vector by three numbers: for example, $(x\;y\;z)$. If you have one more, $K'$, you can get three different numbers, $(x'\;y'\;z')$. Some numbers are more equal than others:* “length of $\mathbf v$” makes sense in the absence of a coordinate system, but “the $x$ coordinate of $\mathbf v$” doesn’t. However, once you have the coordinates of a vector in a particular system $K$, you can say what they will be in any other $K'$, consistently: that is, transforming from $K$ to $K'$ and then from $K'$ to $K''$ is the same thing as transforming from $K$ to $K''$ directly. And the transformation is linear.

We know the reason for this, of course: these are just arrows in space, so consistency is obvious. However, suppose we forgot about arrows and keep just the coordinates. We could then infer the existence of the geometric arrows from the fact that we have those algebraic transformation rules. Now generalize and say that any consistent set of rules defines a geometric object. (Keep linearity for convenience.) What other objects can we think of? Well, the six numbers $(x_1\;y_1\;z_1\;x_2\;y_2\;z_2)$ obtained from any two vectors $\mathbf v_1$ and $\mathbf v_2$, but this is kind of obvious, so we’d like to consider things that are not built from simpler ones like that. A rotation looks nice: it makes geometric sense, and at the same time it’s described by (nine) numbers conveniently arranged into a matrix. (It transforms like $A' = SAS^{-1}$ when $v' = Sv$, of course.) Turns out there’s a convenient way to talk about all these well-behaved objects.

What does this have to do with quantum mechanics? Everything. If the state of a particle at each point $\mathbf r$ in space is described by a complex number $\psi(\mathbf r)$, this number is of course doesn’t change under a coordinate transformation. The Hilbert space is $\mathscr H = L^2(\mathbf R^3)$. But what if there’s more than one “internal” degree of freedom at each point? Say $2s+1$ of them? Then $\mathscr H = L^2(\mathbf R^3)\otimes\mathscr I$ and there’s the “internal” space $\mathscr I =\mathbf C^{2s+1}$. They have to (1) mix with one another under a coordinate transformation; otherwise it’s just several simple particles lumped together, not one complex one. Mix (2) consistently, (3) linearly, and (4) the norm of the wavefunction doesn’t change. Here you go, an irreducible(1) unitary(4) linear(3) representation(2) of the rotation group $\mathrm{SO}(3)$ on $\mathscr I$. Representation theory tells you there is one such representation for $s = 0, 1, 2,\ldots$ and so on—but not for $s=1/2$! Where are the spinors?

It turns out we have missed a subtle but critical point. You don’t suddenly take away your axes and put them back differently: you change them continuously. The internal degrees of freedom $\mathscr I$ need to transform in a certain way given a process of rotation, not just its “endpoints”. But if I deform this process while keeping the endpoints fixed, the result had better stay the same. Now can all the rotation processes with fixed endpoints be transformed into one another? If yes, then we haven’t gained anything. But it turns out that the answer is no: not doing anything is the same thing as rotating twice around a fixed axis, but not the same thing as rotating once.

Why twice? Easy. Rotate (continuously) 360° around the axis in question, and then 360° around the axis pointing in the opposite direction: this is manifestly the identity. Rotate 360° around the given axis and then 360° around it again: this is the 720° rotation. But the two processes can be deformed into one another by moving the axis of the second 360° rotation!

The talk about processes strongly suggest a picture of integrating along a “curve in rotation space”. The relevant mathematics is the theory of Lie algebras. And what you need is not a representation of the group $\mathrm{SO}(3)$ of “big” rotations, but a representation of the algebra $\mathfrak{so}(3)$ of “infinitesimal” ones. [This is what physicists mean when they talk about “(infinitesimal) generators of a group”.] And, as we have seen, there’s more of them. More precisely, apart from ones with $s = 0,1,2,\ldots$ you also get one for each of $s = 1/2,3/2,\ldots$. It also turns out the operators of (conserved) angular momentum are closely connected with the Lie algebra of the associated symmetry—which is the rotations we have been talking about all along.

In a relativistic theory, the relevant symmetry is the bigger Lorentz algebra $\mathfrak{so}(3,1)$, so relativistic spinors have four components, just like four-vectors. In eleven dimensions, vectors have eleven components but spinors have thirty two. So they are not always “smaller”.

Finally, now that we have recovered spinors, what’s the matter with Clifford algebras and spin groups? Remember two inequivalent rotation processes between each pair of endpoints in $\mathrm{SO}(3)$? Turns out there’s always two of them in $\mathrm{SO}(n)$ for $n\ge 3$, so we can look at how these processes compose modulo the equivalences. (To compose two processes, do the first one and then the second.☺) The result (for $n\geq 3$, and similarly for the Lorentz groups) is exactly $\mathrm{Spin}(n)$. I’m not aware of a simple motivation for the connection with Clifford algebras [edits welcome!], but you’ll get there once you understand the Lie algebra picture. The Clifford algebras themselves are quite simple objects, in fact, and can easily be motivated by taking the square root of the Laplacian; it’s just not clear why you get spinors this way.

* Animal Farm, of course.
More precusely, I don’t know why the quadratic elements of the Clifford algebra form a representation of the corresponding orthogonal algebra. Apart from “just calculate it”, that is.

You can write your spinor valued wavefunction as: $$\Psi: L^2(\mathbb R^3)\rightarrow \mathbb C^2.$$

However such a form might not clearly capture the action under a rotation. For instance you chose a specific basis to write it like that.

If instead you started with a Clifford algebra then your points could already be vectors and your field could be scalar valued, vector valued, or even multivector valued (take values that are any multivector, or any element of the Clifford algebra).

Why is that an advantage. When you say how you make something out of your parts and you know what your parts do, then you what the thing you made does.

So if you have a reference bivector such as $e_1e_2$ for two orthogonal spacelike vectors $e_1$ and $e_2$ then your spinor could be a multivector that boosts and rotates that reference spacelike plane to describe any plane in any spacelike hyperplane.

So your spinor could be a product of vectors in 4d spacetime, an even number of vectors that are continuously connected to each other. Because those are the rotations. And the key there is that since you build the spinor out of vectors through multiplication you know exactly how it acts.


text:
# zbMATH — the first resource for mathematics

Primitive recursive notations for infinitary formulas. (English) Zbl 0262.02014
Colloq. Math. 30, 1-5 (1974).
Using methods related to S. C. Kleene’s [ibid. 6, 67–78 (1958; Zbl 0085.24602)] it is shown that the functions used in assigning notations to certain formulas in $$L_{\omega_1\omega_1}$$ by A. Kino and G. Takeuti [J. Math. Soc. Japan 15, 176–190 (1963; Zbl 0118.25001)] can be restricted to the primitive recursive functions without significantly altering the collection of formulas which receive notations. It is also shown that Kleene’s result concerning ordinal notations and the result above concerning formula notations can be extended to the case in which the functions utilized all belong to the class $$\mathcal E^4$$ of the Grzegorczyk hierarchy.
Reviewer: Kenneth A. Bowen
##### MSC:
 03C75 Other infinitary logic 03D20 Recursive functions and relations, subrecursive hierarchies 03D55 Hierarchies of computability and definability


text:
# A second order nonlinear ordinary differential equation

#### Lightfuzz

How, if possible, could I solve the equation: x''x=((x')^2)/2? Thanks.

Related Differential Equations News on Phys.org

#### Filip Larsen

Gold Member
If you are allowed to guess, then try guess a very often used function that when differentiated gives a scaled version of itself, i.e. a function that satisfy x' = a x, with a being a constant.

#### hamster143

Try to find such a pair of real numbers a & b that d/dt (x^a x'^b) is proportional to x"x-((x')^2)/2.

#### Lightfuzz

If you are allowed to guess, then try guess a very often used function that when differentiated gives a scaled version of itself, i.e. a function that satisfy x' = a x, with a being a constant.
I've tried that but is there a way to actually solve it without guessing?

#### phyzguy

Equations like this, which do not contain the independent variable, are called autonomous systems. They are easily solved with the substitution x'' = x' dx'/dx . Then collect the terms in x' and x and integrate them both. This will give you x' in terms of x, which you can then integrate a second time.

#### Phrak

Do you only require a numerical solution given some particular boundry conditions?

#### gato_

rearrange:

$$\frac{1}{2x}=\frac{\ddot{x}}{x}=-\frac{d}{dx}(\frac{1}{\dot{x}})$$

Then, reduce to a quadrature:

$$dt=(C-ln(\sqrt{x}))dx =d[x(C'-ln(\sqrt{x}))]$$

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving


text:
# Mathematics Colloquia and Seminars

This talk examines the structure and representation theory of unipotent Hecke algebras. We construct them with the following ingredients: a finite group of Lie type $G$ (such as the general linear group over a finite field), a maximal unipotent subgroup $U$ of $G$ (such as the subgroup of upper-triangular matrices with ones on the diagonal), and a one-dimensional $U$-module $\psi$. The double cosets $U\backslash G/U$ determine a natural basis for unipotent Hecke algebras, whose multiplication relations have a skein-like algorithm. In the case $G=GL_n(F_q)$, the combinatorics of partitions and weighted column strict tableaux governs the representation theory, giving rise to an explicit combinatorial map from the natural basis to pairs of multi-tableaux (also known as an RSK-insertion).


text:
# nLab cobase change

Contents

### Context

#### Limits and colimits

limits and colimits

# Contents

## Definition

Cobase change is another term for pushout of a morphism:

if

$\array{ X &\to & U \\ \downarrow && \downarrow \\ Y &\to& Y \sqcup_X U }$

is a pushout square in some category then the morphism $U \to U \sqcup_X Y$ is the cobase change or cobase extension of $X \to Y$ along $X \to U$.

## Remarks

Last revised on July 19, 2019 at 09:22:26. See the history of this page for a list of all contributions to it.


text:
# gr.group theory – Group cohomology with coefficients in a graded module

I am working in a problem group cohomology and nailed it down to compute a cohomology using an spectral sequence argument. The situation is as follows:

Let $$G = C_4 = langle sigma rangle$$ be the cyclic group of order $$4$$, $$k = mathbb{F}_2$$ and $$M^*=M^0 oplus M^1 oplus M^2$$ be a graded module where $$M^1 = M^2 = k$$ is the trivial $$G$$-module and $$M^1 = k oplus k$$ be the $$G$$-module where $$sigma(a,b) = (b,a)$$.

To compute $$H^*(G, M^*)$$, we can use a spectral sequence argument with $$E_2^{p,q} =H^p(G,M^q)$$. Since $$M^0$$ and $$M^2$$ are trivial, $$E_2^{p,q} = H^p(G,k) otimes M^q$$ for $$q=0,2$$.

When $$q = 1$$, we can use Shapiro’s lemma to show that $$E_2^{p,1} = H^p(C_2;k) cong k(t)$$ where $$C_2 = langle sigma^2 rangle$$.

However, I have no leads on how to compute the differential $$d_2:E_2^{p,1} = H^p(C_2,k) rightarrow E_2^{p+2,0} = H^{p+2}(C_4,k)$$.

I appreciate any input in this computation, or if there is any alternative to describe $$H^*(G,M^*)$$.


text:
# Converting from polar coordinates to rectangular coordinates

This is performance critical. I measured and determined that using the sqrt is faster then using the cos method.

I am aware that this code only works for some points, so that is not an issue.

Point is System.Drawing.Point. _offset is also of type Point.

I assumed, and the profiler seemed to confirm, that the try/catch will not slow down the code unless an exception occurs. Please correct me if that is wrong.

/// <summary>
/// Convert from polar coordinates to rectangular coordinates.
/// Only works for points to the left of the origin.
/// </summary>
/// <param name="theta">The angle of the point in radians.</param>
/// <returns>The point in rectangular coordinates.</returns>
internal Point PolarToRectangular(
double theta)
{
try
{
double sin = Math.Sin(theta);

// This is faster then:
// double cos = Math.Cos(theta);
double cos = -Math.Sqrt(1 - (sin * sin));

Int32 x = _offset.X + (Int32)Math.Round(radius * cos);
Int32 y = _offset.Y + (Int32)Math.Round(radius * sin);

return new Point(x, y);
}
catch (OverflowException ex)
{
throw;
}
}

As a completely untested micro-optimisation, I would suspect (Int32)(radius * cosTheta + 0.5) is going to be marginally quicker than (Int32)Math.Round(radius * cosTheta). It does, however, round up on 0.5 instead of rounding down, which may not be what you want.


text:
# Is there a theorem that says that $\sqrt{n}\frac{\bar{X} - \mu}{S}$ converges in distribution to a normal as $n$ goes to infinity?

Let $X$ be any distribution with defined mean, $\mu$, and standard deviation, $\sigma$. The central limit theorem says that $$\sqrt{n}\frac{\bar{X} - \mu}{\sigma}$$ converges in distribution to a standard normal distribution. If we replace $\sigma$ by the sample standard deviation $S$, is there a theorem stating that $$\sqrt{n}\frac{\bar{X} - \mu}{S}$$ converges in distribution to a t-distribution? Since for large $n$ a t-distribution approaches a normal, the theorem, if it exists, may state that the limit is a standard normal distribution. Hence, it would seem to me that t-distributions are not very useful - that they are useful only when $X$ is roughly a normal. Is this the case?

If it is possible, would you indicate references that containing a proof of this CLT when $\sigma$ is replace by $S$? Such a reference could preferably use measure theory concepts. But anything would be great to me at this point.

• An application of Slutsky's theorem, versions of which are sometimes referred to as the converging together lemma, shows that the limit is standard normal. – cardinal May 11 '14 at 14:57

To elaborate on @cardinal 's comment, consider an i.i.d. sample of size $n$ from a random variable $X$ with some distribution, and finite moments, mean $\mu$ and standard deviation $\sigma$. Define the random variable

$$Z_n = \sqrt {n}\left(\bar X_n -\mu\right)$$ The basic Central Limit Theorem says that $$Z_n \rightarrow_{d} Z \sim N(0,\sigma^2)$$

Consider now the random variable $Y_n = \frac 1{S_n}$ where $S_n$ is the sample standard deviation of $X$.

The sample is i.i.d and so sample moments estimate consistently population moments. So

$$Y_n \rightarrow_{p} \frac 1{\sigma}$$

Enter @cardinal: Slutsky's theorem (or lemma) says, among other things, that $$\{Z_n \rightarrow_{d} Z, Y_n\rightarrow_{p} c\} \Rightarrow Z_nY_n\rightarrow_{d} cZ$$ where $c$ is a constant. This is our case so

$$Z_nY_n = \sqrt{n}\frac{\bar{X_n} - \mu}{S_n}\rightarrow_{d} \frac 1{\sigma}Z \sim N(0,1)$$

As for the usefulness of Student's distribution, I only mention that, in its "traditional uses" related to statistical tests it still is indispensable when sample sizes are really small (and we are still confronted with such cases), but also, that it has been widely applied to model autoregressive series with (conditional) heteroskedasticity, especially in the context of Finance Econometrics, where such data arise frequently.

• +1, always nice to see when answers to theoretical questions are related to their usefulness in practice – Andy May 11 '14 at 18:28
• @Andy I agree, that's the ideal. – Alecos Papadopoulos May 11 '14 at 18:30