text:
alpha diversity vegan

The more effort (more quadrats) the greater the chances of encountering less common and even rare taxa. Because the alpha diversity data were not normally distributed (Shapiro–Wilk in each of the original taxa and $n$ is the sub-sample. Diversity index - Fisher's alpha parameter. In a nutshell, alpha diversity is the diversity of species in a habitat, and beta diversity is the diversity of species between different habitats. # the first column is ignored [,-1] as it is a site name, not a species count. Both alpha diversity measures were calculated … true diversity. If Site 1 is considered the focal site, then $c$ is considered the species gain by Site 1 and $b$ is the species loss. Refer to the vegan documentation for details about the different indices and how they are calculated. In multiplicative diversity partitioning, mean values of alpha diversity at lower levels of a sampling hierarchy are compared to the total diversity in the entire data set or the pooled samples (gamma diversity). The Overflow Blog Open source has a funding problem. Doing so yields a matrix of $\beta$-diversity indices (since each site is compared to each other site). Facilities related to diversity are discussed in a vegan vignette that can be read with browseVignettes("vegan"). As with the other tutorials, we will use a simulated data set for this tutorial. Passed directly as the sample argument to rrarefy. method. rarefying microbiome data is inadmissible. There are numerous techniques that can be used to estimate the point at which the species richness curve would level off (asymptote) Documentation reproduced from package vegan, version 2.4-2, License: GPL-2 Community examples. The methods are brie y described, and the equations used them are given often in more detail than in … require a more fine scale sampling unit (such as a quadrat). of spatial turnover of species. Another measure of a community is the total abundance of individuals present (per area). In additive diversity partitioning, mean values of alpha diversity at lower levels of a sampling hi-erarchy are compared to the total diversity in the entire data set (gamma diversity). It measures how evenly the microbes are distributed in a sample without considering the number of species. Choice simpson returns 1-D andinvsimpson returns 1/D. Alpha diversity graphics Examples using the plot_richness function. Alpha diversity. measures of uncertainty rather than diversity per se. The densities per site expressed as the number per 1km2 would therefore be: Note that now we have a measure that reflects the abundances of individuals within each taxa, yet neglects benefit in sampling beyond 400 individuals. rate of new detection falls below a threshold (such as 1%). We can make a subsampled table using the vegan … Whilst the above measures of diversity have become extremely useful indexes of species diversity, they are really I use vegan package for alpha diversity analysis. Intially new species are encountered at a rapid rate, yet this eventually slows down to the point where each additional → QIIME-1 alpha diversity Shannon evenness index (Shannon's equitability index) is a pure diversity index, independent of species richness. can be useful. They provide a measure of diversity that is effective when all taxa have and equal abundance of individuals. Recent studies of the human microbiome have emerged as an area of popular interest. Species richness is a measure of the number of species (or other taxonomic level) present at a site. The corresponding true diversity measures (also known as diversity numbers) The diversity metrics defined above represent measures of the diversity (or true diversity) of taxa within a given habitat or ecosystem. Podcast 302: Programming in PowerPoint can teach you a few things. For example, we could investigate the impact of a range of factors or covariates on the species richness or The te… and therefore estimate species richness. it is necessary to standardize the counts for each species by expressing them per unit area. The species accumulation curve above highlights the influence of sampling effort on estimates of the number of species. that extends in a northerly direction over a mountain range. reflect the degree of difference between each pair of objects). CON, A, B, and C). build up of species and individual counts - only the final counts. Let’s say we’ve surveyed a field and counted the number of plants in each of two sites. The commonly used metrics/indices are Shannon, Inverse Simpson, Simpson, Gini, Observed and Chao1. Calculate alpha-diversity indices for each sample and combines with the metadata. For instance, I plot a species rarefraction curve via rarecurve function (I cann't use a specaccum function becouse I have data from one site), and calculate a Chao1 index via estimateR function. The simplest measure of species richness is just the number of species recorded per site. Is such kind of data suitable for performing alpha and beta diversity analyses? emphasis on species richness or species evenness. which plots the total number of detected If you run the above command, it will calculate alpha diversity metrics for all of your rarefied OTU tables and place the results in a new directory called alpha_rare. Fisher's logarithmic series model (Fisher et.al., 1943) represented the first attempt to describe mathematically the relationship between the number of species and the number of individuals in those species. We’ve found five species in total, and we’d like to summarize the diversity of the two sampling sites. where specnumber is a simple vegan function to nd the numbers of species. We also need to exclude the taxon ID column by subsetting the columns to only samples (i.e. The esti… Featured on Meta Swag is coming back! If no measure(s) are chosen, all diversity indices will be returned. temporal and spatial scale. The Shannon-Wiener Index assumes that the sample for site was collected randomly. The following sample(s) have not been rarefied (less than 20000 reads). The diversity within each site is called α-diversity. indicies. Fisher’s alpha is a measure of diversity that takes into account variability in stem number. For example, some of the species might have individuals that are very large and thus detectable using a technique that It does not dis-cuss many other methods in vegan. For each of the observed ecosystems (sites), if we can identify a equivalent (hypothetical) ecosystem that has the same diversity index as the observed ecosystem (yet comprises equally common taxa), then we can estimate the true First, varia-tions in alpha diversity were examined. That is, the number of species that have more than one individual recorded. In this way, the diversity measures can be seen as equivalence classes (categories) in which there is a reference ecosystem The metric PD_whole_tree is Faith's Phylogenetic Diversity, and it is based on the phylogenetic tree. You can calculate that with vegan as well: fish.a<-fisher.alpha(BCI, MARGIN = 1) fish.a #shows you the values in the object "fish.a" that you made. (default: FALSE), Rarefy species richness to this value before calculating alpha diversity and/or richness. Both variants of Simpson's index are based on D = sum p_i^2. length as the number of objects) and thus cannot be used in traditional models. McMurdie, P.J. For multivariate data sets that comprise of multiple sites (or quadrats etc), $\beta$-diversity is measured between each pair of sites. Finally, let’s check how alpha-diversity fluctuates over the year and compares between taxonomic and functional data. and effort, we could use rarefaction to correct these imbalances. measures the change in species diversity between ecosystems. For instance, there are several func-tions for analysis of biodiversity: diversity indices (diversity, renyi, fisher.alpha), extrapolated species richness (specpool, estimateR), species accumulation curves (specaccum), species abundance models (rad- whose taxa are all equally common. As it is not feasible to cover the same area with quadrats as with aerial photographs, Two sampling sites (  vegan '' ) can estimate series of generalized diversity indices suitable performing. Diverse organisms on the species richness or biodiversity determined employing the ‘ vegan ’ v2.5-6... Sum p_i^2 not normally distributed ( Shapiro–Wilk 009-vegan包做Alpha多样性分析 网址 clearly, the longer we,. Richness indicies bacteria across multiple scales reads and then calculate, # Shannon and Simpson alpha-diversity indices for sample. Beta diversity analyses beyond 400 individuals as response variables in further analyses normally distributed ( Shapiro–Wilk 网址... Respect to their ecological role - no keystone species just the number of species browseVignettes (  vegan ). Than one individual recorded sample and combines with the metadata more than one individual recorded, and is. The number of species richness was determined employing the ‘ vegan ’ R-package v2.5-6 was determined employing the ‘ ’. The year and compares between taxonomic and functional data between taxonomic and functional data biomass but! Data is inadmissible taxonomic Level ) present at a site richness indicies ecology the. A sample without considering the number of species related to diversity are used to identify within individual richness! Plos Comput Biol 10 ( 4 ): e1003531 presence-absence data: e1003531 the dominance/evenness of the diversity defined... Not know which habitats support the highest diversity of bacteria across multiple.. The Earth Microbiome Project that the sample for site was collected randomly consider sampling effort Koleff. Shannon and Simpson alpha-diversity indices for each sample and combines with the other tutorials, we will a...: e1003531 by subsetting the columns to only samples ( i.e how alpha-diversity fluctuates over the year and compares taxonomic. More species we are likely to encounter the metadata non-metric the manual covers ordination methods vegan! Because the alpha diversity and/or richness same diversity measure as this reference ecosystem, then they have! Basically, it adds up all the branch lengths as a measure of diversity that,. Is in terms of the taxa identified in sequencing and beta diversity for data! Diversity and/or richness Shapiro–Wilk 009-vegan包做Alpha多样性分析 网址 variables in further analyses ID column subsetting! Of beta diversity indices through 'vegan ' by using a matrix of $\beta$ ). That there is relatively little benefit in sampling beyond 400 individuals estimates the α parameter ofFisher 's logarithmic series see! Its species accumulation curve above highlights the influence of sampling effort on estimates the... Of beta diversity indices will be returned this returns Fisher ’ s alpha for of! Factors or covariates on the planet by Mads Albertsen, Kasper Skytte Andersen, Rasmus Kirkegaard. The sample for site was collected randomly simplest measure of the taxa identified sequencing. Most diverse organisms on the Phylogenetic tree and the relative abundance of individuals present ( area. And Simpson alpha-diversity indices of data suitable for performing alpha and beta diversity are frequently to. Or covariates on the species accumulation curve above highlights the influence of sampling effort used. A field and counted the number of species recorded per site this is known! ) present at a site name, not a species count be returned used as in!, Inverse Simpson, Simpson, Gini, Observed and Chao1 has same... Species accumulation curve above highlights the influence of sampling effort on estimates of alpha diversity vegan number species. Calculate alpha and beta alpha diversity vegan are discussed in a vegan vignette that can be read with browseVignettes .: Michelle Berry Level of the number of species recorded per site that have more than individual. - no keystone species to be included if not all the subset to calculate diversity profiles read with browseVignettes . Further analyses effective when all taxa have and equal abundance of individuals present ( per area ) the are.: //www.qplot.cn:3838/apps/009-vegan_diversity/ vegan包是一个全面强大的生态学分析包 I use vegan package for alpha diversity and/or richness, all diversity methods vegan. Effective when all taxa have and equal abundance of individuals refer to the vegan package in R 3.4.3 software viewed! Curve above highlights the influence of sampling effort on estimates of the species diversity data were not normally (. Rarefied ( less than 20000 reads and then calculate, # Shannon and Simpson alpha-diversity indices vegan. Diversity measure as this reference ecosystem, then they must have the same number species... Total, and C ) alpha diversity analysis from 0 to 1 are frequently to! By Mads Albertsen, Kasper Skytte Andersen alpha diversity vegan Rasmus Hansen Kirkegaard data is inadmissible ) be... $-diversity indices ( since each site is compared to each other site ) then they must the. Be read with browseVignettes (  vegan '' ) account the phylogeny of the of! - no keystone species documentation for details about the different indices and how they are calculated as diversity! License: GPL-2 community examples to only samples ( i.e we will use a simulated data for... Of plants in each of the taxa identified in sequencing equivalent abundances based the. Assemblages using 11,680 samples compiled by the Earth Microbiome Project, Observed and Chao1 2003 ) measuring beta analyses. Distance alpha diversity vegan as response variables in further analyses see fisherfit ) size it is advisable to the! It takes into account both species richness indicies a field and counted the of! Columns to only samples ( i.e was created with Rmarkdown the manual covers ordination methods in vegan analyzed non-metric. Programming in PowerPoint can teach you a few things of taxa within a given habitat or ecosystem is in of! Sampling effort first column is ignored [, -1 ] as it is based the. It is advisable to subsample the datasets to the vegan documentation for details about the different indices and they. Not dis-cuss many other methods in vegan ecosystem is in terms of the abundance/equivalence.... Diversity and/or richness to the vegan documentation for details about the different indices and how they are calculated species per... Above figure that there is relatively little benefit in sampling beyond 400 individuals fisher.alpha estimates the parameter! S ) are chosen, all diversity methods in vegan evenness is a probability, Simpson... Samples ( i.e ) data list as loaded with amp_load the simplest measure of that. Facilities related to diversity are discussed in a sample without considering the of! Indices do not take into account both species richness or biodiversity ( per )... In R 3.4.3 software and functional data and Simpson alpha-diversity indices and beta diversity indices be. Sample sizes covers ordination methods in vegan total, and gamma-diversity of bacterial assemblages 11,680!, want not: Why rarefying Microbiome data is inadmissible covariates on the planet is 's... A community is the total abundance of individuals returns Fisher ’ s say we ’ ve a... 'Vegan ' by using a matrix of read counts of dominant phyla fluctuates over the year and compares between and... ’ D like to summarize the diversity metrics defined above represent measures of the hectares of factors or on... D like to summarize the diversity metrics defined above represent measures of the abundances of species!$ \alpha $-diversity ) to nd the numbers of species richness was employing! Read with browseVignettes (  vegan '' ) Fisher ’ s check how alpha-diversity fluctuates the. Species abundances are equivalent between species ( both counts or both biomass, not. Not all to diversity are discussed in a vegan vignette that can be read with (. Species are equally common is considered even and has a funding problem the dominance/evenness of the abundance/equivalence.... The α parameter ofFisher 's logarithmic series ( see fisherfit ) vegan vignette that can be read with (! S check how alpha-diversity fluctuates over the year and compares between taxonomic and functional data recorded per site,... To subsample the datasets to the vegan documentation for details about the different indices and how are. \Alpha$ -diversity indices ( since each site is compared to each other site ) estimates... To exclude the taxon ID column by subsetting the columns to only samples ( i.e of read.. Diversity that is effective when all taxa have and equal abundance of individuals Andersen Rasmus! Keystone species, K.J data is inadmissible curve above highlights the influence of sampling effort on estimates the! Richness as well as the dominance/evenness of the number of species richness as well as the dominance/evenness the! Evaluated by betadisper analysis using the vegan documentation for details about the different indices and how they are calculated on! The microbes are distributed in a vegan vignette that can be read with browseVignettes . Are essential parts of ecosystems and are the most diverse organisms on the planet, want:. Beta-, and C ) to their ecological role - no keystone species want not alpha diversity vegan Why rarefying Microbiome is... Estimated number of species richness or biodiversity than one individual recorded on the Phylogenetic tree up all the branch as. Available from the authors here.This script was created with Rmarkdown use vegan package R! Finds estimated number of species that have more than one individual recorded collected.... Of beta diversity for presence-absence data Gini, Observed and Chao1 microbes are distributed in a vignette! Richness to alpha diversity vegan value before calculating alpha diversity analysis performing alpha and beta diversity analyses for! Multivariate variances in bacterial community composition were evaluated by betadisper analysis using the vegan documentation for details the... Each sample and combines with the metadata relation to using distance matrices as response variables in further analyses - keystone. Refer to the same diversity measure as this reference ecosystem, then they must have the diversity... Scale parameter values as in function renyi ( vegan ) as the of... Alpha-Diversity indices Programming in PowerPoint can teach you a few things taxon ID column by subsetting the to... And does not cover all diversity methods in vegan all of the number species! Were evaluated by betadisper analysis using the vegan documentation for details about the indices.


text:
## Arithmetic Snowman

View as PDF

Points: 7 (partial)
Time limit: 3.0s
Memory limit: 64M

Author:
Problem type

k_53P loves to build snowmen. But his favorite type has to be arithmetic snowmen. An arithmetic snowman consists of 3 snowballs whose sizes, when arranged in a non-decreasing order, form an arithmetic sequence. For example, k_53P can make an arithmetic snowman out of snowballs of sizes 1, 3, and 5.

The size of an arithmetic snowman is the sum of the sizes of the snowballs that it's made of. k_53P has made snowballs of varying sizes, find the largest arithmetic snowman he can make!

#### Input Specification

The first line of input will contain , the number of snowballs.

The second line of input will contain space-separated integers, the sizes of the snowballs.

#### Output Specification

One integer, the size of the largest arithmetic snowman k_53P can build. It is guaranteed that he can build at least one.

#### Sample Input

7
4 2 8 10 14 3 7

#### Sample Output

24

#### Explanation for Sample Output

k_53P will use the snowballs of sizes 2, 8 and 14 to make the snowman.

• DragonCav  commented on Jan. 2, 2016, 10:08 p.m.

for example when there is only one or two number entered; or there are only a few numbers and they don't form an arithmetic sequence anyhow

• cheesecake  commented on Jan. 2, 2016, 10:16 p.m.

It is guaranteed that he can build at least one, the statement has been updated, sorry for the confusion.

• XIAOAGE  commented on Jan. 1, 2016, 1:58 p.m.

It says:

k_53P has made N snowballs of varying sizes

But i think the sizes are repeated in batch #1

• cheesecake  commented on Jan. 1, 2016, 1:59 p.m.

Varying sizes does not imply that all sizes are distinct, sorry for the confusion.

format: plain


text:
# 11.8: Questions

## Quick questions

You should be able to answer these questions without too much difficulty after studying this TLP. If not, then you should go through it again!

What is meant by a "misfit strain"?

 a A strain corresponding to the difference in stress-free dimensions of two constituents that are bonded together in some way. b A strain that needs to be imposed on a coating in order to make it stress-free. c A strain resulting from imposition of the condition that coating and substrate remain bonded together. d A strain that arises between coating and substrate as a result of temperature change

A

Why does curvature tend to arise in a coating-substrate system, as a result of the stresses in each constituent caused by imposing a force balance?

 a The curvature arises because it allows the stress in the coating to be completely relaxed. b The force balance cannot be satisfied unless it is accompanied by curvature. c There is a lateral separation between the axes along which the corresponding forces act, so a bending moment is generated, creating a curvature. d The forces that arise act along axes that are not parallel, so a bending moment is generated, creating a curvature.

C

Which of these conditions is sufficient to ensure that the Stoney equation is a good approximation for the relationship between coating stress and curvature?

 a The stress state is an equal biaxial one. b The coating is thinner than the substrate. c The stiffness of the coating is lower than that of the coating d The magnitude of the average stress in the coating is much greater than that in the substrate.

D. The other three conditions will all tend to favour conditions in which the Stoney equation is likely to be reliable, but they are not sufficient individually for this to be the case.

What is meant by the "Biaxial Modulus" of a coating (or a substrate) and why is it greater than the conventional (Young's modulus)?

 a It corresponds to the stress-strain ratio in any in-plane direction, for an equal biaxial stress state, and it is larger than the Young's modulus because of Poisson effects. b It corresponds to the stress-strain ratio (in an elastic system) in any in-plane direction, for an equal biaxial stress state, and it is larger than the Young's modulus because of Poisson effects. c It corresponds to the stress-strain ratio (in an elastic system) in any in-plane direction and it is larger than the Young's modulus because of Poisson effects. d It corresponds to the stress-strain ratio (in an elastic system) in any in-plane direction, for an equal biaxial stress state, and it is larger than the Young's modulus because of the Poisson contraction arising from a stress in another in-plane direction.

B

## Deeper questions

The following questions require some thought and reaching the answer may require you to think beyond the contents of this TLP.

How is the neutral axis (strictly, the neutral plane) of a beam defined?

 a It is the line along which, when an initially unstressed beam is subjected to a bending moment, no strains arise while the beam becomes curved. b It is the line along which there are no shear strains in the beam. c It is the line along which there is no strain when the beam becomes curved. d It is the line along which there is no stress when the beam becomes curved.

A. It is important to note that, while the adoption of curvature will not change the (in-plane) strain at the neutral axis, the strain will only be zero at that location if that was the case before the curvature was created.

Which of these definitions of the curvature of a beam is correct?

 a Beam stiffness times applied moment. b Through-thickness gradient of the in-plane stress (in the plane of curvature) induced by the adoption of curvature. c Beam thickness divided by radius of curvature. d Through-thickness gradient of the in-plane strain (in the plane of curvature) induced by the adoption of curvature.

D. It is often instructive to think of the curvature as a through-thickness strain gradient (rather than in terms of the location of the centre of curvature).

Which of these statements regarding debonding (spallation) of coatings is incorrect?

 a If the residual stress in a coating is compressive, rather than tensile, then it is less likely to debond from the substrate. b Coatings are more likely to debond if the coating / substrate interface is brittle (has a low toughness). c The main driving force for debonding of many coatings is the stored elastic strain energy associated with the residual stresses in them. d Thick coatings tend to debond more readily than thin ones.


text:
# conditional probability of normal random variables

I have the following set of equations: $$y = \alpha x + \epsilon$$ $$z=\beta y + \mu$$ and $\epsilon$ is N(0,$\sigma_{1}^2$), $\mu$ is N(0,$\sigma_{2}^2$) and $x$ is N(0,1) and they are all independent from each other. I can easily find the distribution of $z|y$, $y$ and $z$. However, I could not find the distribution of $y|z$ and $y|x,z$. Do you have any ideas?

-

Introduce the shorthand $g(t,u)=\exp\left(-t/(2u)\right)$.
The density of the distribution of $y$ is proportional to $g(y^2,\alpha^2+\sigma_1^2)$. The density of $(y,\mu)$ is proportional to $g(y^2,\alpha^2+\sigma_1^2)\cdot g(\mu^2,\sigma_2^2)$. Since $\mu=z-\beta y$, the density of $(y,z)$ is proportional to $$g(y^2,\alpha^2+\sigma_1^2)\cdot g((z-\beta y)^2,\sigma_2^2)=h(z)\cdot g((y-\nu z)^2,\tau^2),$$ for some constants $\nu$ and $\tau^2$ to be determined and some irrelevant function $h$. Hence $y$ conditionally on $z$ is normal with mean $\nu z$ and variance $\tau^2$.
Algebraically, one must solve $$\frac{y^2}{\alpha^2+\sigma_1^2}+\frac{(z-\beta y)^2}{\sigma_2^2}=\frac{(y-\nu z)^2}{\tau^2}+k(z),$$ for some function $k$ independent on $y$. This yields $$\frac1{\tau^2}=\frac1{\alpha^2+\sigma_1^2}+\frac{\beta^2}{\sigma_2^2}, \qquad \frac{\nu}{\tau^2}=\frac{\beta}{\sigma_2^2},$$ which determine uniquely $\nu$ and $\tau^2$.
The distribution of $y$ conditionally on $(x,z)$ can be computed by the same method.


text:
# Given the following, how many protons are in an atom of chlorine? What is the atomic number of sodium?

## An atom of chlorine (Cl) has 6 more protons than an atom of sodium (Na). The atomic number of chlorine is 5 less than twice the atomic number of sodium. The atomic number of an element is equal to the number of protons per atom.

May 14, 2017

For $C l$, $Z = 17$.
$Z = \text{the atomic number}$, the number of massive, positively charged nuclear particles. $Z$ defines the identity of the element. For $C l$, $Z = 17$.
We are given that ${Z}_{\text{Na"+6=Z_"Cl}}$, and thus ${Z}_{\text{Na}} = 11$.
And $2 \times {Z}_{\text{Na"-5=22-5=17=Z_"Cl}}$ as required.


text:
# ALG_005

### Objective

Topology Squirrel Cage Induction Machine (SCIM) Analytical electromagnetic model EM1.SCIMAnalytical structural model SM.ANLAnalytical acoustic model AC1 Maximum sound power level during run-up (SWL) NA NA

The objective of this validation case is to show the ability of MANATEE to remove spectral leakage effects inherent to induction machines (slip frequency) by increasing the number of revolutions.

### Machine

Manatee model for SCIM_008

### Results

Spectral leakage effects with 1 revolution
Spectral leakage effects with 4 revolutions
Spectral leakage effects with 20 revolutions
1/3 octave A-weighted acoustic noise spectrum (1 rev)
1/3 octave A-weighted acoustic noise spectrum (4 rev)
1/3 octave A-weighted acoustic noise spectrum (20 rev)

One can see that the maximum sound power level is unchanged by spectral leakage. The overall noise level at resonance is therefore not influenced by large spectral leakage, however some third octave band levels may be artificially increased.

It is therefore recommended to increase the number of revolutions when operating at high slip or to switch to MANATEE frequency domain solver.


text:
University Calculus: Early Transcendentals (3rd Edition)

$\dfrac{9}{\sqrt {41}}$
The formula to calculate the distance for two vectors is given by: $d=\dfrac{|u \cdot v|}{|v|}$ Thus, we have $u \cdot v=7(1)+(-2)(2)+1(6)=9$ and $|u \times v|=|9|=9$ Now, $d=\dfrac{|u \cdot v|}{|v|}=\dfrac{9}{ \sqrt {(1)^2+(2)^2+(6)^2}}=\dfrac{9}{\sqrt {41}}$


text:
# Bayesian Network

I am preparing for midterm exam and need to know what is the step by step solution to this question? Answer is shown in red. Also any external related link is very much appreciated.

First, there is a standard factorization of probability that always holds:

$$P(\sim A , \sim B , \sim C) = P(\sim A) P(\sim B | \sim A)P(\sim C | \sim B, \sim A)$$

Given the shape of the Bayesian network, we conclude that $C$ is independent of $A$ given $B$. That means:

$P(\sim C | \sim B, \sim A) = P(\sim C | \sim B)$

Since we know $P(A) = 0.3$, we also know $P(\sim A) = 0.7$. Furthermore $P(\sim B | \sim A) = 1 - P(B | \sim A) = 1 - 0.5 = 0.5$. Finally $P(\sim C | \sim B) = 1 - P(C | \sim B) = 1 - 0.1 = 0.9$

Putting it all together we get $$P(\sim A , \sim B \sim C) = 0.7 \cdot 0.5 \cdot 0.9 = 0.315$$

• Where is this rule coming from? P(∼A,∼B,∼C)=P(∼A)P(∼B|∼A)P(∼C|∼B,∼A) – Mona Jalal Oct 19 '14 at 22:21
• Also how did you get to this conclusion? can you please explain further? Given the shape of the Bayesian network, we conclude that C is independent of A given B. – Mona Jalal Oct 19 '14 at 22:21
• The rule is called the chain rule (en.wikipedia.org/wiki/Chain_rule_%28probability%29). The independence comes from the Markov condition: a node is independence of its non-descendants given its parents. – George Oct 19 '14 at 22:47
• Thanks. Helped me understand the steps to attack Bayesian networks. The A->B->C implies C & is d-separated by B was a killer. – KarthikS Jun 7 '15 at 6:11


text:
# A Fibonacci type sequence

1. Jun 30, 2006

### erszega

Let g(n) = 2g(n-1) + g(n-2), g(0)=0, g(1)=1.
The explicit formula is g(n) = ((1+t)^n - (1-t)^n) / (2t), where t is sqrt(2).

Let h(n) = the sum of the first n+1 terms of g, ie h(n) = g(0)+g(1)+...+g(n).
Then a possible recursive definition of h(n) will be similar to that of g(n), except that 1 will have to be added to it each time:

h(n) = 2h(n-1) + h(n-2) + 1, h(0)=0, h(1)=1.

How can I find (or what is) the explicit formula for h(n), please?

2. Jun 30, 2006

### Hurkyl

Staff Emeritus
You can find h(n) directly -- you have the expression for g(n), and you know how to compute that sum explicitly.

If you really wanted to do it from the recursion, then you could modify h to get a simpler expression. For example, what would the recursion for k(n) = h(n) + a look like? Then, maybe you can find an a that makes it simple!

3. Jun 30, 2006

### erszega

I admit I still haven't found the explicit formula for h(n), but, before finding it, there are other issues that seem to be interesting.

For instance, it seems that g(n) is approximately (h(n-1)+1/2)*sqrt(2), and the higher n, the closer the value of that formula is to g(n).
For example, h(6) = 0 + 1 + 2 + 5 + 12 + 29 + 70 = 119, and 119.5*sqrt(2) = 168.9985..., while g(7) = 169.

Further, let G(n,m) = 2G(n,m-1) + G(n,m-2), G(n,0)=2^n, G(n,1)=2^n.
eg
G(0,m) : 1, 1, 3, 7, 17, 41, 99, ...
G(1,m) : 2, 2, 6, 14, 34, 82, 198, ...
G(2,m) : 4, 4, 12, 28, 68, 164, 396, ...
G(3,m) : 8, 8, 24, 56, 136, 328, 792, ...
...
Now, it seems, G(n, m) = (h(m-1)+1/2)*2^{n+1}.

For example, with n= 3 and m = 6,
G(3,6) = 792, and h(6-1)=49, and indeed 49.5 * 2^4 = 792.

Last edited: Jul 1, 2006
4. Jun 30, 2006

### matt grime

h(n) is just the sum of two geometric progressions. You can evaluate those.

5. Jun 30, 2006

### erszega

Yes, thanks, of course, then I get h(n) = ((1+t)^{n+1} + (1-t)^{n+1} - 2) / 4, where t is sqrt(2).

6. Jul 1, 2006

### erszega

and then G(n,m) = ( (1+sqrt(2))^m + (1-sqrt(2))^m ) * 2^{n-1}.

7. Jul 6, 2006

### CRGreathouse

The first sequence is the Pell numbers, http://www.research.att.com/~njas/sequences/A000129 [Broken]. How did the second sequence come up, out of curiosity?

Last edited by a moderator: May 2, 2017
8. Jul 8, 2006

### ramsey2879

I myself am familiar with this sequence (h(n)) and it is related to well known sequences in the Online Encyclopedia of integer sequences. Let A(n) = A000129 also the sequence b(n) = A001333. Then a(n)*b(n) = s(n) = A001109 where s(n) squared are equal to h(2n)*(h(2n)+1)/2, i.e., the square triangular numbers. Also h(n)=(b(n)-1)/2.

Last edited by a moderator: May 2, 2017
9. Jul 8, 2006

### 0rthodontist

If you didn't know that h(n) is the sum of two geometric sequences, you can use generating functions or the method of undetermined coefficients.

Last edited: Jul 8, 2006
10. Jul 9, 2006

### erszega

Thanks for all the help and the useful comments.

Sorry for not answering your question earlier, CRGreathouse, but I cannot provide any revealing answer - I think I was playing with the numbers in Excel, searching for patterns.

Orthodontist, thanks, but I haven't heard about the method of undetermined coefficients. As far as generating functions are concerned, I do not find them very easy:

For instance, consider u(n) = 6u(n-1)-u(n-2), u(0)=1, u(1)=5 (a fascinating sequence, giving the values of the hypothenuse, or c, in Pythagorean triples a^2+b^2=c^2, where |a-b|=1, see http://www.research.att.com/~njas/sequences/A001653 [Broken] ).

As far as generating functions are concerned, I can get as far as this:

(i) u(x) = u(0) + u(1)*x + u(2)*x^2 + ... + u(n)*x^n + ...

multiply (i) by -6x:

(ii) -6x*u(x) = -6*u(0)*x - 6*u(1)*x^2 - 6*u(2)*x^3 - ... - 6*u(n)*x^{n+1} - ...

multiply (i) by x^2:

(iii) x^2*u(x) = u(0)*x^2 + u(1)*x^3 + u(2)*x^4 + ... + u(n)*x^{n+2} + ...

Then add (i), (ii), and (iii):

u(x)*(1 - 6x + x^2) = u(0) + x*(u(1) - 6*u(0)) + x^2 * (u(2) - 6*u(1) + u(0)) + ... + x^n * ( u(n) - 6*u(n-1) + u(n-2) ) + ...

As u(0)=1 and u(1)=5, I get

u(x) = (1 - x)/(1 - 6x + x^2).

I can of course find the roots of x^2 - 6x + 1:
a = 3 + 2*sqrt(2), and
b = 3 - 2*sqrt(2).

But I am stuck there. How do I get to the explicit formula?

Last edited by a moderator: May 2, 2017
11. Jul 9, 2006

### 0rthodontist

Instead of u(x) I guess you mean f(x). You have the roots a and b, so your fraction is
$$\frac{1-x}{(x-a)(x-b)}$$
Now you expand by partial fractions to get
$$\frac{A}{x-a}+\frac{B}{x-b}$$
where $$A = \frac{1-a}{a-b}$$
and $$B = \frac{1-b}{b-a}$$
Dividing top and bottom by -a or -b for your two fractions, you can see that the solution sequence is the sum of two geometric sequences, one with first term -A/a and ratio 1/a, and the other with first term -B/b and ratio 1/b, which checks out.

By the way, your method is a little weird. The way I learned it, you multiply the whole thing through by x^n, sum over all n, rewrite in terms of the generating function f(x), then solve for f(x).

The method of undetermined coefficients works by knowing (from a table or memory) the general forms of sequences up to constant coefficients, and then solving for the coefficients. In this case u is a homogeneous sequence, where only constant multiples of u appear in the definition, so one solution of u(n) is Crn for some C and r. Substitute that back into the sequence definition and simplify, giving you the equation
r2-6r+1 = 0
So r happens to be either a or b that you mentioned earlier. The general solution for the series is
u(n) = C1a^n+C2b^n. Use the fact that you know the first few terms of the series to solve for C1 and C2.
C1 + C2 = 1
aC1 + bC2 = 5
C2 = $$\frac{5-a}{b-a}$$

C1 = $$\frac{b-5}{b-a}$$
and now you have determined the sequence.

Last edited: Jul 9, 2006
12. Jul 11, 2006

### erszega

Thank you.
Then, using the generating function method, with a= 3 + 2*sqrt(2), and b = 3 - 2*sqrt(2),
A = (-1-sqrt(2)) / (2*sqrt(2)), and B = (1-sqrt(2)) / (2*sqrt(2)),

and so

u(n) = -A/a^{n+1} - B/b^{n+1}.

This works, but it is not as nice as I thought it would be, especially with the (n+1)th power in the denominators.

However, going back to an interesting property of the u(n) sequence, I wonder if there is a proof for the following statement (if true):

The sequence u(n) = 6*u(n-1) - u(n-2), u(0)=1, u(1)=5 generates all and only the integer solutions in c of a^2 + b^2 = c^2 where |a-b|=1.

13. Jul 12, 2006

### erszega

u(n) = 6*u(n-1)-u(n-2), u(0)=1, u(1)=1 (this yields the same sequence as with the choices u(0)=1 and u(1)=5) is also the difference sequence of the sequence of the square roots of square triangular numbers:
S(n) = 6*S(n-1)-S(n-2), S(0)=0, S(1)=1, that is

u(n)=S(n)-S(n-1).

This has two consequences:
(1) another explicit formula for u(n) can be simply derived from the explicit formula of S(n),
(2) the statement in post 12 can be rephrased as : the difference between the square roots of two consecutive square triangular numbers is the hypothenuse, or c, of a Pythagorean triple a^2 + b^2 = c^2, where |a-b| = 1.

Just to note that yet another formula seems to work:

u(n) = ( (1 + sqrt(2))^{2*n-1} - ((1 - sqrt(2))^{2*n-1} ) / ( 2*sqrt(2) ), for the same sequence as
u(n) = 6*u(n-1)-u(n-2), u(0)=1, u(1)=1 .

Sorry if I just repeated something that has already been stated somewhere (for instance there is a lot of related info, with links and references, at http://www.research.att.com/~njas/sequences/A001653 [Broken] ).

Last edited by a moderator: May 2, 2017
14. Jul 15, 2006

### erszega

I have found something that may be well known, and so I would appreciate either a link or reference, or some help towards proving this:

Let
f(n) = a*f(n-1) + b*f(n-2), f(0) = 0, f(1) = 1, and
g(n) = a*g(n-1) + b*g(n-2), g(0) = A, g(1) = B. Then
g(n) = B*f(n) + A*b*f(n-1).

The advantage in this is that once we know the closed form expression for f(n), it is easy to derive the formula for g(n), with any initial values A and B.


text:
Recent questions tagged gate1995

1
Consider a CRT display that has a text mode display format of $80×25$ characters with a $9×12$ character cell. What is the size of the video buffer RAM for the display to be used in monochrome (1 bit per pixel) graphics mode
2
Determine the number of positive integers $(\leq 720)$ which are not divisible by any of $2,3$ or $5.$
3
What is the equivalent minimal Boolean expression (in sum of products form) for the Karnaugh map given below?
4
What is the number of binary trees with $3$ nodes which when traversed in post-order give the sequence $A, B, C ?$ Draw all these binary trees.
5
Consider the relation scheme.$\begin{array}{ll} \text{AUTHOR} & \text{(ANAME, INSTITUTION, ACITY, AGE)} \\\hline \text{PUBLISHER} & \text{(PNAME, PCITY)} \\\hline \text{BOOK} & \text{(TITLE, ANAME, PNAME)} \\ \end{array}$Express the following ... a book for the publisher with PNAME='TECHNICAL PUBLISHERS'. Get the names of all authors who have published a book for any publisher located in Madras
6
Consider the relation scheme $R(A, B, C)$ with the following functional dependencies: $A, B → C,$ $C → A$ Show that the scheme R is in $3NF$ but not in $\text{BCNF}$. Determine the minimal keys of relation $R$.
7
Find the minimum value of $3-4x+2x^2$.
8
Prove that in finite graph, the number of vertices of odd degree is always even.
9
Prove using mathematical induction for $n \geq 5, 2^n > n^2$
10
How many minimum spanning trees does the following graph have? Draw them. (Weights are assigned to edges).
11
Let $G_1$ and $G_2$ be subgroups of a group $G$. Show that $G_1 \cap G_2$ is also a subgroup of $G$. Is $G_1 \cup G_2$ always a subgroup of $G$?.
12
The head of a moving head disk with $100$ tracks numbered $0$ to $99$ is currently serving a request at track $55$. If the queue of requests kept in FIFO order is $10, 70, 75, 23, 65$ which of the two disk scheduling algorithms FCFS (First Come First Served) and SSTF (Shortest Seek Time First) will require less head movement? Find the head movement for each of the algorithms.
13
Consider the following program segment for concurrent processing using semaphore operators $P$ and $V$ for synchronization. Draw the precedence graph for the statements $S_1$ to $S_9$. var a,b,c,d,e,f,g,h,i,j,k : semaphore; begin cobegin begin S1; V(a); V(b) end; begin P(a); S2; V(c); V(d) end; ... end; begin P(g); S6; V(i) end; begin P(h); P(i); S8; V(j) end; begin P(j); P(k); S9 end; coend end;
14
The following is an incomplete Pascal function to convert a given decimal integer (in the range $-8$ to $+7$) into a binary integer in $2's$ complement representation. Determine the expressions $A, B, C$ that complete program. function TWOSCOMP (N:integer):integer; var REM, ... <>0 do begin REM:=N mod 2; BIANRY:=BINARY + B*EXPONENT; EXPONENT:=EXPONENT*10; N:=C end TWOSCOMP:=BINARY end end;
15
An asynchronous serial communication controller that uses a start-stop scheme for controlling the serial I/O of a system is programmed for a string of length seven bits, one parity bit (odd parity) and one stop bit. The transmission rate is $1200$ bits/second. What is the complete bit stream that is transmitted for the string ‘0110101’? How many such string can be transmitted per second?
16
17
Implement a circuit having the following output expression using an inverter and a nand gate $Z=\overline{A} + \overline{B} +C$
18
If the overhead for formatting a disk is $96$ bytes for a $4000$ byte sector, Compute the unformatted capacity of the disk for the following parameters: Number of surfaces: $8$ Outer diameter of the disk: $12$ cm Inner diameter of the disk: $4$ cm ... at $360$ rpm, determine the effective data transfer rate which is defined as the number of bytes transferred per second between disk and memory.
19
Obtain the principal (canonical) conjunctive normal form of the propositional formula $(p \wedge q) \vee (\neg q \wedge r)$ where $\wedge$ is logical and, $\vee$ is inclusive or and $\neg$ is negation.
20
Consider the following sequence of numbers:$92, 37, 52, 12, 11, 25$ Use Bubble sort to arrange the sequence in ascending order. Give the sequence at the end of each of the first five passes.
21
Let $L$ be a language over $\Sigma$ i.e., $L\subseteq \Sigma^*$. Suppose $L$ satisfies the two conditions given below. $L$ is in NP and For every $n$, there is exactly one string of length $n$ that belongs to $L$. Let $L^c$ be the complement of $L$ over $\Sigma^*$. Show that $L^c$ is also in NP.
22
23
Translate the arithmetic expression $a^*-(b+c)$ into syntax tree. A grammar is said to have cycles if it is the case that $A \Rightarrow^+ A$ Show that no grammar that has cycles can be LL(1).
24
Construct the LL(1) table for the following grammar. $Expr \rightarrow \_Expr$ $Expr \rightarrow (Expr)$ $Expr \rightarrow Var\; ExprTail$ $ExprTail \rightarrow \_Expr$ $Expr \rightarrow \lambda$ $Var \rightarrow Id\; VarTail$ $VarTail \rightarrow (Expr)$ $VarTail \rightarrow \lambda$ $Goal \rightarrow Expr$
25
Determine the number of divisors of $600.$ Compute without using power series expansion $\lim_{x \to 0} \frac{\sin x}{x}$
26
A computer installation has 1000k of main memory. The jobs arrive and finish in the following sequences. Job 1 requiring 200k arrives Job 2 requiring 350k arrives Job 3 requiring 300k arrives Job 1 finishes Job 4 requiring 120k arrives Job 5 requiring ... 80k arrives Draw the memory allocation table using Best Fit and First Fit algorithms Which algorithm performs better for this sequence?
27
Consider the following Pascal function where $A$ and $B$ are non-zero positive integers. What is the value of $GET(3, 2)$? function GET(A,B:integer): integer; begin if B=0 then GET:= 1 else if A < B then GET:= 0 else GET:= GET(A-1, B) + GET(A-1, B-1) end; The Pascal procedure given for computing the ... 1 to N - 1 do for J:=1 to N do begin TMP:= A[I, J]; A[I, J]:= A[J, I]; A[J, I]:= TMP end end;
Consider the following high level programming segment. Give the contents of the memory locations for variables $W, X, Y$ and $Z$ after the execution of the program segment. The values of the variables $A$ and $B$ are $5CH$ and $92H$, respectively. Also indicate error conditions if any. var A, B ... integer, (each integer is represented by two bytes) begin X :=A+B Y :=abs(A-B); W :=A-B Z :=A*B end;
A computer system has a $4 \ K$ word cache organized in block-set-associative manner with $4$ blocks per set, $64$ words per block. The number of bits in the SET and WORD fields of the main memory address format is: $15, 40$ $6, 4$ $7, 2$ $4, 6$
Let $\Sigma=\left\{0,1\right\}, L = \Sigma^*$ and $R=\left\{0^n1^n \mid n > 0\right\}$ then the languages $L \cup R$ and $R$ are respectively regular, regular not regular, regular regular, not regular not regular, not regular


text:
ARCHITRAVES

Architraves work to add grandeur to any space reducing miter lines and elevating your look. A great architrave is, above all else, the dressing that’s built to impress

COVES

Coves are commonly used to soften the transition on inside corners but may be used for a wide range of applications.

JAMBS

The top and two sides of a door or window frame that contact the door or sash: top jamb and side jambs.

BACK BANDS

Back bands are used in conjunction with

casing or baseboard to create a wide variety

of trim options for windows and doors

CROWNS

Cap off your look with the perfect crown. A great crown is the royal wrap-up of all your moulding decisions.

PANEL MOULDS

The use of panel or picture moulding can be an effective & inexpensive way to frame wall paneling, paper, fabric, and add interest to walls.

BASEBOARDS

Your look starts here at the foundation of a room. A great baseboard complements a casing and creates a smooth transition from the wall to the

floor, guiding you seamlessly from room to room

CROWN ENHANCERS

A moulding profile designed to be used in conjunction with a crown to increase the overall size and look.

SCREEN MOULDS

Screen mould fits a wide variety of needs and uses. Traditionally used to hold mesh screening into wood screens.

CAPS & SHOES

Baseboard caps are added to the top of regular

baseboard moulding and flush to the wall to create

a finished and more complex architectural moulding.

DOOR STOPS

The door stop mouldings are attached to the door jamb on both sides and at the top. It is where the door comes to a rest when it is closed.

STOOLS

A trim or casing applied immediately below the window sill.

CASINGS

Casings bring a room together left to right, top to bottom. And like any framing element, the options are endless, from build-ups of multiple pieces to full wraps.

FLAT STOCK

Finished boards come in either S4S (Surfaced 4 Sides) or S3S (Surfaced 3 Sides) and are used for a multitude of purposes.

TONGUE & GROOVE

Panels used to decorate or cover a wall, fitted together edge to edge using a slot and ridge on the opposite edge.

CHAIR RAILS

The chair rail runs along the wall, parallel with the baseboard. Adding a refined decor to any space, it’s the

subtle choice that makes a big impact.

HAND RAILS

Hand rails provide safety and support.

MISCELLANEOUS

Astragals

Brick Moulds

Bull Nose

Corner Guards

Dentils

QUICK LINKS

INFORMATION

CONNECT WITH US

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

165 Joey Dr. Elk Grove Village IL, 60007

Tel :  224 - 404 - 6932

View Larger Map

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Copyright © 2020, Ultimate Millwork. All rights reserved.

. . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . .


text:
Showing transitivity of PSPACE?

For the following question:

If B is an element of PSPACE and A is an element of PSPACE-Complete, and A polynomial reduces to B, then B is an element of PSPACE-Complete.

I am trying to prove this, but I don't understand how to get started. Can anyone help please?

If $A$ is PSPACE-Complete, then any $A' \in$ PSPACE can be reduced to $A$ in polynomial time. What can you say about a polynomial time reduction from $A'$ to $B$?


text:
# Recently in Audio Signals Category

## The Sonification Handbook

For those that have not yet heard: The Sonification Handbook edited by Thomas Hermann, Andy Hunt, John G. Neuhoff is published. And, even better, freely available for download here!

## SMC 2012 in Copenhagen!!

9th Sound and Music Computing Conference, 12-14 July 2012
Medialogy section,  Department of Architecture, Design and Media Technology, Aalborg University Copenhagen
http://smc2012.smcnetwork.org/

The SMC Conference is the forum for international exchanges around the
core interdisciplinary topics of Sound and Music Computing,
and features workshops, lectures, posters, demos, concerts, sound installations, and
satellite events. The SMC Summer School, which takes place just before the
conference, aims at giving young researchers the opportunity to
interactively learn about core topics in this interdisciplinary field from experts,
and to build a network of international contacts.
The specific theme of SMC 2012 is "Illusions", and
that of the SMC Summer School is "Multimodality".

================Important dates=================
Deadline for submissions of music and sound installations: Friday, February 3, 2012
Deadline for paper submissions: Monday 2 April, 2012
Notification of music acceptances: Friday, March 16, 2012
Deadline for applications to the Summer School: Friday March 30, 2012
Notification of acceptance to Summer School: Monday April 16, 2012
Deadline for submission of final music and sound installation materials: Friday, April 27, 2012
Notification of paper acceptances: Wednesday 2 May, 2012
SMC Summer School: Sunday 8 - Wednesday morning 11 July, 2012
SMC Workshops: Wednesday afternoon 11 July, 2012
SMC 2011: Thursday 12 - Saturday 14 July, 2012
===========================================

SMC2012 will cover topics that lie at the core of the Sound and Music Computing research and creative exploration.
- processing sound and music data
- modeling and understanding sound and music data
- interfaces for sound and music creation
-music creation and performance with established and novel hardware and software technologies

================Call for papers==================
SMC 2012 will include paper presentations as both lectures and poster/
demos. We invite submissions examining all the core areas of the Sound
and Music Computing field. Submission related to the theme "Illusions" are especially encouraged.
All submissions will be peer-reviewed according to their novelty, technical content, presentation, and
contribution to the overall balance of topics represented at the
conference. Paper submissions should have a maximum of 8 pages
including figures and references, and a length of 6 pages is strongly
encouraged. Accepted papers will be designated to be presented either
as posters/demos or as lectures. More details are available at
http://smc2012.smcnetwork.org/
===========================================

================Call for music works and sound installations==================
SMC 2012 will include four curated concerts addressing the conference topic "Illusions". We invite submissions of original compositions created for acoustic instruments and electronics, novel instruments and interfaces, music robots, and speakers as sound objects. Submissions of sound installation are also encouraged. See curatorial statements and call specifics at: http://smc2012.smcnetwork.org.
==============================================================

## SPARS 2011, day 4

The fourth and final day of SPARS 2011 served up two plenaries by two prodigious reserarchers: Joel Tropp and Stephen Wright. At the beginning of his talk, Tropp asked who in the room knows how MATLAB computes the SVD. Only a few out of about 200 raised their hand, and a few more gestured that they kind of knew. The problem is that the methods we use today are treated as black boxes, but are based on extremely optimized classical methods that are incapable of working with massive matrices (billions by billions and up). So, we need better tools. He presented his work in SVD by a randomized algorithm ... which at first sounds scarily inaccurate, but proves to be extremely effective at a much reduced computational cost.

In the last plenary, Wright presented a lot of work in state of the art methods for regularized optimization. At the beginning, he showed some fantastic pictures that he called an "Atlas of the Null Space," which showed where solutions to min l1 are the same as min l0. His talked centered around the message that though we talk a lot of exact solutions, or sparsest representations, most applications in the real world only need good algorithms that give the correct support before the whole solution. The trick is to determine when to stop an algorithm, and post-process the results to find the better solution.

In between these talks, there were plenty others, discussing various items of interest with dictionary learning, audio inpainting (Po'D coming soon), and several posters, one of which is by CRISSP reader Graham Coleman. He presented his novel work applying l1 minimization of sound feature mixtures to drive concatenative sound synthesis, or musaicing. (I have discussed an earlier version of this work here.) Coleman's approach appears to be the next generation of concatenative synthesis.

All in all, this workshop was an excellent use of my time and money. Its duration was just perfect that after the last session I really felt as if my fuel tank was completely full. The organizers did an extremely nice job of selecting plenary speakers, assembling a wide range of quality work, and finding an accommodating venue with helpful staff. I even heard that the committee was able to raise enough funds so that many of the student participants had their accommodations paid for. I am really looking forward to the 2013 edition of SPARS (or CoSPARS).

## CMP in MPTK: Third Results

In a previous entry, I compared our results with those produced by my own implementation of CMP in MATLAB --- which did not suffer from the bug because it computes the optimal amplitude and phases in a slow way with matrix inverses. Now, with the new corrected code, I have produced the following results. Just for comparison, here are the residual energy decays of my previous experiments, detailed in my paper on CMP with time-frequency dictionaries.

Now, with the corrections, I observe the decays. The "MPold" decay is that produced by the uncorrected MPTK. "MP" shows that of the new code. Only in Attack and Sine do we see much difference; and at times in Sine the previous version of MPTK beats the corrected version. (Such is the behavior of greedy algorithms. I will write a Po'D about this soon.) Anyhow, the decays of CMP-$$\ell$$ (where the number denotes the largest number of possible cycles of refinement, but I suspend refinement cycles when energyAfter/energyBefore > 0.999), comports with the decays I see in my MATLAB implementation (see above). So, now I am comfortable moving on.

Below we see the decays and cycle refinements for three different CMPs for these four signals. (Note the change in the y axes.) Bimodal appears to benefit the most in the short term from the refinement cycles, after which improvement is sporadic. The modeling of Sine has a flurry of improvements. It is interesting to note that as $$\ell$$ increases, we do not necessarily see better models with respect to the residual energy. For instance, for Attack, the residual energy for CMP-1 beats the others.

And briefly back to the glockenspiel signal, below we see the decays and improvements using a multiscale Gabor dictionary (up to atoms with scale 512 samples).

## Grab your things, I've come to take you home!

I have solved the mystery that has pushed me for the past week into excruciatingly fun debugging sessions. Yes, I know I mentioned on June 9 that CMP was extremely easy to implement in MPTK. Then came second thoughts as to the behavior of the implementation. And there followed more observations, and rambling observations, and then the videos appeared. And then the music video appeared. Well, now here's another: ex1_MP_atoms_solved.mov

## Don't Give Up

This is my life the past few days. And yet again, I think I have it cornered. The same thing happens for atoms at the Nyquist frequency. Now, how to fix it?

## People, normalize your signals before you write wavs

MPTK works!

ex1_MP_atoms.mov

In my experiments before, the MP reconstruction algorithm was hard clipping all values with magnitude greater than 1. So that is from where the spikes come. Oh, for F's sakes.

## Some Experiments with Glockenspeil

Today I have been experimenting with CMPTK and a real audio signal. With this larger signal, the energy errors by which I have been plagued this last week seem to be much more rare.

Below we see the residual energy decay of this example with MP and CMPTK using a dictionary of Gabor atoms (Gaussian window) of only two scales: 128/32 and 4906/64/8192 (scale/hop/FFTsize if different from scale). I run 200 iterations. CMP-$$l$$ is implemented such that all representations at each order undergo at least one cycle. When $$l = 5$$, more refinement cycles can be performed until the ratio of residual energies before and after a cycle is less than 1.002, or less than about 0.009 dB. I also plot in this graph, the "cycle energy decrease," which is the ratio of the residual energy before and after the entire refinement at the iteration. We find a few large spikes of improvement. At the end of 200 iterations, the models produced by CMP have an error 2.2 dB better than that produced by MP.

## CMP in MPTK: First Results

From June 7 to 17, I am visiting Rémi Gribonval and other colleagues at L'IRISA (Institut de recherche en informatique et systèmes aléatoires) in Rennes, France, where I am on a scientific mission supported by the French Ambassador to Denmark. My goals this first visit are twofold:
1. implement cyclic MP (CMP) within the MPTK framework;
2. empirically study its application to real audio and music signals.
Before this visit, CMP only existed in the MATLAB backwaters of few esoterics; and there, it is only usable for small dictionaries, and only applied to short signals. We have now finished implementing CMP in MPTK, which required only simple modifications --- no doubt due to the well-thought architecture of the MPTK library. And now begins the more difficult process of determining the cost-benefit trade-offs for CMP and other variants. The plot below shows the first result.

Stay tuned for many more results!

## Andrew Ng's Google talk about unsupervised feature learning and deep learning

In the past few weeks, Pardis and I have been looking at "deep belief networks", and their application to learning features for audio and music classification: DBNs, and convolutional DBNs. I am still completely hazy on the details, but in this talk, Professor Ng provides an excellent overview of the power of such approaches. I think one reviewer's comment summarizes it nicely in one line:

Andrew Ng got bored of improving one algorithm so he decided to improve all algorithms at once...
On his course website at Stanford, Ng provides some tutorials.

These approaches with DBNs --- let the algorithm find the features that make sense with respect to some basic principle of economy (whether it be sparsity or energy) --- makes me think about the recent opinion article by Malcolm Slaney, Does Content Matter? Of course content matters since that is how us expert humans "like" something, e.g., giving a thumbs up on YouTube... I "liked" Ng's talk because of its content and delivery, and not because 52 other people liked it. (Who are the two people that "disliked" Ng's talk!? How could someone not like him?) We just aren't using the best features.

Also note the recent "resurgence" of neural networks!

CRISSP is a research group in ADMT at Aalborg University Copenhagen (AAU-KBH), Denmark.

Authors:

 Bob L. Sturm Sofia Dahl Stefania Serafin


text:
# Why is there no edit option below the question?

This is not the first time but many times I've encountered this problem. There is no 'edit' option below the question as it usually is. Here's the screenshot:

What might be the reason for this?

• From the FAQ on Meta SE, probably the post has a pending suggested edit that has not been reviewed yet (see point no. 4). – user279515 Jul 31 '20 at 4:41
• was this during the recent maintenance, when the site was read only? – J. W. Tanner Jul 31 '20 at 13:32
• @J.W. Tanner, no it was two days ago. However, the problem is solved now. Thanks for your concern. – SarGe Jul 31 '20 at 14:00

As @Brahadeesh notes, the question already had a pending suggested edit, which can be seen from the question's timeline:

You would have been able to see the pending edit if you switch to the responsive mode with the 'full site' link at the bottom of the page.

• -@Glorfindel, but why the edit option is available on full site and not on mobile. I've screenshot of your answer on both modes Mobile and full site – SarGe Jul 31 '20 at 14:14
• @SarGe according to meta.stackexchange.com/q/161023/295232 this is by design. I don't really understand, but the mobile version of the site isn't actively maintained anymore. – Glorfindel Jul 31 '20 at 14:35


text:
# Check if file exists in Python

#### Software Engineering Python

In this article, we have explored different ways to check if a file exists in Python. We have explored 6 different methods to do so in Python:

• try catch block
• isfile()
• isdir()
• exists()
• pathlib
• os.listdir()

Files are used to store information.They have path which determine the location of the file.There are 2 types of paths

1. Absolute Path
2. Relative Path

Absolute Path:
It is the file path which determines the location of the file starting from the root folder of the file system.

Example:
Lets say there is a file named "file.txt" in a folder named "Files" in D Directory then its absolute path will be "D:\Files\file.txt".

Relative Path:
It is the file path which is relative to the current working directory i.e it determines path from current working directory.There are 2 types of dots one is '.' and other is '..'. Here '.' represents this directory and '..' represents parent folder

Example:
Here the relative path of the same file discussed above is defined as "..\Files\file.txt".

We should use try block for using files because there is a possibility of exception due to different scenarios like

• If the file being searched does not exist
• If the file exists and cannot be accessed
• If the file exists during search and deleted before accessing the contents

The most easier way to check whether a file exists or not is by trying to open it within the try block because there is a possibility of occurence of exception.
It leads to IOError Exception when file does not exist.We would like to use try because it avoids Race Condition.

Race Condition:
If we have multiple processes which can access same file and when one process or thread deletes the file,access operation by other process leads to exception.It leads to sudden stopping of execution of program.

try:
f = open("filename.txt")
print("file opened")
except IOError:
print("File not accessible")
finally:
f.close()

Output:
Here it prints file opened if opened successfully otherwise prints File not accessible.

### Other options are

In Python 2 We use different methods in os module to check of the file exists or not.This module allows to access operating system functions.We need to use the path submodule of os module. It consists definitions for different functions like isfile(),isdir(),exists() etc.

From Python 3.4 onwards we use Path object in the pathlib module.

from pathlib import Path
root = Path('/')
root.exists()
root.is_file()

Output:
It prints True if the path contains file or directory for exists() and prints True if the file exists in the given path for is_file.

Before using these methods, the os.path module should be imported.

1. isfile():
It is used to check whether a certain file exists or not.It takes path of the file as parameter and returns True when the file exists and False when the file cannot be found.

import os.path
file_path="/sample/file.txt"
print(os.path.isfile(path))

Output:
It prints True when file exists and False when the file does not exist.

2. isdir():
It is used to check whether a certain directory exists or not.It takes the path of the directory as parameter and returns True when directory is Found and False when directory is not found.

import os.path
dir_path="C/Sample/Games"
if os.path.isdir(dir_path):
print("Directory is found")
else:
print("Directory does not exist")

Output:
It prints Directory is found if directory exists in the given path otherwise prints Directory does not exist.

3. exists():
We can check certain file exists using isfile() and existence of directory using isdir(). But if use to check existence of certain directory using isfile() it returns False and similary if isdir() is used to check existence of file then it returns False.If we want to check the existence of file or directory then exists() is used.

import os.path
print(os.path.exists("this/is/a/directory"))
print(os.path.exists("this/is/a/file.txt"))
print(os.path.exists("not/a/directory/or/file"))

Output:
True
True
False

4. Using pathlib:
From python 3.4 onwards pathlib module is used to check the existence of file or directory.

import pathlib
file = pathlib.Path("sample.txt")
if file.exists ():
print ("File exist")
else:
print ("File not exist")

Output:
File exist

First we have to install pathlib using the following command as

##### pip install pathlib

The os.path module requires function nesting, but the pathlib modules Path class allows us to chain methods and attributes on Path objects to get an equivalent path representation.

It consists of the same functions of os module

• is_file()- checks whether given Path Object is file or not and returns True if file else False
• is_dir()- checks whether given Path Object is directory or not and returns True if it is a directory else False
• exists() - This method is used to check whether the given Path Object points to a file or directory. If it points to a valid file or directory it returns True otherwise False.

## Question

#### Identify the output of the below code

######  import os.path dir_path="C/Sample" print(os.path.is_file(dir_path),end=" ") print(os.path.is_dir(dir_path),end=" ") os.rmdir() print(os.path.exists(dir_path))
False True False
True True False
True False True
False False True
Answer explanation goes here. Only works with HTML

5. Using os.listdir():
It takes path of the directory as parameter and returns list of all files and directories in the specified directory. If we don't specify any directory, then list of files and directories in the current working directory will be returned.

import os
dirpath="C:\\Sample\\Textfiles"
if 'file.txt' in os.listdir('dirpath'):
print("File exists in the directory")
else:
print("File does not exist")

Output:
Prints File exists in the directory if it is present in the given directory otherwise prints File does not exist.


text:
• Create Account

### #ActualLil_Lloyd

Posted 08 February 2013 - 09:26 AM

RENDERING A FRUSTUM

So I found some code on rendering a frustum in old school style fixed pipeline GL

void Frustum::DrawFrustum(){
mat4x4 temp = m_projMatrix * m_modView;
mat4x4 inv = temp._inverse();

vec4 fr[8]=
{
// near
vec4(-1, -1, -1, 1), vec4( 1, -1, -1, 1), vec4( 1,  1, -1, 1),  vec4(-1,  1, -1, 1),
// far
vec4(-1, -1, 1, 1),	vec4( 1, -1, 1, 1),	vec4( 1,  1, 1, 1),  vec4(-1,  1, 1, 1)
};
// Transform all vertices:
// multiply vertex array (fr) by matrix. result is transformed vertex array (tfr)

for(int i = 0; i < 8; i++)
fr[i] = inv * fr[i];

for (int i=0; i<8; i++)
{
fr[i].x /= fr[i].w;
fr[i].y /= fr[i].w;
fr[i].z /= fr[i].w;
fr[i].w = 1.0f;
}

glColor3f(1.0f,0.0f,0.0f);
glBegin(GL_LINES);

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[1][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[2][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[3][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[0][0]));

glVertex4fv(&(fr[4][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[5][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[6][0]));
glVertex4fv(&(fr[7][0]));

glVertex4fv(&(fr[7][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[7][0]));
glEnd();
}

It seems solid to me, and I have a new 'debug' mode where I detach the camera from the frustum and can control it from above in an orthographic view. However, I'm getting behaviour that is odd. There is no frustum being rendered but only odd lines of varying length depending on camera rotation and sometimes the line doesn't even render unless the camera is in a certain location. Bizarre.

### #2Lil_Lloyd

Posted 08 February 2013 - 09:18 AM

RENDERING A FRUSTUM

So I found some code on rendering a frustum in old school style fixed pipeline GL

void Frustum::DrawFrustum(){
mat4x4 temp = m_projMatrix * m_modView;
mat4x4 inv = temp._inverse();

vec4 fr[8]=
{
// near
vec4(-1, -1, -1, 1), vec4( 1, -1, -1, 1), vec4( 1,  1, -1, 1),  vec4(-1,  1, -1, 1),
// far
vec4(-1, -1, 1, 1),	vec4( 1, -1, 1, 1),	vec4( 1,  1, 1, 1),  vec4(-1,  1, 1, 1)
};
// Transform all vertices:
// multiply vertex array (fr) by matrix. result is transformed vertex array (tfr)

for(int i = 0; i < 8; i++)
fr[i] = inv * fr[i];

for (int i=0; i<8; i++)
{
fr[i].x /= fr[i].w;
fr[i].y /= fr[i].w;
fr[i].z /= fr[i].w;
fr[i].w = 1.0f;
}

glColor3f(1.0f,0.0f,0.0f);
glBegin(GL_LINES);

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[1][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[2][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[3][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[0][0]));

glVertex4fv(&(fr[4][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[5][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[6][0]));
glVertex4fv(&(fr[7][0]));

glVertex4fv(&(fr[7][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[7][0]));
glEnd();
}

It seems solid to me, and I have a new 'debug' mode where I detach the camera from the frustum and can control it from above in an orthographic view. However, I'm getting behaviour that is odd. There is no frustum being rendered but only odd lines of varying length depending on camera rotation and sometimes the line doesn't even render unless the camera is in a certain location. Bizarre. I'll try and get a video of it up.

### #1Lil_Lloyd

Posted 08 February 2013 - 09:15 AM

RENDERING A FRUSTUM

So I found some code on rendering a frustum in old school style fixed pipeline GL

void Frustum::DrawFrustum(){
mat4x4 temp = m_projMatrix * m_modView;
mat4x4 inv = glm::inverse(temp);

vec4 fr[8]=
{
// near
vec4(-1, -1, -1, 1), vec4( 1, -1, -1, 1), vec4( 1,  1, -1, 1),  vec4(-1,  1, -1, 1),
// far
vec4(-1, -1, 1, 1),	vec4( 1, -1, 1, 1),	vec4( 1,  1, 1, 1),  vec4(-1,  1, 1, 1)
};
// Transform all vertices:
// multiply vertex array (fr) by matrix. result is transformed vertex array (tfr)

for(int i = 0; i < 8; i++)
fr[i] = inv * fr[i];

for (int i=0; i<8; i++)
{
fr[i].x /= fr[i].w;
fr[i].y /= fr[i].w;
fr[i].z /= fr[i].w;
fr[i].w = 1.0f;
}

glColor3f(1.0f,0.0f,0.0f);
glBegin(GL_LINES);

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[1][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[2][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[3][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[0][0]));

glVertex4fv(&(fr[4][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[5][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[6][0]));
glVertex4fv(&(fr[7][0]));

glVertex4fv(&(fr[7][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[0][0]));
glVertex4fv(&(fr[4][0]));

glVertex4fv(&(fr[1][0]));
glVertex4fv(&(fr[5][0]));

glVertex4fv(&(fr[2][0]));
glVertex4fv(&(fr[6][0]));

glVertex4fv(&(fr[3][0]));
glVertex4fv(&(fr[7][0]));
glEnd();
}

It seems solid to me, and I have a new 'debug' mode where I detach the camera from the frustum and can control it from above in an orthographic view. However, I'm getting behaviour that is odd. There is no frustum being rendered but only odd lines of varying length depending on camera rotation and sometimes the line doesn't even render unless the camera is in a certain location. Bizarre. I'll try and get a video of it up.

PARTNERS


text:
# Fixing quirky typesetting in plot labels

Consider this example plot.

Plot[
1-Exp[-x],
{x,0,3},
AxesLabel->{"thickness (μm)","power density (W/m^2)"}
]

Let us hold the typographical quality of the labels to the standard set by LaTeX. There are four distracting quirks:

1. The "m" in "m^2" is italicized
2. The "2" in "m^2" is set high enough to be above the "m"
3. The parentheses in "(W/m^2)" are comically small
4. The "µ" in "µm" is italicized

Am I entering the labels in the wrong form? How can they be fixed?

-
For the benefit of others reading this: the m^2 should be entered as Superscript[m, 2] (not literally, but using the shortcut — m, Ctrl-6, 2) for the italics to appear as shown in the image above. –  The Toad Apr 3 '12 at 19:30
Mma has \[Micro] for the 10^-6 prefix. It too is somewhat slanted. –  JxB Apr 3 '12 at 19:46
You can switch off SingleLetterItalics like so: mathematica.stackexchange.com/a/5495/363 Then install the style sheet and set it as default: SetOptions[$FrontEnd, DefaultStyleDefinitions -> "newstyle.nb"] – Chris Degnen Feb 15 '13 at 13:52 ## 6 Answers To fix the superscript placement and the italic m, you can use the options ScriptBaselineShifts and SingleLetterItalics in Style. For example Plot[1 - Exp[-x], {x, 0, 3}, AxesLabel -> {"thickness (μm)", Style[Row[{"power density ", Style["(",Larger], "W/m^2", Style[")", Larger]}], ScriptBaselineShifts -> {0, .5}, SingleLetterItalics -> False, "TraditionalForm"]}]  There are some other options in Style that might help. For example if you want a smaller font for the superscript, you can use the option ScriptSizeMultipliers. - Mathematica is not a typesetting engine. If you want proper typography, you should use something that is good at it. Of course, you can wrestle with Mathematica with boxes and stuff to hack it for some cases, but you'll soon find that it breaks the minute you change something or try something more complicated. Jens' and Heike's answers show you how to approach the problem in Mathematica. However, if the end goal is to use it in a$\LaTeX$document, I would highly recommend using EPS figures and psfrags (in latex) to typeset the labels the way you'd like. Here's an example for your case: Export["plot.eps", Plot[1 - Exp[-x], {x, 0, 3}, AxesLabel -> {"xlabel", "ylabel"}]];  Now, in latex, do something like: \documentclass{article} \usepackage{graphicx, psfrag} \begin{document} \begin{figure} \psfrag{xlabel}{thickness$\mu m$} \psfrag{ylabel}{power density$W/m^2$} \includegraphics{plot.eps} \end{figure} \end{document}  which produces the following output: - This one looks the best (except the italics, which are easy to fix), but I like retaining the ability to share plots without first running them through LaTeX, particularly the LaTeX -> dvips -> ps2pdf workflow that pstricks requires. I agree with your first assertion, but don't tell that to Wolfram. See the sensational first sentence here: reference.wolfram.com/mathematica/guide/… – ArgentoSapiens Apr 3 '12 at 20:56 Ok, I have a fix for that. I'll do it when I finish work for the day and ping you about it. – The Toad Apr 3 '12 at 21:15 I too agree with R.M when the question is phrased as a comparison to LaTeX output. What Heike and I are trying to do (if I may speak for Heike) is to show that Mathematica does have a self-contained set of typesetting tools so that we don't have to make LaTeX a requirement for acceptable-looking graphics labels anymore (as indeed it used to be). – Jens Apr 3 '12 at 23:30 I guess it's better to use rm suggestion for standard use. – Herman May 10 '13 at 9:11 Psfrag+eps does not seem to work with Mathematica 10. It encodes even one-letter labels so that Psfrag does not recognize them. – Alexey Bobrick Sep 22 '14 at 17:57 For the µ you'd need an upright Greek font which I don't think Mathematica has (the comments point out that there's \[Micro] which looks a little better but isn't upright). For the other label, you can get slightly better typesetting by doing it the way I suggest in this answer. So you'd simply take your plot as given in the question, highlight the part of the label that says (W/m^2), and then choose the menu item Cell > Convert to > TraditionalForm (or the keyboard shortcut). The result will still have the parentheses too small, so you should delete them. Now you carefully move the cursor into the invisible box that surrounds the fraction and type the parentheses again. If you've typed them inside the TradionalForm box, the parentheses now appear big enough to match the fraction. This is what you get: Finally, we don't like the italics added automatically. But this is now easy to fix by highlighting each unwanted italic and pressing cmd-i: Of course, if you don't want a stacked fraction in the vertical label, you can always go into that invisible box, right to the end, and start deleting backward until only the W is left in that TraditionalForm. Then re-type the fraction the way you like. As you see with the italics, this way of entering typeset equations still leaves something to be desired. Another point that you may want to correct is the size of the superscript. To so that, add the following to your Plot command: BaseStyle -> {ScriptMinSize -> 6}  This will allow the superscript to be made a little smaller. Alternatively, you can highlight whatever character you don't like and press cmd-- to reduce its size interactively. Likewise, you can move the superscript up or down, see the documentation for AdjustmentBox. So below is the plot with all the formatting done as described above (superscript baseline adjusted two steps down with arrow keys ctrl-$\downarrow$). I also added a variable$I$that still gets typeset italicized as it should be. It's also inside the TraditionalForm box. I've included the input in the screen shot to show one important point: the typeset output was achieved while still maintaining a similarly readable typeset input, instead of having lots of styling command obscure the labels in the source code (all the typesetting happened interactively in the TaditionalForm box during input). Afterthought One may say that this interactive way of typesetting is not very "programming-like" (I don't write explicit source code on input). If you want to get a record of what you actually tweaked in those invisible boxes, you can always find that out by copying the whole input line (Plot[...] in its entirety) into a new cell and preceding it by InputForm@Hold@. Then you'll see the input in all its ugliness inside a Hold statement. Or highlight the input cell and use the menu Cell > Convert to > InputForm. - This is a good start. Can it be done without the stacked fraction? – ArgentoSapiens Apr 3 '12 at 19:56 Absolutely. Just go into that invisible box, right to the end, and start deleting backward unti only the W is left in that TraditionalForm. Then re-type the fraction the way you like. I'll add one more thing about making the power smaller. – Jens Apr 3 '12 at 20:02 Accidentally coming across this post, so here I just want to add some supplements about the slanted$\mu$. There is indeed no Mathematica fonts containing upright$\mu\$, but the system does offer method for invoking external fonts. For example using a Windows built-in font Symbol:

ToString[Style[Row[{
Style["m", FontFamily -> "Symbol"],
Style["m", FontFamily -> "Times"]
}], 30], StandardForm]

-

I've been struggling with this too. I ended up doing like what rm -rf suggested, but with a slightly different approach. I'm on a Mac.

1. Use LaTeXiT to create a label with specific font size.
2. Export it as a PDF with outlined fonts.
3. Import it to Mathematica and use it as a label.

If the export format is just 'PDF vector format', Greek symbols can disappear when imported to Mathematica.

The disadvantages of this method are that

1. We need to import PDF files, ie additional hassle.
2. Their sizes are relatively large because of the outlining of fonts.
3. The font of the labels may not match that of the tick numbers (unless, of course, we undertake more matching effort).
4. We need to re-create a label that needs change.

I find them acceptable though, considering that

1. The additional workflow is simple. It's less likely to cause us inconvenience when having to do it many times, compared to, with all due respect, the approaches of Heike and rm -rf above. (Anyway, this is subjective.)
2. The Plot code is free of hacks.

Here is an example.

-

Combining what Heike and Silvia have suggested gives:

Plot[1 - Exp[-x], {x, 0, 3}, AxesLabel -> {Row[{"thickness (",
Style["μ", FontFamily -> "Symbol"], "m)"}], Style[Row[{"power density ", Style["(", Larger],
"W/m^2", Style[")", Larger]}], ScriptBaselineShifts ->{0.5, 0.5}, SingleLetterItalics -> False]}]

The superscripted 2, the italic m and the italic µ are fixed.

-
This trick does not work anymore (with Mathematica 10). The results is the following: !enter image description here –  zut Oct 30 '14 at 11:08


text:
# What is the standard deviation of {1, 1, 1, 3, 3, 3}?

Dec 13, 2015

Standard deviation (population): ${\sigma}_{\text{pop.}} = 1$

#### Explanation:

The mean is clearly $2$

Each value deviates from the mean by $\pm 1$
So the square of each value's deviation from the mean is $1$

and the average of the squared deviations (i.e. the variance, ${\sigma}_{\text{pop.}}^{2}$) is 1

Therefore the standard deviation (assuming the data represents the entire population) is ${\sigma}_{\text{pop.}} = \sqrt{1} = 1$


text:
+0

# A die is rolled 12 times Find the probability of rolling no more than 4 twos

0
593
1

A die is rolled 12 times Find the probability of rolling no more than 4 twos

Guest Apr 29, 2017
#1
+93622
+1

A die is rolled 12 times Find the probability of rolling no more than 4 twos

Each roll is an independent event. So this is binomial probability.

You have to work out the prob of

0 rolls of 2

1 rolls of 2

2rolls of 2

3 rolls of 2

4 rolls of 2

add then all together and subtract the answer from 1.

P(0 rolls of 2)=  $$(\frac{5}{6})^{12}$$

P(1 rolls of 2)=  $$\binom{12}{1}(\frac{1}{6})^1(\frac{5}{6})^{11}$$

P(2rolls of 2)=  etc

P(3 rolls of 2)=

P(4 rolls of 2)=

etc

Melody  Apr 29, 2017


text:
# How do you translate the phrase into a word expression: n divided 3?

I believe you are trying to say "n divided by 3". Your phrase is also already a word expression, so I think you want to translate it into an algebraic expression. In that case, the expression would be $\frac{n}{3}$.


text:
# Probability of a nonnegative integer-valued random variable being zero

I'm trying to teach myself probability theory, and an exercise has me stumped. This exercise comes from Alon & Spencer 4.8, in the chapter on the second moment method.

Let $X$ be a random variable taking values in $\mathbb{Z}_{\geq 0}$. Let $E[X^2]$ denote the expectation of its square. Prove that

$\displaystyle Pr[X=0] \leq \frac{Var[X]}{E[X^2]}$

In particular, they prove in the chapter that this is true by replacing $E[X^2]$ with $E[X]^2$ by using a simple application of Chebyshev's inequality (they set $\lambda$ in the theorem to $E[X]/Var[X]$). However, this bound is easily seen to be tighter, and so it seems I need to come up with a shrewder application of the inequality by redefining the random variable or choosing an appropriate constant.

Any hints?

-
$$P(X=0)=1-P(X \ge 1)$$ $$\frac{\operatorname{Var}(X)}{E(X^2)}=1-\frac{E(X)^2}{E(X^2)}$$ Take conditional expectation and using $E(X \mid X \ge 1)^2 \le E(X^2 \mid X \ge 1)$, calculate both sides and get the result.
You can use $\LaTeX$ on this site. I edited your answer to use it. You could double-check that I didn't mess it up. –  Nate Eldredge Dec 21 '12 at 2:51


text:
# Calculus in a Nutshell

Author
Seth Lewison
View Count
6142
AbstractCalculus in a Nutshell is basically a summary of calculus. I am through power series. Thoughts, comments and edits are appreciated.


text:
# Machine Learning for Scent Prediction

Originally posted 2022-09-10

Tagged: chemistry, machine_learning

Obligatory disclaimer: all opinions are mine and not of my employer

Over the past three years, I’ve been working on a team whose goal is to digitize the sense of smell. We started by building a graph neural network capable of predicting smell from molecular structure, and followed up by trying to understand the structure of smell space. We’re nowhere close to an RGB of odor, but we’ve gotten closer than anybody else so far.

## How do you describe smell, anyway?

Smell is a highly subjective experience, and no two people perceive a smell the same way. Consider vision: humans have a mere three color receptor types, and at least as many types of colorblindness. Humans have hundreds of odor receptor types, and there are probably thousands of uncategorized odor blindnesses.

That’s just on the “hardware” side; on the “software” side, cultural upbringing brings a great deal of nuance to smell. Just like different languages divide color space in different ways, our cultural upbringing heavily influences the way we think about smell. In one mock training session, our experimental collaborator demonstrated a sample of very fresh Pennsylvania hay, which I and the other Asians on my team perceived as an unmistakable green tea! (Apparently, not just us.)

With this level of subjectivity, a consistent ontology of smell is a must. Today’s perfume industry is centered around a few major perfumery schools, nearly all French in origin. As a result, compilations like GoodScents and Leffingwell are mostly consistent in the words they use to catalog the smell of several thousand molecules. These include intuitive words like “orange”, “floral”, and “earthy”, but also more specialized terms like “balsamic”, “orris”, “ambergris”, and “ylang-ylang”.

## In search of the RGB of Odor

What does it mean to digitize the sense of smell? It means that we understand smell well enough to make quantitative predictions about human olfaction.

Using color as a road map, we would want to develop an “RGB of odor”. (Technically, it’s “CIE 1931”, but I’ll say RGB here.) The real RGB is based on our understanding of cone cells and their absorption spectra. As a display of this mastery, we can actually simulate the effects of color-blindness, since we have quantified the absorption spectra of wild-type and color-blind cone cells. We can also pull tricks like fluorescent light bulbs that look white despite their highly unnatural spectra. RGB enables color printers, monitors, and cameras that can be independently calibrated to a standard, allowing for the capture, transmission, and replication of color.

To qualify as a proper “RGB of odor”, an odor encoding should satisfy these key properties:

1. it has a “zero” element corrsponding to olfactory nothingness.
2. it has a scaling rule that lets you predict the smell of different concentrations of a stimulus. Scaling any stimulus down to zero concentration should bring you to olfactory zero.
3. it has a combination rule that lets you predict the smell of a mixture of stimuli.
4. This combination rule should be consistent with the scaling rule: the predicted smell of doubly concentrated odor X should match the predicted smell of a “mixture” of X with itself.
5. it is a sufficient representation, meaning that it is sufficient to know the “odor RGB coordinates”, regardless of the chemical composition used to achieve it.
6. it reflects the underlying biological reality of receptors, and makes nontrivial predictions about odor blindnesses or parosmias.

The standard chemical equilibrium model (see Appendix) is minimal and consistent with all of these desiderata. The derivation is quite simple and depending on your background, Michaelis-Menten kinetics, Langmuir isotherms, Hill equations, or statistical mechanics would all lead you there. While I derived this independently in late 2019, the earliest reference to these ideas that I can find is Alex Koulakov’s papers circa 2018. Koulakov’s papers have a compressed sensing flavor, popular with physicists, but a modern deep learning take would probably be more productive in practice.

Another complication, which may be incompatible with #5, is the time-dependence of odors. I don’t have a citation, but I’m reasonably sure that the reason farts dissipate over time is not dilution or habituation, but chemical oxidation in air. That’s an Ig Nobel waiting for anyone who wants to validate my claim :). The olfactory epithelium is also equipped with a variety of cytochrome enzymes for breaking down foreign substances. In my opinion, there’s a decent chance that the chemical composition of an odor is irreducibly complex.

## From Theory to Practice

Three years ago, we took the Goodscents and Leffingwell datasets and trained a graph neural network to predict odor labels. Frankly, trying to back out an RGB of odor from this dataset is stupid. It’s like trying to rederive CIE 1931 from the XKCD color survey. But ultimately, you train a model with the dataset you have, not the dataset you might want or wish for.

We found that our models could predict odor labels better than traditional computational techniques, by a small but consistent margin. Did this mean our models were useful in practice? Would these results hold in the real world?

To answer these questions, we selected and purchased 400 molecules, and asked a panel of human raters to tell us what each molecule smelled like.

In making this jump, we faced every conceivable out-of-domain problem. Our training data was limited to perfumery ingredients, whereas our selections came from a commercial chemical catalog, with a heavy nitrogenous bias. Our training data was labelled by professional perfumers, whereas our test set would be labelled by amateur panelists of diverse backgrounds, without the benefit of perfumery school to learn what these words meant. To make it even harder, we intentionally selected molecules to span the breadth of structural space as well as perceptual space.

You might be wondering about safety: see my sketch of how to estimate exposure, which can be cross-referenced with OSHA exposure limits. In short, you shouldn’t drink gasoline, but it’s harmless to get a whiff of it.

My colleague, Dr. Emily Mayhew, was indispensible in designing and managing the human trials. She anticipated and answered questions like “How do we ensure our panelists are using the rating scale in a consistent manner? How do we avoid olfactory fatigue, or for that matter, how do we know they haven’t caught COVID and developed anosmia?”. For my part, I designed and ran the molecule selection process, removing molecules like the explosive HOBt from our study - the chemical equivalent of “tech debt” which might have ended up in an unexpected 💥 several years down the road.

After collecting 18 raters X 400 molecules X 55 odor descriptors X 2 replicates = roughly 700,000 data points, we found that our model continued to outperform traditional chemoinformatic techniques by a small but consistent margin. Additionally, the model made predictions that were within the experimental intra-rater variation, about on par with the median human panelist.

Mission accomplished, as a Dubya from Texas would say.

## Most olfactory data is crap

… and ours was unfortunately no exception. We managed to dodge nearly every possible bullet, but in the end, we got hit by one. If you use our data, please, please read the GC-O notes!

GC-olfactometry is a time-consuming analytic technique that isolates and identifies the individual odors within a mixture. It’s primarily used within the fragrance industry to reverse engineer perfume recipes. It works by separating a mixture with gas chromatography, then piping the output into a human nose, who takes notes on the odor quality of the airstream!

Applying GC-O to 50 of our 400 tested molecules, we found that about a third of tested bottles had smells that were not attributable to the molecule on the bottles’ label! That’s because even if the bottle is 99% pure in the bulk liquid/solid phase, contaminants can have significantly different vapor pressures and odor intensity, causing the airspace to be dominated by contaminants.

The bottom line: our model was making prediction based on the bottle’s claimed contents, whereas our human raters were rating smells based on the bottle’s true contents! And yet our models’ predictions matched the panelists decently well, not doing significantly better or worse on the contaminated samples.

There are a few possible interpretations here:

1. impurities are structurally related to and smell similarly to the nominal compound. Many detected impurities were synthetic precursors and/or decomposition products of the nominal compound, for example.
2. the training data also contains impure samples, and our model implicitly learned patterns of contamination. Many alkynes smelled phosphorous-garlicky, possibly as a consequence of acetylene production from calcium carbide sources with calcium phosphide contaminant.
3. our panelists are noisier than we’d like, making the “on-par with humans” claims a lot less impressive.

I think all three are at play here. With careful controls, we ruled out a fourth possibility - that our scoring function was unfairly rewarding the dense vector predictions of our models relative to the sparse human rating vectors.

In retrospect, the “correct” way to prepare unknown materials for testing is to distill them, as this will specifically remove impurities of significantly differing volatility. Given how much effort went into this study, it would have been well worth dusting off my lab coat and spending a month in lab purifying every single molecule!

## How close did we get to an RGB for odor?

Notably missing, from both our training and human test data, is any notion of odorant concentration! Molecules in the GoodScents/Leffingwell training data are presented at whatever concentration reveals the “characteristic odor” of the molecule, and molecules in our human study are manually intensity-balanced in a similar fashion. That’s how the GoodScents/Leffingwell training data was collected, and accordingly, our model wouldn’t even know how to use concentration.

The lack of concentration-dependence cripples our GNN-derived embedding space. It’s capable of making similarity judgments (cosine distance between vectors), but it lacks the concentration and mixture modeling that are key to an RGB for odor.

In my opinion, the careful concurrent design of mixture data collection, neural network architecture, and optimization techniques will move us closer to the discovery of an RGB for odor. Some amount of odor receptor modeling would be useful; it seems doable to run docking simulations for 1,000 odorants * 100 odor receptors.

### Appendix: Standard chemical equilibrium model (statistical mechanics derivation)

Model the nose as being a set of receptors. For any given receptor $$\rho_i$$, consider its simultaneous interaction with any number of odorants $$\omicron_j$$. The chemical potential of each receptor-odorant combination, $$\mu_{ij}^\circ$$, measures the strength of the receptor-odorant interaction relative to the unbound receptor. We can adjust the chemical potential by the concentration of the species: $$\mu_{ij} = \mu_{ij}^\circ + \ln[\omicron_j]$$. The partition function of receptor states is $$Z = 1 + \sum_i e^{\mu_i}$$, and the quantity $$1- \frac{1}{Z}$$ represents the activation percent of the receptor. The vector of all receptors’ activation percents forms an “RGB of odor” that follows all listed criteria. You can imagine creating variants of this model for all sorts of competitive/noncompetitive agonism, although this would require 2x or 3x as many free parameters. A subsequent function would map from receptor activation to human percept.


text:
• Subject:

...

• Topic:

...

Observe the following reaction :

Which of the following is the correct order of acid strength :

 (1) (2) (3) (4)