text:
# Simple tokenizer v1 - reading char by char

I was feeling like writing a new Uri parser. The previous one was too limited and wasn't able to parse the authority part. This one is also based on the pretty image here and can tokenize all parts. I drew the image as an ascii art below.

follow-up

## Core

The implementation has a single method Tokenize that is the state-machine. It's so short that I thought it's not necessary to move any functionality into other methods (would you agree?).

This is inspired by the Tutorial: Write a Finite State Machine to parse a custom language in pure Python. However, I find the original implementation was too complex for C# because we can define states and their transitions in a more convenient way with tuples, attributes and a little bit of reflection. So I use the PatternAttribute to decorate each token of an enum. Later, State<TToken> uses them with an enum reflection to try to match the current char.

State<TToken> and Token<TToken> are generic because I'm going to use this also for parsing of command-line arguments.

The process starts with the first state on the list. Would you say this is fine or should I create one more state for this like Start or NewUri etc.? The linked examples does that.

public static class Tokenizer
{
public static IEnumerable<Token<TToken>> Tokenize<TToken>(string value, IEnumerable<State<TToken>> states, Func<Token<TToken>> createToken)
{
states = states.ToList(); // Materialize states.

var state = states.First();
var token = createToken();
token.Type = state.Next;

foreach (var (oneChar, index) in value.Select((c, i) => (c.ToString(), i)))
{
// The state matches itself.
if (state.IsMatch(oneChar))
{
token.Text.Append(oneChar);
}
else
{
var isMatch = false;
// Find states where the current one is Prev.
foreach (var next in states.Where(s => s.Prev.Equals(token.Type)))
{
// There is a match. Use this state from now on.
if ((isMatch = next.IsMatch(oneChar)))
{
// Initialize the new token.
token = createToken();
token.StartIndex = index;
token.Type = next.Next;
token.Text.Append(oneChar);
state = next;
// Got to the next character.
break;
}
}

// There was no match. This means the current char is invalid.
if (!isMatch)
{
throw new ArgumentException($"Invalid character at: {index}."); } } } // Yield the last token. if (token.Text.Length > 0) { yield return token; } } } public class PatternAttribute : Attribute { private readonly string _pattern; public PatternAttribute([RegexPattern] string pattern) => _pattern = pattern; public bool IsMatch(string value) => Regex.IsMatch(value, _pattern); } public class State<TToken> { public TToken Prev { get; set; } public TToken Next { get; set; } public bool IsMatch(string value) { return typeof(TToken) .GetField(Next.ToString()) .GetCustomAttribute<PatternAttribute>() .IsMatch(value); } public override string ToString() =>$"<-- {Prev} | {Next} -->";
}

public class Token<TToken>
{
public int StartIndex { get; set; }

public StringBuilder Text { get; set; } = new StringBuilder();

public TToken Type { get; set; }

public override string ToString() => \$"{StartIndex}: {Text} ({Type})";
}

## UriStringTokenizer

I encapsulate the raw API with my UriStringTokenizer to make easier to use. It defines all tokens and state transitions.

public static class UriStringTokenizer
{
/*

scheme:[//[userinfo@]host[:port]]path[?key=value&key=value][#fragment]
[ ----- authority ----- ]     [ ----- query ------ ]

scheme: ------------------------- path -------------------------  --------- UriString
\                         /    \                         /\         /
// --------- host ---- '/'     ?key ------ &key ------ /  #fragment
\         /    \     /           \      /    \      /
userinfo@      :port             =value      =value

*/

public static readonly ICollection<State<UriToken>> States = new (UriToken Prev, UriToken Next)[]
{
// self

(Scheme, Scheme),
(UserInfo, UserInfo),
(Host, Host),
(Port, Port),
(Path, Path),
(Key, Key),
(Value, Value),
(Fragment, Fragment),

// transitions

(Scheme, SchemeSuffix),
(SchemeSuffix, Path),
(SchemeSuffix, AuthorityPrefix),
(AuthorityPrefix, UserInfo),
(AuthorityPrefix, Host),
(UserInfo, UserInfoSuffix),
(UserInfoSuffix, Host),
(Host, PathPrefix),
(Host, PortPrefix),
(PortPrefix, Port),
(Port, PathPrefix),
(PathPrefix, Path),
(Path, KeyPrefix),
(KeyPrefix, Key),
(Key, ValuePrefix),
(ValuePrefix, Value),
(Value, KeyPrefix),
(Key, FragmentPrefix),
(Value, FragmentPrefix),
(FragmentPrefix, Fragment)

// --
}.Select(t => new State<UriToken> { Prev = t.Prev, Next = t.Next, }).ToList();

public static IEnumerable<Token<UriToken>> Tokenize(string value)
{
}
}

public enum UriToken
{
[Pattern(@"[a-z]")]
Scheme,

[Pattern(@":")]
SchemeSuffix,

[Pattern(@"\/")]
AuthorityPrefix,

[Pattern(@"[a-z]")]
UserInfo,

[Pattern(@"@")]
UserInfoSuffix,

[Pattern(@"[a-z]")]
Host,

[Pattern(@":")]
PortPrefix,

[Pattern(@"[0-9]")]
Port,

[Pattern(@"\/")]
PathPrefix,

[Pattern(@"[a-z]")]
Path,

//QueryPrefix,

[Pattern(@"[\?\&]")]
KeyPrefix,

[Pattern(@"[a-z]")]
Key,

[Pattern(@"=")]
ValuePrefix,

[Pattern(@"[a-z]")]
Value,

[Pattern(@"#")]
FragmentPrefix,

[Pattern(@"[a-z]")]
Fragment,
}

## Tests

Tests that I created are all green.

using static UriToken;

public class UriStringParserTest
{
[Fact]
public void Can_tokenize_full_URI()
{
// Using single letters for easier debugging.
var uri = "s://u@h:1/p?k=v&k=v#f";
var tokens = UriStringTokenizer.Tokenize(uri).ToList();

var expectedTokens = new[]
{
Scheme,
SchemeSuffix,
AuthorityPrefix,
UserInfo,
UserInfoSuffix,
Host,
PortPrefix,
Port,
PathPrefix,
Path,
KeyPrefix,
Key,
ValuePrefix,
Value,
KeyPrefix,
Key,
ValuePrefix,
Value,
FragmentPrefix,
Fragment
};

Assert.Equal(expectedTokens, tokens.Select(t => t.Type).ToArray());

var actual = string.Join("", tokens.Select(t => t.Text));

Assert.Equal(uri, actual);
}

[Theory]
[InlineData("s://u@h:1/p?k=v&k=v#f")]
[InlineData("s://u@h:1/p?k=v&k=v")]
[InlineData("s://u@h:1/p?k=v")]
[InlineData("s://u@h:1/p")]
[InlineData("s:///p")]
public void Can_tokenize_partial_URI(string uri)
{
// Using single letters for faster debugging.
var tokens = UriStringTokenizer.Tokenize(uri).ToList();
var actual = string.Join("", tokens.Select(t => t.Text));
Assert.Equal(uri, actual);
}

[Fact]
public void Throws_when_invalid_character()
{
var uri = "s://:u@h:1/p?k=v&k=v#f";
//             ^ - invalid character

var ex = Assert.Throws<ArgumentException>(() => UriStringTokenizer.Tokenize(uri).ToList());
Assert.Equal("Invalid character at: 4.", ex.Message);
}
}

### Questions

Did I do anything terribly wrong? Does this solution have any obvious flaws that I have missed? How else would you improve it?

I use only basic patterns here because I was focused on the API and the state-machine. I will extend them later to match all characters that are valid for a Uri and its parts.

You can consider the input of the Tokenize method as already properly % encoded.

## State Machine Review

This is an interesting, yet unorthodox implementation of a state machine. Your states are actually transitions. You don't really have a state, since the state machine (Tokenize method) processes input and performs all lifetime management of tokens itself. The only behavior dispatched to the transitions (unfortunately named State) is asking whether a match is available (IsMatch).

The problem with this approach, as VisualMelon has stated, is that you are walking each character at a time, which could lead to the wrong transition firing. The resolve this, you need to allow for look-ahead, and possibly also for backtracking. Rather than letting Tokenize traverse the input, you should let the current state handle the input. Each state is responsible for consuming as much characters it can. To allow this, wrap the input in a stream that supports look-ahead. Either create such class or use an existing API such as ANTLRInputStream.

Each state should have its own StringBuilder for building the current token. Once a token is completely built, create a token from the builder and store its result as immutable string in the result set of tokens.

The input of transitions should be cached, not in a global list, but dispatched to each state. Let each state store its own transitions (where transition.From == state). Whenever the state machine tells a state to process and cosume the input, the state should check its transitions whether a transition to a next state should be triggered. The self-transitions could be removed from the input and added in each state by default.

Creation of tokens and completing tokens should not be part of the state machine, but of entry and exit operations of the individual states. The state machine should only set the initial state and let that state consume the input. Whenever a transition fires from within a state, the state machine should set the current state to transition.To. The state machine should keep feeding the current state with the input until it's been completely processed.

As an overview:

• let the state machine create the states and dispatch the provided transitions to each state
• let the state machine set the initial state and feed the input to the current state
• let each state create a token builder on entry
• let each state process the input from current position and consume as much tokens possible
• let each state check for transitions that could fire
• let the state machine set the current state after a transition fired
• let each state create a token from token builder on exit and store it in the result set

## General Review

If you're materializing the states, why allowing the argument to be possibly lazy (IEnumerable)?

states = states.ToList(); // Materialize states.

Picking the initial state is by convention the first state. This should be well documented. Another option is provide a pseudo initial state with initial transitions. This way, you allow for multiple possible initial states (if more than just Scheme could start an URI, or when you want to reuse the API for other purposes).

var state = states.First();

The single character loop has been discussed by VisualMelon, and I have suggested an alternative where each state should consume the input stream at own expense.

foreach (var (oneChar, index) in value.Select((c, i) => (c.ToString(), i)))

A state machine should not need to care about handling actions on state and/or transition changes. Let states handle entry and exit (Moore machine). And let transitions handle their transition guard and optionally action (Mealy machine). UML specifies both Moore and Mealy support.

if (state.IsMatch(oneChar))
{
token.Text.Append(oneChar);
}

Each state should have its own transitions, so this global lookup should no longer be required:

foreach (var next in states.Where(s => s.Prev.Equals(token.Type)))

The following part should be split into entry and exit behavior of the current state.

token = createToken();
token.StartIndex = index;
token.Type = next.Next;
token.Text.Append(oneChar);

On entry: create a token and token text builder, store the index, type. On exit: set the token builder's result as Text on the token and add the token to the result set.

• digesting... but this much more complex then I expected it to be/have o_O I'm still not convinced that this is the only right way... I'll do it my way ;-P at least I'll try... this will be the lookahead... I migh have to backtrack later lol – t3chb0t Aug 24 '19 at 15:18
• When the behavior is well distributed over states and transitions, you can make a mature API for modelling many and complex use cases. You should at least taste such pattern ;-) – dfhwze Aug 24 '19 at 15:22
• I have rewritten my tokenizer by implementing many of your suggestion. I'm not sure you'll be proud of me however :-P some parts may still be unorthodox. – t3chb0t Aug 25 '19 at 8:14
• I am happy you considered my approach :p Now I have to rewrite my change trackers according to your suggestions! o_0 – dfhwze Aug 25 '19 at 8:15

This isn't exhaustive, because I don't have much time now, so I might add some more later.

As I said in a comment, I don't buy the idea of looping over one char at a time: it's not documented that the patterns should match exactly one character, and it complicates the definitions of things like Scheme, which could be [a-z]+ and everyone would be happy. Of course, anytime you allow the user to use non-trivial regexes you have to take precautions, but this would allow things like look-aheads which could be useful.

My main complaint would be that it means you can't realisticly parse surrogate pairs, and if you expect to use this for anything other than URL-encoded URIs, then I think you need something more powerful. You could of course deal with surrogate pairs specifically, but that would just add complexity.

It also means that comments like // Using single letters for easier debugging are somewhat frighening, because they fail to test that the thing copes with non-single-length tokens. Most importantly, AuthorityPrefix appears to be required to be //, but your system will match / as well: this would require two states to parse one-char-at-a-time.

This seems like a grand oportunity to exploit the Regex.Match(string, int) overload, and parse the whole token at once, which may even simplify the implementation. I'll leave you the fun of implementing it... ;)

I don't like this:

foreach (var next in states.Where(s => s.Prev.Equals(token.Type)))

You should build a dictionary of prev/next pairs so that this things can hope with large numbers of transitions.

I'd be inclined to make Tokenize an instance member, so you can initialise a Tokenizer and reuse it. In my opinion this would provide a clearer API, and would make it easier to extend in future.

I'm not wild about Token having a StringBuilder. Rather, it looks like a good candidate for an immutable class with a string. This would complicate the token creation.

Either way, you should initialize the first token fully: there is no guarentee that createToken will set the StateIndex to 0.

It would be nice if the invalid character exception gave some more information (e.g. what the current state is, how much has already been parsed).

State.Next is a confusing name: I think this is what dfhwze was getting at in the comments: all your states are tied to a transition, and the naming goes a bit funky as a result.

The implemention of State.IsMatch is horrifying! I have no complaint with reflection, but this really should be cached, and you should probably build a single Regex object to reuse. Pre-loading the pattern would also create an exception somewhere useful (when the State is initialised) rather than when it is used. I also don't like that State is tied to the "enum with attribute" pattern: I'd rather it just had a regex attached, and a static method was provided to build it from the "enum with attribute" pattern. This would make the thing much more reusable. I'd actually be inclined to make IState (or whatever you call the thing that does the matching) an interface, so that it is completely general.

• this is pretty convincing ;-] back to the drawing board – t3chb0t Aug 24 '19 at 14:00
• Wait for my addendum on this fine answer, or it's back to the drawing board again :p – dfhwze Aug 24 '19 at 14:17


text:
Home > Patterns > Misunderstandings > Rectangular grids

# Rectangular grids

This rectangular grid is filled with 12 identical squares, with no spaces between them.

A 3 $$\times$$ 4 rectangular grid.

That same rectangular grid can be seen as three rows of four squares.

The three rows of the grid.

It can also be seen as four columns of three squares.

The four columns of the grid.

A rectangular grid is therefore a repeating pattern in two ways.

The rectangular grid can be a most valuable aid in early mathematics learning.

• It incorporates many spatial concepts (square, rectangle, congruence, collinearity, parallels and perpendiculars).
• It can provide an introduction to multiplication.
• Counting the number of squares leads to skip counting (4, 8, 12 and 3, 6, 9, 12 in the above grid).
• Counting the number of squares also leads to multiplication (4 $$\times$$ 3 = 12 and 3 $$\times$$ 4 = 12).
• This counting eventually leads to the formula for the area of a rectangle.
• It can be used to illuminate many multiplication, division and fraction situations.

The structure of the rectangular grid will not be immediately obvious to many students so it is important to teach it explicitly.

## Structure of rectangular grids

Textbooks often use rectangular grids to illustrate multiplication, area and fractions. But research shows that young students may not understand the structure of rectangular grids.

## Drawing rectangular grids

There are many practical and enjoyable drawing activities through which students can learn the structure of the rectangular grid.

## Rectangular arrays

By studying rectangular arrays, students can also learn the structure of the rectangular grid pattern.

format: plain


text: Wikimedia From Equations \ref{4} and \ref{2.6.0}, $$Z_{eff}$$ for a specific electron can be estimated is the shielding constants for that electron of all other electrons in species is known. Thus the effective nuclear charge (ENC) for silicon In other words, penetration depends on the shell ($$n$$) and subshell ($$l$$). ; & Bursten, Bruce (2002). Wiktionary Covalent atomic radii can be determined for most of the nonmetals, but how do chemists obtain atomic radii for elements that do not form covalent bonds? Z In fact, the effective nuclear charge felt by the outermost electrons in cesium is much less than expected (6 rather than 55). Consequently, the size of the region of space occupied by electrons decreases and the ion shrinks (compare Li at 167 pm with Li+ at 76 pm). The van der Waals radius (rvdW) of an element is half the internuclear distance between two nonbonded atoms in a solid. $$Z_{eff}$$ can be calculated by subtracting the magnitude of shielding from the total nuclear charge and the effective nuclear charge of an atom is given by the equation: where $$Z$$ is the atomic number (number of protons in nucleus) and $$S$$ is the shielding constant. Because of these two trends, the largest atoms are found in the lower left corner of the periodic table, and the smallest are found in the upper right corner (Figure $$\PageIndex{4}$$). While there are more protons in a cesium atom, there are also many more electrons shielding the outer electron from the nucleus. cationA positively charged ion, as opposed to an anion. http://en.wiktionary.org/wiki/valence_shell, http://en.wikipedia.org/wiki/Valence_shell_electron_pair_repulsion_theory, http://www.boundless.com//chemistry/definition/effective-nuclear-charge, http://www.boundless.com//chemistry/definition/core-electrons, http://en.wikibooks.org/wiki/High_School_Chemistry/Atomic_Size, http://en.wikibooks.org/wiki/General_Chemistry/Periodicity_and_Electron_Configurations, http://en.wikipedia.org/wiki/Shielding_effect, http://en.wikipedia.org/wiki/Effective_nuclear_charge, http://commons.wikimedia.org/wiki/File:Effective_nuclear_charge_diagram.svg, https://www.boundless.com/chemistry/textbooks/boundless-chemistry-textbook/. The effective nuclear charge (often symbolized as The effective nuclear charge (often symbolized as Z eff or Z*) is the net positive charge experienced by an electron in a multi-electron atom. Determine the relative sizes of the ions based on their principal quantum numbers, To understand the basics of electron shielding and penetration, $$Z_\mathrm{eff}(\mathrm{F}^-) = 9 - 2 = 7+$$, $$Z_\mathrm{eff}(\mathrm{Ne}) = 10 - 2 = 8+$$, $$Z_\mathrm{eff}(\mathrm{Na}^+) = 11 - 2 = 9+$$, $$Z_\mathrm{eff}(\mathrm{Na}^-) = 11 - 2 = 7+$$, $$Z_\mathrm{eff}(\mathrm{Na}) = 11 - 2 = 8+$$. Although the radii values obtained by such calculations are not identical to any of the experimentally measured sets of values, they do provide a way to compare the intrinsic sizes of all the elements and clearly show that atomic size varies in a periodic fashion (Figure $$\PageIndex{3}$$). Place the values for Z and S into the effective nuclear charge formula: In the above example for Na: 11 − 8.8 = 2.2. The sizes of the ions in this series decrease smoothly from N3− to Al3+. We use the simple assumption that all electrons shield equally and fully the valence electrons (Equation \ref{simple}). Use the simple approximation for shielding constants. Penetration describes the proximity to which an electron can approach to the nucleus. So the sodium cation has the greatest effective nuclear charge. As the distance between an electron and the nucleus approaches infinity, $$Z_{eff}$$ approaches a value of 1 because all the other ($$Z − 1$$) electrons in the neutral atom are, on the average, between it and the nucleus. The peak for the filled n = 1 shell occurs at successively shorter distances for neon (Z = 10) and argon (Z = 18) because, with a greater number of protons, their nuclei are more positively charged than that of helium. which is half the distance between the nuclei of two like atoms joined by a covalent bond in the same molecule, Atomic radii are often measured in angstroms (Å), a non-SI unit: 1 Å = 1 × 10. has atomic number 14 and electron configuration: The n = 3 shell is the valence If the outermost electrons in cesium experienced the full nuclear charge of +55, a cesium atom would be very small indeed. b. effective nuclear charge increases down a group c. both effective nuclear charge increases down a group and the principal quantum number of the valence orbitals increases d. effective nuclear charge zigzags down a group e. effective nuclear charge decreases down a group 0; there are no electrons higher (or to the right in the electronic configuration). The term "effective" is used because the shielding effect of negatively charged electrons prevents higher orbital electrons form experiencing the full nuclear charge of the nucleus due to the repelling effect of inner-layer electrons. In a similar approach, we can use the lengths of carbon–carbon single bonds in organic compounds, which are remarkably uniform at 154 pm, to assign a value of 77 pm as the covalent atomic radius for carbon. Write the electron configuration of the element in the following order and groupings: (1s) (2s, 2p) (3s, 3p) (3d) (4s, 4p) (4d), (4f), (5s, 5p), (5d), (5f). CC BY-SA 3.0. http://en.wikibooks.org/wiki/General_Chemistry/Periodicity_and_Electron_Configurations Asked for: arrange in order of increasing atomic radius. Unless otherwise noted, LibreTexts content is licensed by CC BY-NC-SA 3.0. Consequently, we must use approximate methods to deal with the effect of electron-electron repulsions on orbital energies. Effective nuclear charge refers to the charge felt by the outermost (valence) electrons of a multi-electron atom after taking into account the number of shielding electrons that surround the nucleus. Determine the relative sizes of elements located in the same column from their principal quantum number. Nuclear charge is the electric charge of a nucleus of an atom, equal to the number of protons in the nucleus times the elementary charge. In this section, we discuss how atomic and ion “sizes” are defined and obtained. We also acknowledge previous National Science Foundation support under grant numbers 1246120, 1525057, and 1413739. CC BY-SA 3.0. http://en.wikipedia.org/wiki/Effective_nuclear_charge This online chemistry calculator calculates the effective nuclear charge on an electron. Brown, Theodore; LeMay, H.E. For example, a 1s electron (Figure $$\PageIndex{3}$$; purple curve) has greater electron density near the nucleus than a 2p electron (Figure $$\PageIndex{3}$$; red curve) and has a greater penetration. Wiktionary by the symbol [Ne] comprise the core electrons for sulfur as for silicon. For all elements except H, the effective nuclear charge is always less than the actual nuclear charge because of shielding effects. Figure $$\PageIndex{1}$$ illustrates the difficulty of measuring the dimensions of an individual atom. Douglas Hartree defined the effective Z of a Hartree–Fock orbital to be: Updated effective nuclear charge values were provided by Clementi et al. On the basis of their positions in the periodic table, arrange these elements in order of increasing atomic radius: aluminum, carbon, and silicon. WebElements: THE periodic table on the WWW [www.webelements.com] The shielding effect explains why valence shell electrons are more easily removed from the atom. What is the effective attraction $$Z_{eff}$$ experienced by the valence electrons in the three isoelectronic species: the fluorine anion, the neutral neon atom, and sodium cation? CC BY-SA 3.0. http://www.boundless.com//chemistry/definition/effective-nuclear-charge Do not include a value of the electron of interest. A similar approach for measuring the size of ions is discussed later in this section. For a given value of n, the ns orbital is always lower in energy than the np orbitals, which are lower in energy than the nd orbitals, and so forth. For ions that do not form an isoelectronic series, locate their positions in the periodic table. Instead, elements that are next to each other tend to form ions with the same number of electrons but with different overall charges because of their different atomic numbers. All have a filled 1s2 inner shell, but as we go from left to right across the row, the nuclear charge increases from +3 to +10. All rights reserved. As a result, the electron cloud contracts and the atomic radius decreases. The $$Z_{eff}$$ in Table $$\PageIndex{1}$$ for $$Z_\mathrm{eff}(\mathrm{Na}$$ is 10.63 and appreciables larger than the 8 estimated above. Electrons in the same principal shell are not very effective at shielding one another from the nuclear charge, whereas electrons in filled inner shells are highly effective at shielding electrons in outer shells from the nuclear charge. A We see that S and Cl are at the right of the third row, while K and Se are at the far left and right ends of the fourth row, respectively. CC BY-SA 3.0. http://en.wiktionary.org/wiki/nucleus Carbon and silicon are both in group 14 with carbon lying above, so carbon is smaller than silicon (C < Si). Sulfur however, has six valence electrons. The effective nuclear charge experienced by the electron is also called the core charge. Each species has 10 electrons, and the number of nonvalence electrons is 2 (10 total electrons - 8 valence), but the effective nuclear charge varies because each has a different atomic number $$A$$. Let's write the electron configurations Effective nuclear charge refers to the charge felt by the outermost (valence) electrons of a multi-electron atom after the number of shielding electrons that surround the nucleus is taken into account. atom and to divide these electrons between sets of core electrons and The effective nuclear charge on an electron is given by the following equation: where Z is the number of protons in the nucleus (atomic number), and S is the number of electrons between the nucleus and the electron in question (the number of nonvalence electrons). This also suggests that $$\mathrm{Na}^+$$ has the smallest radius of these species and that is correct. are assigned 0.85 units of nuclear charge. Because it is impossible to measure the sizes of both metallic and nonmetallic elements using any one method, chemists have developed a self-consistent way of calculating atomic radii using the quantum mechanical functions. an outer electron experiences as a result of the partial screening of Each peak in a given plot corresponds to the electron density in a given principal shell. CC BY-SA 3.0. http://www.boundless.com//chemistry/definition/core-electrons


text:
# Absorbing state for a collection of random walks

Further to this question; having learned some stuff since I posed it.

Consider a collection of random walks $X_i$ which take finite integer values. These evolve as time-inhomogeneous Markov Chains.

Consider $Y=\sum X_i$; this is clearly a (more complex) random walk: the "Super Walk"!

If we set any states of $Y$ where $Y<y$ as absorbing states, I feel that this could be modeled by creating an absorbing state in each $X_i$ and transitioning to this state based on the status of the Super Walk.

How would the transition matrices work for this?

To give a concrete (and simple) example:

Let $X_1=X_2$ have three states 0, 1 and 2 with a $transition matrix of: $$P_X=\begin{bmatrix} 0.5 &0.5&0\\ 0.25&0.5&0.25\\ 0&0.5&0.5\\ \end{bmatrix}$$$Y$then has the states 0,$\dots$,9 and even for this simple example its transition matrix, viz. is rather complex, viz: $$P_Y=\begin{bmatrix} 0.25 &0.25 &0 &0.25&0.25&0&0&0&0\\ 0.125&0.25&0.125&0.125&0.25&0.125&0&0&0\\ 0&0.25&0.25&0&0.25&0.25&0&0&0\\ 0.125&0.125&0&0.25 &0.25&0&0.125&0.125&0\\ 0.065&0.125&0.065&0.125&0.25 &0.125&0.065&0.125&0.065\\ 0&0.125&0.125&0&0.25&0.25 &0&.125&0.125\\ 0&0&0&0.25&0.25&0&0.25 &0.25&0\\ 0&0&0&0.125&0.25&0.125&0.125&0.25 &0.125\\ 0&0&0&0&0.25&0.25&0 &0.25&0.25\\ \end{bmatrix}$$ If we now define,$Y<2$as absorbing states, the transition matrix becomes: $$P_{Y'}=\begin{bmatrix} 1 &0 &0 &0&0&0&0&0&0\\ 0&1&0&0&0&0&0&0&0\\ 0&0.25&0.25&0&0.25&0.25&0&0&0\\ 0&0&0&1&0&0&0&0&0\\ 0.065&0.125&0.065&0.125&0.25 &0.125&0.065&0.125&0.065\\ 0&0.125&0.125&0&0.25&0.25 &0&.125&0.125\\ 0&0&0&0.25&0.25&0&0.25 &0.25&0\\ 0&0&0&0.125&0.25&0.125&0.125&0.25 &0.125\\ 0&0&0&0&0.25&0.25&0 &0.25&0.25\\ \end{bmatrix}$$ How can I determine the transition matrix for X (with the first state being the absorbing one)? $$P_{X'}=\begin{bmatrix} 1&0&0&0\\ ?&?&?&?\\ ?&?&?&?\\ ?&?&?&?\\ \end{bmatrix}$$ Thanks to @Did, whose answer has made me realize that while$Y$is a Markov Chain, these revised$X_i$are not Markov Chains because their transition does not depend on their own state only. I now realize that I will have to consider the "Super Walk" as the fundamental entity. - ## 1 Answer Consider$Y=\sum X_i$; this is clearly a (more complex) random walk Well, no... In general, and in particular in the example you suggest, the fact that the processes$X_1=(X_1(t))_t$and$X_2=(X_2(t))_t$are independent real valued Markov chains does not imply that the process$Y=(Y(t))_t$defined by$Y(t)=X_1(t)+X_2(t)$, is a Markov chain. In your case, consider the event$[Y(t)=2]$. Depending on whether$[X_1(t)=X_2(t)=1]$or$[X_1(t)=2,X_2(t)=0]$, the possible states for$Y(t+1)$are$\{0,1,2,3,4\}$or$\{1,2,3\}$. Hence,$Y=(Y(t))_t$is not a Markov chain. - I can see that the way I have constructed the matrix above is wrong and will edit, but is not$Y$a Markova chain considering the 9 states labeled with the tupple$(X_1,X_2)$? That is$Y=2$can occur from 2 distinct states? – Dale M Jul 2 '13 at 20:27 Once you received an answer, it is considered bad form to modify the question. New problem$\implies\$ new question. – Did Jul 2 '13 at 20:32
Same question - error in example – Dale M Jul 2 '13 at 23:38


text:
# Find a basis $T$ for $R^3$ such that $_T[f]_T$ is diagonal

The linear transformation $$g: R^3 \rightarrow R^3$$ given by $$g(x,y,z) = (x+y,~2y+z,~3z)$$ Find a basis $$T$$ for $$R^3$$ such that $$_T[f]_T$$ is diagonal.

First I found a matrix of a linear transformation

$$_S[g]_S= \begin{pmatrix} 1 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & 3 \end{pmatrix}$$

and $$g$$ has eigenvalues $$1,2,3$$.

But know I am not sure how to find a basis $$T$$.

Should I try to find the eigenspaces $$V(\lambda)$$-s corresponding to eigenvalues?

I'm not really sure how, to begin with, this one. Anything would help thanks.

Try to find three non-zero vectors $$v_1,v_2,v_3$$ in $$\mathbb R^3$$ such that $$g(v_1)=v_1$$, $$g(v_2) = 2v_2$$ and $$g(v_3) = 3v_3$$. Then put $$T = \{v_1,v_2,v_3\}$$.
Now, you find eigenvectors corresponding to those eigenvalues. It is clear that $$(1,0,0)$$ is an eigenvector corresponding to the eigenvalue $$1$$. With a few calculations, you get that $$(1,1,0)$$ is an eigenvector corresponding to the eigenvalue $$2$$ and that $$(1,2,2)$$ is an eigenvector corresponding to the eigenvalue $$3$$. So, take$$T=\bigl\{(1,0,0),(1,1,0),(1,2,2)\bigr\}.$$Then, the matrix of $$g$$ with respect to $$T$$ is$$\begin{bmatrix}1&0&0\\0&2&0\\0&0&3\end{bmatrix}.$$


text:
# Measurement of quarkonium production cross sections in pp collisions at s=13TeV

The CMS collaboration

42 引文 斯高帕斯（Scopus）

## 摘要

Differential production cross sections of prompt J/ψ and ψ(2S) charmonium and ϒ(nS) (n=1,2,3) bottomonium states are measured in proton–proton collisions at s=13TeV, with data collected by the CMS detector at the LHC, corresponding to an integrated luminosity of 2.3 fb−1 for the J/ψ and 2.7 fb−1 for the other mesons. The five quarkonium states are reconstructed in the dimuon decay channel, for dimuon rapidity |y|<1.2. The double-differential cross sections for each state are measured as a function of y and transverse momentum, and compared to theoretical expectations. In addition, ratios are presented of cross sections for prompt ψ(2S) to J/ψ ϒ(2S) to ϒ(1S), and ϒ(3S) to ϒ(1S) production.

原文 ???core.languages.en_GB??? 251-272 22 Physics Letters, Section B: Nuclear, Elementary Particle and High-Energy Physics 780 https://doi.org/10.1016/j.physletb.2018.02.033 已出版 - 10 5月 2018


text:
Chemistry 2e

# Exercises

Chemistry 2eExercises

### 7.1Ionic Bonding

1 .

Does a cation gain protons to form a positive charge or does it lose electrons?

2 .

Iron(III) sulfate [Fe2(SO4)3] is composed of Fe3+ and $SO42−SO42−$ ions. Explain why a sample of iron(III) sulfate is uncharged.

3 .

Which of the following atoms would be expected to form negative ions in binary ionic compounds and which would be expected to form positive ions: P, I, Mg, Cl, In, Cs, O, Pb, Co?

4 .

Which of the following atoms would be expected to form negative ions in binary ionic compounds and which would be expected to form positive ions: Br, Ca, Na, N, F, Al, Sn, S, Cd?

5 .

Predict the charge on the monatomic ions formed from the following atoms in binary ionic compounds:

(a) P

(b) Mg

(c) Al

(d) O

(e) Cl

(f) Cs

6 .

Predict the charge on the monatomic ions formed from the following atoms in binary ionic compounds:

(a) I

(b) Sr

(c) K

(d) N

(e) S

(f) In

7 .

Write the electron configuration for each of the following ions:

(a) As3–

(b) I

(c) Be2+

(d) Cd2+

(e) O2–

(f) Ga3+

(g) Li+

(h) N3–

(i) Sn2+

(j) Co2+

(k) Fe2+

(l) As3+

8 .

Write the electron configuration for the monatomic ions formed from the following elements (which form the greatest concentration of monatomic ions in seawater):

(a) Cl

(b) Na

(c) Mg

(d) Ca

(e) K

(f) Br

(g) Sr

(h) F

9 .

Write out the full electron configuration for each of the following atoms and for the monatomic ion found in binary ionic compounds containing the element:

(a) Al

(b) Br

(c) Sr

(d) Li

(e) As

(f) S

10 .

From the labels of several commercial products, prepare a list of six ionic compounds in the products. For each compound, write the formula. (You may need to look up some formulas in a suitable reference.)

### 7.2Covalent Bonding

11 .

Why is it incorrect to speak of a molecule of solid NaCl?

12 .

What information can you use to predict whether a bond between two atoms is covalent or ionic?

13 .

Predict which of the following compounds are ionic and which are covalent, based on the location of their constituent atoms in the periodic table:

(a) Cl2CO

(b) MnO

(c) NCl3

(d) CoBr2

(e) K2S

(f) CO

(g) CaF2

(h) HI

(i) CaO

(j) IBr

(k) CO2

14 .

Explain the difference between a nonpolar covalent bond, a polar covalent bond, and an ionic bond.

15 .

From its position in the periodic table, determine which atom in each pair is more electronegative:

(a) Br or Cl

(b) N or O

(c) S or O

(d) P or S

(e) Si or N

(f) Ba or P

(g) N or K

16 .

From its position in the periodic table, determine which atom in each pair is more electronegative:

(a) N or P

(b) N or Ge

(c) S or F

(d) Cl or S

(e) H or C

(f) Se or P

(g) C or Si

17 .

From their positions in the periodic table, arrange the atoms in each of the following series in order of increasing electronegativity:

(a) C, F, H, N, O

(b) Br, Cl, F, H, I

(c) F, H, O, P, S

(d) Al, H, Na, O, P

(e) Ba, H, N, O, As

18 .

From their positions in the periodic table, arrange the atoms in each of the following series in order of increasing electronegativity:

(a) As, H, N, P, Sb

(b) Cl, H, P, S, Si

(c) Br, Cl, Ge, H, Sr

(d) Ca, H, K, N, Si

(e) Cl, Cs, Ge, H, Sr

19 .

Which atoms can bond to sulfur so as to produce a positive partial charge on the sulfur atom?

20 .

Which is the most polar bond?

(a) C–C

(b) C–H

(c) N–H

(d) O–H

(e) Se–H

21 .

Identify the more polar bond in each of the following pairs of bonds:

(a) HF or HCl

(b) NO or CO

(c) SH or OH

(d) PCl or SCl

(e) CH or NH

(f) SO or PO

(g) CN or NN

22 .

Which of the following molecules or ions contain polar bonds?

(a) O3

(b) S8

(c) $O22−O22−$

(d) $NO3−NO3−$

(e) CO2

(f) H2S

(g) $BH4−BH4−$

### 7.3Lewis Symbols and Structures

23 .

Write the Lewis symbols for each of the following ions:

(a) As3–

(b) I

(c) Be2+

(d) O2–

(e) Ga3+

(f) Li+

(g) N3–

24 .

Many monatomic ions are found in seawater, including the ions formed from the following list of elements. Write the Lewis symbols for the monatomic ions formed from the following elements:

(a) Cl

(b) Na

(c) Mg

(d) Ca

(e) K

(f) Br

(g) Sr

(h) F

25 .

Write the Lewis symbols of the ions in each of the following ionic compounds and the Lewis symbols of the atom from which they are formed:

(a) MgS

(b) Al2O3

(c) GaCl3

(d) K2O

(e) Li3N

(f) KF

26 .

In the Lewis structures listed here, M and X represent various elements in the third period of the periodic table. Write the formula of each compound using the chemical symbols of each element:

(a)

(b)

(c)

(d)

27 .

Write the Lewis structure for the diatomic molecule P2, an unstable form of phosphorus found in high-temperature phosphorus vapor.

28 .

Write Lewis structures for the following:

(a) H2

(b) HBr

(c) PCl3

(d) SF2

(e) H2CCH2

(f) HNNH

(g) H2CNH

(h) NO

(i) N2

(j) CO

(k) CN

29 .

Write Lewis structures for the following:

(a) O2

(b) H2CO

(c) AsF3

(d) ClNO

(e) SiCl4

(f) H3O+

(g) $NH4+NH4+$

(h) $BF4−BF4−$

(i) HCCH

(j) ClCN

(k) $C22+C22+$

30 .

Write Lewis structures for the following:

(a) ClF3

(b) PCl5

(c) BF3

(d) $PF6−PF6−$

31 .

Write Lewis structures for the following:

(a) SeF6

(b) XeF4

(c) $SeCl3+SeCl3+$

(d) Cl2BBCl2 (contains a B–B bond)

32 .

Write Lewis structures for:

(a) $PO43−PO43−$

(b) $ICl4−ICl4−$

(c) $SO32−SO32−$

(d) HONO

33 .

Correct the following statement: “The bonds in solid PbCl2 are ionic; the bond in a HCl molecule is covalent. Thus, all of the valence electrons in PbCl2 are located on the Cl ions, and all of the valence electrons in a HCl molecule are shared between the H and Cl atoms.”

34 .

Write Lewis structures for the following molecules or ions:

(a) SbH3

(b) XeF2

(c) Se8 (a cyclic molecule with a ring of eight Se atoms)

35 .

Methanol, H3COH, is used as the fuel in some race cars. Ethanol, C2H5OH, is used extensively as motor fuel in Brazil. Both methanol and ethanol produce CO2 and H2O when they burn. Write the chemical equations for these combustion reactions using Lewis structures instead of chemical formulas.

36 .

Many planets in our solar system contain organic chemicals including methane (CH4) and traces of ethylene (C2H4), ethane (C2H6), propyne (H3CCCH), and diacetylene (HCCCCH). Write the Lewis structures for each of these molecules.

37 .

Carbon tetrachloride was formerly used in fire extinguishers for electrical fires. It is no longer used for this purpose because of the formation of the toxic gas phosgene, Cl2CO. Write the Lewis structures for carbon tetrachloride and phosgene.

38 .

Identify the atoms that correspond to each of the following electron configurations. Then, write the Lewis symbol for the common ion formed from each atom:

(a) 1s22s22p5

(b) 1s22s22p63s2

(c) 1s22s22p63s23p64s23d10

(d) 1s22s22p63s23p64s23d104p4

(e) 1s22s22p63s23p64s23d104p1

39 .

The arrangement of atoms in several biologically important molecules is given here. Complete the Lewis structures of these molecules by adding multiple bonds and lone pairs. Do not add any more atoms.

(a) the amino acid serine:

(b) urea:

(c) pyruvic acid:

(d) uracil:

(e) carbonic acid:

40 .

A compound with a molar mass of about 28 g/mol contains 85.7% carbon and 14.3% hydrogen by mass. Write the Lewis structure for a molecule of the compound.

41 .

A compound with a molar mass of about 42 g/mol contains 85.7% carbon and 14.3% hydrogen by mass. Write the Lewis structure for a molecule of the compound.

42 .

Two arrangements of atoms are possible for a compound with a molar mass of about 45 g/mol that contains 52.2% C, 13.1% H, and 34.7% O by mass. Write the Lewis structures for the two molecules.

43 .

How are single, double, and triple bonds similar? How do they differ?

### 7.4Formal Charges and Resonance

44 .

Write resonance forms that describe the distribution of electrons in each of these molecules or ions.

(a) selenium dioxide, OSeO

(b) nitrate ion, $NO3−NO3−$

(c) nitric acid, HNO3 (N is bonded to an OH group and two O atoms)

(d) benzene, C6H6:

(e) the formate ion:

45 .

Write resonance forms that describe the distribution of electrons in each of these molecules or ions.

(a) sulfur dioxide, SO2

(b) carbonate ion, $CO32−CO32−$

(c) hydrogen carbonate ion, $HCO3−HCO3−$ (C is bonded to an OH group and two O atoms)

(d) pyridine:

(e) the allyl ion:

46 .

Write the resonance forms of ozone, O3, the component of the upper atmosphere that protects the Earth from ultraviolet radiation.

47 .

Sodium nitrite, which has been used to preserve bacon and other meats, is an ionic compound. Write the resonance forms of the nitrite ion, $NO2–.NO2–.$

48 .

In terms of the bonds present, explain why acetic acid, CH3CO2H, contains two distinct types of carbon-oxygen bonds, whereas the acetate ion, formed by loss of a hydrogen ion from acetic acid, only contains one type of carbon-oxygen bond. The skeleton structures of these species are shown:

49 .

Write the Lewis structures for the following, and include resonance structures where appropriate. Indicate which has the strongest carbon-oxygen bond.

(a) CO2

(b) CO

50 .

Toothpastes containing sodium hydrogen carbonate (sodium bicarbonate) and hydrogen peroxide are widely used. Write Lewis structures for the hydrogen carbonate ion and hydrogen peroxide molecule, with resonance forms where appropriate.

51 .

Determine the formal charge of each element in the following:

(a) HCl

(b) CF4

(c) PCl3

(d) PF5

52 .

Determine the formal charge of each element in the following:

(a) H3O+

(b) $SO42−SO42−$

(c) NH3

(d) $O22−O22−$

(e) H2O2

53 .

Calculate the formal charge of chlorine in the molecules Cl2, BeCl2, and ClF5.

54 .

Calculate the formal charge of each element in the following compounds and ions:

(a) F2CO

(b) NO

(c) $BF4−BF4−$

(d) $SnCl3−SnCl3−$

(e) H2CCH2

(f) ClF3

(g) SeF6

(h) $PO43−PO43−$

55 .

Draw all possible resonance structures for each of these compounds. Determine the formal charge on each atom in each of the resonance structures:

(a) O3

(b) SO2

(c) $NO2−NO2−$

(d) $NO3−NO3−$

56 .

Based on formal charge considerations, which of the following would likely be the correct arrangement of atoms in nitrosyl chloride: ClNO or ClON?

57 .

Based on formal charge considerations, which of the following would likely be the correct arrangement of atoms in hypochlorous acid: HOCl or OClH?

58 .

Based on formal charge considerations, which of the following would likely be the correct arrangement of atoms in sulfur dioxide: OSO or SOO?

59 .

Draw the structure of hydroxylamine, H3NO, and assign formal charges; look up the structure. Is the actual structure consistent with the formal charges?

60 .

Iodine forms a series of fluorides (listed here). Write Lewis structures for each of the four compounds and determine the formal charge of the iodine atom in each molecule:

(a) IF

(b) IF3

(c) IF5

(d) IF7

61 .

Write the Lewis structure and chemical formula of the compound with a molar mass of about 70 g/mol that contains 19.7% nitrogen and 80.3% fluorine by mass, and determine the formal charge of the atoms in this compound.

62 .

Which of the following structures would we expect for nitrous acid? Determine the formal charges:

63 .

Sulfuric acid is the industrial chemical produced in greatest quantity worldwide. About 90 billion pounds are produced each year in the United States alone. Write the Lewis structure for sulfuric acid, H2SO4, which has two oxygen atoms and two OH groups bonded to the sulfur.

### 7.5Strengths of Ionic and Covalent Bonds

64 .

Which bond in each of the following pairs of bonds is the strongest?

(a) C–C or $C=CC=C$

(b) C–N or $C≡NC≡N$

(c)$C≡OC≡O$ or $C=OC=O$

(d) H–F or H–Cl

(e) C–H or O–H

(f) C–N or C–O

65 .

Using the bond energies in Table 7.2, determine the approximate enthalpy change for each of the following reactions:

(a) $H2(g)+Br2(g)⟶2HBr(g)H2(g)+Br2(g)⟶2HBr(g)$

(b) $CH4(g)+I2(g)⟶CH3I(g)+HI(g)CH4(g)+I2(g)⟶CH3I(g)+HI(g)$

(c) $C2H4(g)+3O2(g)⟶2CO2(g)+2H2O(g)C2H4(g)+3O2(g)⟶2CO2(g)+2H2O(g)$

66 .

Using the bond energies in Table 7.2, determine the approximate enthalpy change for each of the following reactions:

(a) $Cl2(g)+3F2(g)⟶2ClF3(g)Cl2(g)+3F2(g)⟶2ClF3(g)$

(b) $H2C=CH2(g)+H2(g)⟶H3CCH3(g)H2C=CH2(g)+H2(g)⟶H3CCH3(g)$

(c) $2C2H6(g)+7O2(g)⟶4CO2(g)+6H2O(g)2C2H6(g)+7O2(g)⟶4CO2(g)+6H2O(g)$

67 .

When a molecule can form two different structures, the structure with the stronger bonds is usually the more stable form. Use bond energies to predict the correct structure of the hydroxylamine molecule:

68 .

How does the bond energy of HCl(g) differ from the standard enthalpy of formation of HCl(g)?

69 .

Using the standard enthalpy of formation data in Appendix G, show how the standard enthalpy of formation of HCl(g) can be used to determine the bond energy.

70 .

Using the standard enthalpy of formation data in Appendix G, calculate the bond energy of the carbon-sulfur double bond in CS2.

71 .

Using the standard enthalpy of formation data in Appendix G, determine which bond is stronger: the S–F bond in SF4(g) or in SF6(g)?

72 .

Using the standard enthalpy of formation data in Appendix G, determine which bond is stronger: the P–Cl bond in PCl3(g) or in PCl5(g)?

73 .

Complete the following Lewis structure by adding bonds (not atoms), and then indicate the longest bond:

74 .

Use the bond energy to calculate an approximate value of ΔH for the following reaction. Which is the more stable form of FNO2?

75 .

Use principles of atomic structure to answer each of the following:1

(a) The radius of the Ca atom is 197 pm; the radius of the Ca2+ ion is 99 pm. Account for the difference.

(b) The lattice energy of CaO(s) is –3460 kJ/mol; the lattice energy of K2O is –2240 kJ/mol. Account for the difference.

(c) Given these ionization values, explain the difference between Ca and K with regard to their first and second ionization energies.

Element First Ionization Energy (kJ/mol) Second Ionization Energy (kJ/mol)
K 419 3050
Ca 590 1140

(d) The first ionization energy of Mg is 738 kJ/mol and that of Al is 578 kJ/mol. Account for this difference.

76 .

The lattice energy of LiF is 1023 kJ/mol, and the Li–F distance is 200.8 pm. NaF crystallizes in the same structure as LiF but with a Na–F distance of 231 pm. Which of the following values most closely approximates the lattice energy of NaF: 510, 890, 1023, 1175, or 4090 kJ/mol? Explain your choice.

77 .

For which of the following substances is the least energy required to convert one mole of the solid into separate ions?

(a) MgO

(b) SrO

(c) KF

(d) CsF

(e) MgF2

78 .

The reaction of a metal, M, with a halogen, X2, proceeds by an exothermic reaction as indicated by this equation: $M(s)+X2(g)⟶MX2(s).M(s)+X2(g)⟶MX2(s).$ For each of the following, indicate which option will make the reaction more exothermic. Explain your answers.

(b) a high ionization energy vs. a low ionization energy for M

(c) an increasing bond energy for the halogen

(d) a decreasing electron affinity for the halogen

(e) an increasing size of the anion formed by the halogen

79 .

The lattice energy of LiF is 1023 kJ/mol, and the Li–F distance is 201 pm. MgO crystallizes in the same structure as LiF but with a Mg–O distance of 205 pm. Which of the following values most closely approximates the lattice energy of MgO: 256 kJ/mol, 512 kJ/mol, 1023 kJ/mol, 2046 kJ/mol, or 4008 kJ/mol? Explain your choice.

80 .

Which compound in each of the following pairs has the larger lattice energy? Note: Mg2+ and Li+ have similar radii; O2– and F have similar radii. Explain your choices.

(a) MgO or MgSe

(b) LiF or MgO

(c) Li2O or LiCl

(d) Li2Se or MgO

81 .

Which compound in each of the following pairs has the larger lattice energy? Note: Ba2+ and

(a) K2O or Na2O

(b) K2S or BaS

(c) KCl or BaS

(d) BaS or BaCl2

82 .

Which of the following compounds requires the most energy to convert one mole of the solid into separate ions?

(a) MgO

(b) SrO

(c) KF

(d) CsF

(e) MgF2

83 .

Which of the following compounds requires the most energy to convert one mole of the solid into separate ions?

(a) K2S

(b) K2O

(c) CaS

(d) Cs2S

(e) CaO

84 .

The lattice energy of KF is 794 kJ/mol, and the interionic distance is 269 pm. The Na–F

distance in NaF, which has the same structure as KF, is 231 pm. Which of the following values is the closest approximation of the lattice energy of NaF: 682 kJ/mol, 794 kJ/mol, 924 kJ/mol, 1588 kJ/mol, or 3175 kJ/mol? Explain your answer.

### 7.6Molecular Structure and Polarity

85 .

Explain why the HOH molecule is bent, whereas the HBeH molecule is linear.

86 .

What feature of a Lewis structure can be used to tell if a molecule’s (or ion’s) electron-pair geometry and molecular structure will be identical?

87 .

Explain the difference between electron-pair geometry and molecular structure.

88 .

Why is the H–N–H angle in NH3 smaller than the H–C–H bond angle in CH4? Why is the H–N–H angle in $NH4+NH4+$ identical to the H–C–H bond angle in CH4?

89 .

Explain how a molecule that contains polar bonds can be nonpolar.

90 .

As a general rule, MXn molecules (where M represents a central atom and X represents terminal atoms; n = 2 – 5) are polar if there is one or more lone pairs of electrons on M. NH3 (M = N, X = H, n = 3) is an example. There are two molecular structures with lone pairs that are exceptions to this rule. What are they?

91 .

Predict the electron pair geometry and the molecular structure of each of the following molecules or ions:

(a) SF6

(b) PCl5

(c) BeH2

(d) $CH3+CH3+$

92 .

Identify the electron pair geometry and the molecular structure of each of the following molecules or ions:

(a) $IF6+IF6+$

(b) CF4

(c) BF3

(d) $SiF5−SiF5−$

(e) BeCl2

93 .

What are the electron-pair geometry and the molecular structure of each of the following molecules or ions?

(a) ClF5

(b) $ClO2−ClO2−$

(c) $TeCl42−TeCl42−$

(d) PCl3

(e) SeF4

(f) $PH2−PH2−$

94 .

Predict the electron pair geometry and the molecular structure of each of the following ions:

(a) H3O+

(b) $PCl4−PCl4−$

(c) $SnCl3+SnCl3+$

(d) $BrCl4−BrCl4−$

(e) ICl3

(f) XeF4

(g) SF2

95 .

Identify the electron pair geometry and the molecular structure of each of the following molecules:

(a) ClNO (N is the central atom)

(b) CS2

(c) Cl2CO (C is the central atom)

(d) Cl2SO (S is the central atom)

(e) SO2F2 (S is the central atom)

(f) XeO2F2 (Xe is the central atom)

(g) $ClOF2+ClOF2+$ (Cl is the central atom)

96 .

Predict the electron pair geometry and the molecular structure of each of the following:

(a) IOF5 (I is the central atom)

(b) POCl3 (P is the central atom)

(c) Cl2SeO (Se is the central atom)

(d) ClSO+ (S is the central atom)

(e) F2SO (S is the central atom)

(f) $NO2−NO2−$

(g) $SiO44−SiO44−$

97 .

Which of the following molecules and ions contain polar bonds? Which of these molecules and ions have dipole moments?

(a) ClF5

(b) $ClO2−ClO2−$

(c) $TeCl42−TeCl42−$

(d) PCl3

(e) SeF4

(f) $PH2−PH2−$

(g) XeF2

98 .

Which of these molecules and ions contain polar bonds? Which of these molecules and ions have dipole moments?

(a) H3O+

(b) $PCl4−PCl4−$

(c) $SnCl3−SnCl3−$

(d) $BrCl4−BrCl4−$

(e) ICl3

(f) XeF4

(g) SF2

99 .

Which of the following molecules have dipole moments?

(a) CS2

(b) SeS2

(c) CCl2F2

(d) PCl3 (P is the central atom)

(e) ClNO (N is the central atom)

100 .

Identify the molecules with a dipole moment:

(a) SF4

(b) CF4

(c) Cl2CCBr2

(d) CH3Cl

(e) H2CO

101 .

The molecule XF3 has a dipole moment. Is X boron or phosphorus?

102 .

The molecule XCl2 has a dipole moment. Is X beryllium or sulfur?

103 .

Is the Cl2BBCl2 molecule polar or nonpolar?

104 .

There are three possible structures for PCl2F3 with phosphorus as the central atom. Draw them and discuss how measurements of dipole moments could help distinguish among them.

105 .

Describe the molecular structure around the indicated atom or atoms:

(a) the sulfur atom in sulfuric acid, H2SO4 [(HO)2SO2]

(b) the chlorine atom in chloric acid, HClO3 [HOClO2]

(c) the oxygen atom in hydrogen peroxide, HOOH

(d) the nitrogen atom in nitric acid, HNO3 [HONO2]

(e) the oxygen atom in the OH group in nitric acid, HNO3 [HONO2]

(f) the central oxygen atom in the ozone molecule, O3

(g) each of the carbon atoms in propyne, CH3CCH

(h) the carbon atom in Freon, CCl2F2

(i) each of the carbon atoms in allene, H2CCCH2

106 .

Draw the Lewis structures and predict the shape of each compound or ion:

(a) CO2

(b) $NO2−NO2−$

(c) SO3

(d) $SO32−SO32−$

107 .

A molecule with the formula AB2, in which A and B represent different atoms, could have one of three different shapes. Sketch and name the three different shapes that this molecule might have. Give an example of a molecule or ion for each shape.

108 .

A molecule with the formula AB3, in which A and B represent different atoms, could have one of three different shapes. Sketch and name the three different shapes that this molecule might have. Give an example of a molecule or ion that has each shape.

109 .

Draw the Lewis electron dot structures for these molecules, including resonance structures where appropriate:

(a) $CS32−CS32−$

(b) CS2

(c) CS

(d) predict the molecular shapes for $CS32−CS32−$ and CS2 and explain how you arrived at your predictions

110 .

What is the molecular structure of the stable form of FNO2? (N is the central atom.)

111 .

A compound with a molar mass of about 42 g/mol contains 85.7% carbon and 14.3% hydrogen. What is its molecular structure?

112 .

Use the simulation to perform the following exercises for a two-atom molecule:

(a) Adjust the electronegativity value so the bond dipole is pointing toward B. Then determine what the electronegativity values must be to switch the dipole so that it points toward A.

(b) With a partial positive charge on A, turn on the electric field and describe what happens.

(c) With a small partial negative charge on A, turn on the electric field and describe what happens.

(d) Reset all, and then with a large partial negative charge on A, turn on the electric field and describe what happens.

113 .

Use the simulation to perform the following exercises for a real molecule. You may need to rotate the molecules in three dimensions to see certain dipoles.

(a) Sketch the bond dipoles and molecular dipole (if any) for O3. Explain your observations.

(b) Look at the bond dipoles for NH3. Use these dipoles to predict whether N or H is more electronegative.

(c) Predict whether there should be a molecular dipole for NH3 and, if so, in which direction it will point. Check the molecular dipole box to test your hypothesis.

114 .

Use the Molecule Shape simulator to build a molecule. Starting with the central atom, click on the double bond to add one double bond. Then add one single bond and one lone pair. Rotate the molecule to observe the complete geometry. Name the electron group geometry and molecular structure and predict the bond angle. Then click the check boxes at the bottom and right of the simulator to check your answers.

115 .

Use the Molecule Shape simulator to explore real molecules. On the Real Molecules tab, select H2O. Switch between the “real” and “model” modes. Explain the difference observed.

116 .

Use the Molecule Shape simulator to explore real molecules. On the Real Molecules tab, select “model” mode and S2O. What is the model bond angle? Explain whether the “real” bond angle should be larger or smaller than the ideal model angle.

### Footnotes

• 1This question is taken from the Chemistry Advanced Placement Examination and is used with the permission of the Educational Testing Service.
Order a print copy

As an Amazon Associate we earn from qualifying purchases.


text:
# Inverse of a matrix

1. Jun 25, 2010

Let A be an invertible matrix.
Then Ax=e1 will give us the first column of the inverse of A.
Where e1 is the first column of the identity matrix.

How can we prove this fact??

2. Jun 25, 2010

### HallsofIvy

From $Ax= e_1$ and the fact that A is invertible, we have $A^{-1}Ax= x= A^{-1}e_1$. Now, can you convince yourself that any matrix times $e_1$ is the first column of the matrix? Try multiplying a few matrices times $e_1$ and see what happens:
What is
$$\begin{bmatrix}a_{11} & a_{12} \\ a_{21} & a_{22}\end{bmatrix}\begin{bmatrix}1 \\ 0\end{bmatrix}$$

What is
$$\begin{bmatrix}a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33}\end{bmatrix}\begin{bmatrix}1 \\ 0 \\ 0\end{bmatrix}$$

3. Jun 25, 2010


text:
# 1.5. Controlling dynamic/static linking against LibXC and LibInt2¶

## 1.5.1. Introduction¶

The script setup.py also compiles C++ code into Python extensions. Some of these extension are linked against LibXC, LibInt2 or a combination of both. The setup.py script attempts to detect all of the compiler and linker settings for these libraries automatically.

For each library, following attempts are made (in the given order) to detect the compiler and linker flags. If the attempt succeeds, i.e. gives a set of satisfactory flags, further steps are not considered for that library.

1. Read setup.cfg in the root of the source tree for compilation and link options for that library, as documented in setup.cfg and environment variables. Read in environment variables for compilation and link options for that library.
2. Statically link libraries in the depends directory (for LibXC and LibInt2).
3. Use program pkg-config to get all of the compiler and linker flags for each library. See http://www.freedesktop.org/wiki/Software/pkg-config/ for more details.
4. Read setup.*.cfg file in the directory data/setup_cfgs that corresponds to your operating system and CPU architecture for compilation and link options for that library.
5. Dynamically link libraries using default library names: xc and int2 for LibXC and LibInt2, respectively.

However, if these steps do not result in decent compiler/linker options for some library or the dependencies are not installed, then the compilation will fail and you will get a compiler error message.

The following sections explain how you can override the default guesses of the setup.py script.

## 1.5.2. setup.cfg and environment variables¶

For each library, a section can be added to the file setup.cfg to configure the compiler and linker options. By default, no such file is present in the root of the source tree, so you have to create a new one. Several examples can be found in data/setup_cfgs. For example, this file would compile and link the extensions on a 64 bit version of Fedora 21:

In each section you can define the following variables: include_dirs, library_dirs, libraries, extra_objects, extra_compile_args and extra_link_args. They correspond to the optional arguments of the Extension class of the Distutils package, as described here: https://docs.python.org/2/distutils/setupscript.html#describing-extension-modules The purpose of each keyword is summarized below:

include_dirs
A list of non-standard directories containing C/C++ header files
library_dirs
A list of non-standard directories with shared objects (dynamic link libraries). When any of the *_LIBRARY_DIRS variables or the -L option of setup.py build_ext are used, keep in mind that at runtime, the dynamic link loader must be informed of these directories. For example, on Linux, the variable LD_LIBRARY_PATH must be set accordingly.
libraries
A list of shared objects to link with.
extra_objects
Extra object files for static linking.
extra_compile_args
Extra arguments given to the compiler when compiling source code.
extra_link_args
Extra arguments given to the compiler when linking object files.

Multiple paths or names for one keyword are separated by a colon (:).

Instead of setting the library configuration in the file setup.cfg, you may also set the following environment variables:

• LIBXC_LIBRARY_DIRS
• LIBXC_LIBRARIES
• LIBXC_EXTRA_OBJECTS
• LIBXC_EXTRA_COMPILE_ARGS
• LIBXC_EXTRA_LINK_ARGS
• LIBINT2_LIBRARY_DIRS
• LIBINT2_LIBRARIES
• LIBINT2_EXTRA_OBJECTS
• LIBINT2_EXTRA_COMPILE_ARGS
• LIBINT2_EXTRA_LINK_ARGS

## 1.5.3. Other ways of controlling compilation and linker flags¶

Instead of the library-specific variables above, there are also general methods to configure the compiler and linker.

You may specify a colon-separated list of non-standard directories with include files in the CPATH environment variable. For example:

export CPATH=/usr/include/libint2

In addition, general compiler and linker flags may be set in the build_ext stage of the installation process. To do so, the installation must be done in two steps:

./setup.py build_ext EXTRA OPTIONS HERE
./setup.py install --user

Run ./setup.py build_ext --help for a complete list of options. These options apply to all extensions, so avoid them for static linking.


text:
## CSDN博客

### 如何将C/C++程序转译成Delphi(十)

3.6.3. Packed Records (Alignment)

If a record is packed (aligned) then the starting byte of a field (and consequently also of the record) is aligned with the first byte of a word (16-bit or 2-byte align) or of a DWord (32-bit or 4-byte alignment). This significantly speeds CPU access to the fields, but consumes more memory.

The older APIs (from the 16-bit world) usually use packed structures (one or two byte alignment). It is the default in 16-bit Delphi: there is no difference under Delphi 1 if you write record or packed record.

Four-byte alignment is the default under Delphi32, although some APIs do use packed records under Win32.

It's important to know which type of alignment is used in an API, because the size of a record depends on the alignment.

The following example explains the difference between the coding of 2-byte and 4-byte alignment:

TmyRecNotPacked = Record

FieldA : Word;

FieldB: LongInt;

FieldC: Byte;

End;

TmyRecPacked = packed Record

FieldA : Word;

FieldB: LongInt;

FieldC: Byte;

End;
 Offset 0 1 2 3 4 5 6 7 8 9 10 11 TMyRecUnPacked A A . . B B B B C . . . TMyRecPacked A A B B B B C

Now, how to determine whether packing is required or not. In the Microsoft APIs, two methods are used. One is clear and simple:

#pragma pack(n)

Use the packed keyword if n is 1 or 2, but don't use packed if n is 4.

However, Microsoft uses #include <filename> to control packing by putting the packing pragma in the include file. The following include files are used to control the packing method:

 #include Means Packed required pshpack1.h #pragma pack (1) Yes pshpack2.h #pragma pack (2) Yes pshpack3.h #pragma pack (3) Yes pshpack4.h #pragma pack (4) No Poppack.h Back to previous packing ?

If a header file contains the following line

#include <pshpack1.h>

you can interpret it as #pragma pack (1) and use the packed keywords in records from now until you come to another include of pshpack?.h or to an include of poppack.h.

Four-byte alignment (non-packed records) is the default under Delphi32. But what if the user changes the compiler options and switches off 4-byte alignment? If you need to ensure that 4-byte alignment is enabled you must insert the following line at the top of the unit:

{$ALIGN ON}  A unit header must look at least like this: Unit MyUnit; {$ALIGN ON}

You can use the{$ALIGN} directive instead of explicitly using the packed keyword, too, but I prefer explicit packing because it overrides {$ALIGN ON} and makes things quite specific.

NOTE: A field whose length is an odd number of bytes presents a problem if you encounter #pragma pack(2) and use the packed keyword for translating it. The field will be close packed on a byte boundary when it should be packed on a word boundary. A solution is being sought for handling this situation.

Back to contents

0 0


text:
## Physics: Principles with Applications (7th Edition)

Published by Pearson

# Chapter 7 - Linear Momentum - Problems: 9

2500 m/s.

#### Work Step by Step

The momentum in the horizontal direction will be conserved. Let the positive direction be the direction in which the nucleus was originally moving. $$(222 u)(320 m/s) = (218 u)(280 m/s) + (4.0 u)v$$ Solve for velocity v = 2500 m/s, rounded to 2 significant figures.

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
Re: AW: LyX 1.6.7: Track changes in pdf

Jannick Asmus <jannick.news <at> gmail.com> writes:

>
> Jürgen Spitzmüller wrote:
> > Jannick Asmus wrote:
> >> is it possible to indicate changes of the document in track mode in
> >> the pdf by a vertical bar in the margin area?
> >
> > With pdflatex output:
> >
> > \usepackage[pdftex]{changebar}
> > \renewcommand{\lyxdeleted}[3]{{\cbstart\color{lyxdeleted}\sout{#3}\cbend}}
>
>
> It works pretty well ... except for changes in headings where some nasty
> bracket error in some "section" code shows up. I can very well live with
> that, as with these lines in the preamble any floating text can be
> tracked
> as expected in the pdf.
>
> Best wishes,
> J.
>
>

Hi Jurgen,

I tried the code you supplied by putting it in the "latex preamble"
of my lyx document. Lyx complained about not finding the proper sty file,
so I figured I needed to install changebar.sty,
and used the MikTex package manager to do that.

Once that hurdle was taken, I got the next error.
My document has a caption as part of a change,
and there seemed to be some bracket mismatch (extra }).
So this seems to be related to the error reported by Jannick.
The headers seem to be doing OK now, I did not get any error in those.

After I accepted the change in the caption,
Lyx did not complain anymore, and nice changebars appeared in
the right margin.

However, it so happens that I use marginal notes in my document,
and they also use the right-hand margin.
The change bars now go straight through the marginal notes.
Is it possible to use the left-hand margin for the change bars?

Many thanks,

Evert-Jan


text:
QUESTION

# We would like to conduct a hypothesis test of H0: = 50 vs. = 50 for the mean of some normally distributed variable X. A random sample of 25...

We would like to conduct a hypothesis test of H0: μ = 50 vs. Ha: μ ̸= 50 for the mean μ of some normally distributed variable X. A random sample of 25 observations is taken from the population. A 90% confidence interval for μ is calculated to be (44.46, 49.58). A 96% confidence interval for μ is calculated to be (43.82,50.22). The P-value of the appropriate test of significance must be:


text:
# The permeability of substance is 6.28 × 10^(-4) wb/A-m. Find its relative permeability and susceptibility ?

Q: The permeability of substance is 6.28 × 10-4 wb/A-m. Find its relative permeability and susceptibility ?

Sol: $\large \mu_r = \frac{\mu}{\mu_0}$

$\large \mu_r = \frac{6.28 \times 10^{-4}}{4\pi \times 10^{-7}}$

μr = 500

$\large \mu_r = 1 + \chi$

$\large \chi = \mu_r – 1 = 500 -1$

χ = 499.


text:
# Loss_z1_weight and loss_z1_unweight in scANVI

In the scANVI implementation, there are two losses I don’t quite understand: scvi-tools/_scanvae.py at d636093bc8d49c8e03fcb4bc0a8bc8130cb29fe2 · scverse/scvi-tools · GitHub

loss_z1_unweight = -Normal(pz1_m, torch.sqrt(pz1_v)).log_prob(z1s).sum(dim=-1)
loss_z1_weight = Normal(qz1_m, torch.sqrt(qz1_v)).log_prob(z1).sum(dim=-1)

Given that these are directly added to the loss function, isn’t this saying that we want P(z1| pz1) to be high and P(z1| qz1) to be low? But z1 is generated (via reparameterization trick) from qz1 so how is this possible?

Additionally: I presume understanding those two losses would also answer why the encoder_z2_z1 and decoder_z1_z2 part of the architecture is necessary. If not, what is this additional encoder and decoder used for?

Thank you for using scvi-tools. These lines are easier to understand as the KL divergence term for z_1. Specifically KL(q_\eta(z)||p_\theta(z)) = loss_z1_weight + loss_z1_unweight. The second encoder and decoder pair are additional networks that break down z_1 per cell type. This is the defining difference between scVI and scANVI. The math is detailed in our user guide: scANVI - scvi-tools. Let me know if this helps!


text:
# Generate the context free grammar for the following language: $\left \{ a^{3n}b^{m}c^{n}|n>0, m>0\right \}$

Given the following language, I am tasked with giving a context-free grammar that generates it.

$$\left \{ a^{3n}b^{m}c^{n}|n>0, m>0\right \}$$

Would this be correct?

$$A \rightarrow aaaA$$
$$B\rightarrow Bb | b$$
$$C\rightarrow Cc|c$$
$$S\rightarrow ASBSCS|\epsilon$$

• We discourage "please check whether my answer is correct" questions, as only "yes/no" answers are possible, which won't help you or future visitors. See here and here. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. If you just need someone to check your work, you might seek out a friend, classmate, or teacher.
– D.W.
Nov 19 '20 at 19:26

Unfortunately your grammar generates only $$\epsilon$$ (which is not in the language, since $$n$$ and $$m$$ are greater than 0), as you don't delete the $$A$$; moreover you don't control that the number of $$A$$'s is thrice the numeber of $$C$$'s.
$$S\rightarrow aaaS'c$$
$$S' \rightarrow aaaS'c | B$$
$$B\rightarrow Bb | b$$


text:
# Eliminate the parameter of a

Eliminate the parameter to find a description of the following circles or circular arcs in terms of $x$ and $y$. Give the center and radius, and indicate the positive orientation.

$x=4\cos{(t)} ,\ y=3\sin{(t)} ;\ 0 \leq t \leq 2\pi$

So,

$\displaystyle x^2=4^2\cos^2{(t)} ,\ y^2=3^2\sin^2{(t)} \implies \frac{x^2}{4^2}=\cos^2{(t)} ,\ \frac{y^2}{3^2}=\sin^2{(t)}$

But I detect no radius. I'm rather confused, on this whole question. It doesn't even explicitly define "the parameter". Insight?

• I might not understand the question, but $(4\cos(t),3\sin(t))$ does not describe a circle (it is an ellipse instead). – Hirshy Jul 28 '15 at 7:15

Those equations describe an ellipse, rather than a circle. I'm guessing that by radius they mean length of major and minor axes?

The parameter is $t$, and you're on the right track to eliminate it; your next step is to add the equations

$$\frac{x^2}{4^2}=\cos^2{(t)} \\ \frac{y^2}{3^2}=\sin^2{(t)}$$

and use the pythagorean identity.

• Such that $\displaystyle \frac{x^2}{4^2}+\frac{y^2}{3^2}=\cos^2{t}+\sin^2{t} \implies \frac{x^2}{4^2}+\frac{y^2}{3^2}=1$? Yeah? – alxmke Jul 28 '15 at 7:21
• Yup, that's it, I think. – coldnumber Jul 28 '15 at 7:22
• What do you think could be implied by the prompt "indicate the positive orientation"? – alxmke Jul 28 '15 at 7:32
• Are you also asked to graph it? See here: mathworld.wolfram.com/CurveOrientation.html (you travel from $t=0$ to $t=2\pi$) – coldnumber Jul 28 '15 at 7:34
• I am not, but it asks for the elimination of $t$, so would it still be referencing $t$ even after asking for its elimination? If the parameters were given as a parametric equation, then for $t$ going $0\to2\pi$, the positive orientation would be ... counterclockwise, no? – alxmke Jul 28 '15 at 7:38

You have not a radius since you are describing an ellipse. Indeed

$$1=cos^2(t)+sin^2(t)=\frac{x^2}{16}+\frac{y^2}{9},$$ then

$$9x^2+16y^2=144.$$

The major semi axis is $4$, and the minor semi axis in $3$.

Notice, $$x=4\cos t \implies \cos t=\frac{x}{4}\tag 1$$ & $$y=3\sin t \implies \sin t=\frac{y}{3}\tag 2$$ Now, for eliminating $t$, squaring & adding (1) & (2), we get $$\cos^2t+\sin^2t=\left(\frac{x}{4}\right)^2+\left(\frac{y}{3}\right)^2$$ $$\color{blue}{\frac{x^2}{16}+\frac{y^2}{9}=1}$$ The above equation is in the form of the standard form of equation of an ellipse: $\color{blue}{\frac{x^2}{a^2}+\frac{y^2}{b^2}=1}$ where, $a=4$ & $b=3$.

Hence, the curve represents an ellipse not a circle, hence we have $$\text{center of ellipse, origin}\equiv(0, 0)$$ $$\text{major axis}, 2a=2\times 4=8$$ $$\text{minor axis}, 2b=2\times 3=6$$ O.P.'s detection is right that there is no radius as that is not a circle but the curve represents an ellipse.


text:
# Friction problem of playground slide

1. Jul 16, 2009

### pttest

1. The problem statement, all variables and given/known data

A child goes down a playground slide with an acceleration of 1.40 m/s2. Find the coefficient of kinetic friction between the child and the slide if the slide is inclined at an angle of 29.0 degrees below the horizontal.

2. Relevant equations
Normal force = force of gravity (f_g) cos theta
F_f kinetic = mu_k . normal force

3. The attempt at a solution
here weight of the child is not given. so could someone help me how to approach such problem?

2. Jul 16, 2009

### RoyalCat

The mass is irrelevant.

$$\vec F=m\vec a$$

3. Jul 16, 2009

### pttest

I am still confused how to approach the problem with out knowing the mass?
could anybody explain little more?

4. Jul 16, 2009

### rock.freak667

Forget about the mass for the time being, start by drawing a free body diagram with all the forces acting.

5. Jul 16, 2009

### RoyalCat

Yeah, do what rock.freak suggested. Just assign the mass of the child an arbitrary value, $$m$$, and see where that gets you. You'll see soon enough what we meant by 'irrelevant.' It'll cancel out.

Remember, the coefficient of friction is a pure number. Unless you've got more than one mass that you can add up and divide one by another, it is dimensionally impossible to incorporate the mass of the child into your solution, and as such, the problem boils down to one of two cases. Either its unsolvable (It isn't) or the solution is independent of the mass.

Solving the problem will prove that the latter is correct.


text:
# Position of white dots in guitar fretboard

I was wondering why the white dots in the fretboard are usually placed in fret numbers 3, 5, 7, 9, 12, 15, 17, 19, and 21.

I know that their general purpose is for counting, but what I wonder is: Why are they placed on precisely those frets, and not different ones?

For example: Why are there two frets between the dots on 7 and 9, and three frets between the dots on 9 and 12?

The spacing is designed to offer useful milestones on the fretboard. Take the notes on the 6th string (in standard tuning), for example:

• Open (0th fret) is E.
• The F is only 1 fret away, why put a marker on the 1st fret? It's already marked by being the first fret
• The G is on fret 3, so put a marker there.
• The A is on fret 5, which is a perfect 4th from the open string, so it deserves a marker.
• B follows on fret 7, which is a perfect 5th from the open string, so another marked fret.
• Why there's a mark on fret 9, I'll never know, I wish it was on 10 for D instead of 9 for C#
• But you need a marker on 12, for certain - it's the octave!
• The 15, 17, and 19 are just 3, 5, and 7 + 12 (an octave), respectively.
• "The A is on fret 5, so it deserves a marker" is p4th of the root. "B follows on fret 7, another marked fret" and is the p5th of the root. Quite important intervals. – Anonymous Apr 4 '11 at 23:27
• I own a very old russian made guitar with the marker on the 10th fret. And boy, is it hard to play because of that, even though I usually don't watch the markers... – user399 Apr 5 '11 at 5:42
• @ledfloyd - You're obviously much more of a theory guru than I am. Would you please edit this answer to include your insights? @mrbuxley - I wouldn't want to play that guitar now, either. I'm used to the 9th fret mark by now. I just wish it were the other way. However, ledfloyd's answer explains why it is where it is. – gomad Apr 5 '11 at 17:48
• I'd guess that the 9th fret has a marker and not the 10th because the 9th fret is a member of the major scale while the 10th is not. But then, the same logic would put a marker on the second fret and not the third, so I don't know. – Alex Basson Apr 5 '11 at 19:05
• Nice breakdown. With regards to the 9th fret, my suggestion would be that it marks the position of the relative minor to an open-string major scale. Having said that, however, I think the reason is more prosaic: the flanking two-fret intervals make the octave immediately stand out, even if the markers are bars or some such (i.e. no special double dot symbol or similar). The remaining seven frets are divided in the most efficient way for easy recognition: four marks, three spaces. – user321 May 24 '11 at 9:08

Maybe lost to history, the dots are references for the Fibonacci series, which when harmonics are considered, give a pure major chord with octave and perfect fifth redundancies. The dot at the 9th fret marks 2/5ths of the string length. The harmonic there is of the 5th partial (the major third) -- this is the one that throws you off.

This is my observation, and it is so easy once seen, that I have little doubt that many people have stumbled across it. Nonetheless, Gibson and Martin guitars had nothing to say about it, and so far as I could see, nothing to see in google searches. THE DOTS MARK THE HARMONICS COMPRISING A PURE MAJOR CHORD.

Are the dots an atavism from pre-equal tempered tuning? In historical paintings of fretted instruments, or in museums, when are the earliest dots seen in their modern location??

string
open = 1 = do
dots
12 = 2nd partial = do (octave over root)
7 = 3rd partial = sol (perfect 5th + octave over root)
5 = 4th partial = do (double octave over root)
9 = 5th partial = mi (double octave + major third over root)
3 = 6th partial = sol (double octave + perfect 5th over root)

The frets that are highlighted are the equal-tempered equivalents of the basic fractions, as seen in the table below. (The first column is the fraction, the second column is the corresponding number of half-tones):

 1      0      = 0
6/5    3.156  ~ 3
4/3    4.980  ~ 5
3/2    7.020  ~ 7
5/3    8.844  ~ 9
2      12     = 12 (from now on, it's simply an octave up, i.e.,
12/5   15.156 ~ 15     times 2 for the fractions and +12 for the frets)
8/3    16.980 ~ 17
3      19.020 ~ 19
10/3   20.844 ~ 21

One can ask why 6/5 and not 7/5, 8/5 or 9/5. I don't know exactly, but the fractions used have the lowest possible sum of numer+denom in the interval [1,2]. (I'm not 100% precise here, we omit 5/4 which gives 3.863 ~ 4, but you wouldn't place two dots adjacent since it would only confuse people, would you?)

This as well explains why 9 got there and not 10: It corresponds to a very low-entry fraction. One can as well notice that you can try flajolets on bars 12, 7 and 5 easily, and with some adjustments on 3, 4 and 9 as well, but these don't sound quite strong. Flajolets on other positions are even more difficult.

• Please let me know what exactly is wrong with my answer, so that I can do better next time. Thanks. – yo' Dec 8 '14 at 22:24

They are at important intervals: minor third, fourth, fifth, major sixth, octave.

Then they repeat for the second octave: minor third, fourth, fifth, major sixth.

I always thought the ninth fret marker was simply aesthetics. Being that the marker after the twelth is three frets away, the marker before the the twelth is the same distance away. It centers the twelve marker. Practically speaking, the twelve marker is also more noticeable.

The white dots are typically placed at harmonic points on the string. The first harmonic of the open string is the octave, halfway along the string at the 12th fret. The second harmonic is one-third the string length, and that falls at the seventh fret. On some models, you'll see that fret marked with a double-dot as well, as it's a very prominent harmonic:

The woman holding the guitar here is pointing at the octave marker, but you can see the seventh fret is also double-dotted.

You'll notice the above guitar also has fewer dots; there isn't one on the third fret, and the second octave doesn't match the first. The above layout is a more harmonic-oriented one; the average player, with a little practice, can coax out a harmonic at each of the marked frets. Now, because harmonics, by their nature, are Pythagorean "just temperament", while the guitar's fretboard is designed for "equal temperament", the actual location of the harmonic usually won't be over the fret marked by the dots, so this layout isn't an exact guide but it's useful at a glance.

Most fretboards have the frets marked as you describe, and this is a "compromise" layout of sorts that can be repeated on both octaves of the fretboard, so the guitarist can play in both octaves without losing his place. This layout is more a straight-up positioning guide, but it is still useful for identifying harmonic points.

Other harmonics of the open string besides the ones in the above picture are less prominent, though a skilled player with a well-made guitar can get them to speak. Jaco Pastorius was famous for coaxing third and even second-fret harmonics from his Jazz Bass: Jaco Pastorius - Loop Jam (incorporates part of his "Portrait of Tracy" solo).

• Wondering why the 3rd fret doesn't have a dot then - the 3rd fret open natural harmonic is significant, and frequently used across many genres, from Jazz, as you mentioned, to Metal (see the Dimebag Squeal) – Doktor Mayhem May 1 '15 at 13:29
• In my experience, and I'm not a professional guitarist so make of this what you will, the 3rd fret takes a little more coaxing on most guitars. IMO it has to do with the difference between Pythagorean and logarithmic temperaments; if you look at frequency charts for an octave in both systems and calculate percent error, the major and minor third are pretty far out (there are further, but compared to the major fourth and fifth they're really bad). – KeithS Oct 26 '15 at 15:30
• Now, the ninth fret harmonic (producing the major sixth) is even further out from Pythagorean intervals, but its placement closer to the center of the string makes it a little easier to pop this one out once you learn to touch slightly behind the ninth fret. – KeithS Oct 26 '15 at 15:32

I think it's to signify intervals as much as anything else. The 12th fret is the most obvious - it's the octave. The 3rd fret is pretty obvious because it gives you some general orientation for most open chords. The 5th and 7th frets are valuable because they signify the 4th and 5th interval of the open strings.

After 45 minutes or so reading people's answers to the ninth fret question, then 15 minutes of pondering, I came up with a crappy answer:

The NINTH FRET is a position of all flatted notes:

Db Ab Fb Cb Gb Db --or-- Db Gb Cb Fb Ab Db

(The order depending upon whether You look at the notes from first string to sixth or vice-versa.) But then, the fourth fret is also a position of all flatted notes. I know we aren't supposed to call B a Cb or E an Fb, though there are exceptions. Yeah, somebody, please come up with the answer to this ninth fret conundrum! In any case I won't stop thinking about this.

• Cb is actually B – Dom Nov 29 '14 at 23:48


text:
# Fundamental period of a discrete-time signal

This question comes right out of the problems section of Oppenheim's Signals & Systems 2ed textbook. I don't understand the solution to the problem.

(problem #1.35) If a discrete-time complex sinusoid is expressed by $x[n] = \exp(jmn2\pi/N)$ (m is any integer), prove that the fundamental frequency is N0 = N/gcd(N,m).

Solution: for a discrete-time signal to be periodic $x[n]= x[n+N_0]$. Substituting n+N0 into n and expanding that expression means that $m(2\pi/N)N_0 = 2\pi{}k$, where k is some (not any) integer. Rearranging we get the expression N0=N/(m/k). somehow (m/k) = gcd(N,m).

I don't see it.

• I added some math formatting to make it easier to read your question. But I also rearranged the first formula, putting n inside the exponential function, because I think this is the correct form for a complex exponential. Please revert if I changed the meaning of your question. Apr 5 '13 at 2:21

Let's write the book's solution out in more detail.

First, by definition, a discrete-time signal is periodic with period N0 if for all n, $x[n+N_0] = x[n]$.

So we're interested in cases where

$\exp(j2\pi{}mn/N) = \exp(j2\pi{}m(n+N_0)/N)$.

We know that the complex exponential, considered as a continuous function, repeats whenever it's argument advances by $2\pi$. So our equality holds whenever the phase difference between the arguments increases by some multiple of $2\pi$, that is whenever there is a k such that

$2\pi{}mn/N + 2\pi{}k = 2\pi{}m(n+N_0)/N$.

We can eliminate terms here to get

$mn/N + k = mn/N + mN_0/N$

and further

$k = mN_0/N$

So the period of our discrete time function is

$N_0 = Nk/m$

But N0 must be an integer, and we also want the smallest possible value of N0 to get the fundamental frequency. That means we want the smallest k that makes Nk/m an integer.

Lets write this out in terms of the prime factors of N and m:

$N_0 = \dfrac{k \Pi_p n_p}{\Pi_q m_q}$

For this to be an integer we need k to be made up of all the factors of m, except the ones that are held in common with N.

$k = \dfrac{\Pi_q m_q}{\Pi_{\mathrm{common\ factors}} m_q}$

But the numerator here is just m, and the denominator here is just the gcd of N and m, so we have

$m / k = \gcd(N, m)$

which is what we were trying to show.

TL;DR: It's to make it work out so that N0 is an integer.


text:
# How do you convert the polar coordinate (2, pi/4) into cartesian coordinates?

$\left(\sqrt{2} , \sqrt{2}\right)$
$x = R \cos t = 2 \cos \frac{\pi}{4}$
$y = R \sin t = 2 \sin \frac{\pi}{4}$


text:
Choosing the Resistance in a Photoconductive Circuit

1. Jun 16, 2009

Higgy

1. The problem statement, all variables and given/known data
What should I choose for the resistor $R_{F}$ and capacitor $C_{F}$ in this circuit?

I have an unmounted silicon photodiode, with specs:

Reverse Voltage = 100 $V$
Short Circuit Current = 50 $\mu A$ (typical)
Dark Current = 0.5 $n A$ (typical), 1.0 $n A$ (max)
Shunt Resistance = 250 $M \Omega$ (min), 500 $M \Omega$ (typical)
Junction Capacitance = 8 $pF$ (typical)
Breakdown Voltage = 75 $V$ (typical)

I'm trying to figure out how to properly use it. Laser light from an ~800nm diode laser will be incident on it, and I would like to view its output signal on an oscilloscope via a BNC coaxial cable.

I've learned that I can operate the photodiode in "photovoltaic mode", where there is zero bias and low dark current, but slow response time, or "photoconductive mode", where there is a negative bias and fast response time, but higher dark current.

Due to the circumstances of my experiment, I'm choosing to go with "photoconductive mode". Hence, the above circuit has a negative bias. I got it from AP Technologies website, where I also saw some useful formulas:

2. Relevant equations
$$V_{OUT} = I_{S} R_{F}$$

where $I_{S}$ is the photodiode light signal current and $R_{F}$ is the feedback resistance.

$$C_{F} = \frac{1}{2} \pi f R_{F}$$

where $C_{F}$ is the feedback capacitance and $f$ is the maximum operating frequency.

3. The attempt at a solution
I guess I'm just not sure what to use for values for calculating the resistance and capacitance needed. I've searched around online, and even though I've found some useful documents on this, I'm still left with two questions:

1. How large of a resistor do I need to not fry the diode?

2. What capacitor should I use? What is the "maximum operational frequency" referring to? Is it related to the RC time constant, or to the frequency of the incident light, etc?

My naive guess for the first one would be to use $V_{OUT} \sim 10 V$ and $I_{S} \sim 10 \mu A$ so that

$$R_{F} = \frac{10 V}{10 \mu A} = 1 M \Omega$$

That's big, though!

2. Jun 16, 2009

Redbelly98

Staff Emeritus
RF will depend on what current you expect for IS, and how much signal you would like to have. IS will depend on the amount of power from the diode beam hitting the photodiode's active area. You might take 1V as a reasonable signal level.

This circuit might work fine with no capacitor CF. But if you use one, the question to answer is how fast must the output signal respond? Choose CF so that the RC time constant is 1/3 of that time or less.

3. Jun 17, 2009

Higgy

Thanks Redbelly98. Ignoring the capacitor, then, I'm still slightly confused as to what 'spec' value I should be looking at to help me choose a resistor that would not fry the diode.

Maybe my concern is unwarranted. In reverse-biasing the diode, we're not causing additional current flow through the diode, we're just setting up a potential difference, and the result is more output current from the photodiode? And it's current that would, in my words, "fry" the photodiode.

Since the capacitor-free circuit would just be an inverting amplifier, for which:

$$V_{out} = - \frac{R_{F}}{R_{D}} V_{in}$$

where $R_{D}$ is the resistance of the diode, then with Ohm's law we could write:

$$I_{S} R_{D} = -\frac{R_{D}}{R_{F}} V_{out} \rightarrow R_{F} = -\frac{V_{out}}{I_{S}}$$

and with $I_{S} = 50 \mu A$ and $V_{out} = 1 V$ we have

$$R_{F} = 50 M \Omega$$

Is that roughly the right way to think about it?

4. Jun 17, 2009

Redbelly98

Staff Emeritus
1V / 50 μA is 20kΩ, not 50MΩ. 20kΩ sounds reasonable.

Forget about "resistance of the diode", instead think in terms of diode current. Actually, this is essentially what you are doing since your RD terms cancelled out of the equation.

The photodiode is essentially a current source here. At 800 nm, it can generate 0.5-1.0 Amps per Watt of optical power. To generate 50 μA, it would be receiving 50-100 μW from the laser. This should not hurt the photodiode.

I'll also suggest building a preliminary circuit and experimenting to find the right resistor value. No op-amp, just a loop circuit containing the photodiode, biasing voltage, and resistor. A simple 1.5V battery (or two of them) can be used for bias. Then try different resistor values until you get a volt or so of signal across the resistor.

p.s. if the resistor voltage is close to or larger than the bias voltage, then you are saturating the photodiode. Increase the bias voltage or reduce the resistor so that the resistor voltage is less than the bias.

p.p.s. For really fast-changing signals, say in the RF frequency range (several ns or faster), it is common practice to use a 50Ω resistor with the photodiode, and then use amplifiers to amplify the voltage across the 50Ω resistor.

5. Jun 17, 2009

Higgy

Oops. Right, that makes more sense.

Thanks! This really clears things up. I'll try your suggestion of circuit-sans-op-amp, and go from there.