text:
# Observability of proper distance

Hubble's law at current time is as follows. $$v=H(t_0)r$$

But if you look at the explanation on Wikipedia:

Strictly speaking, neither $$v$$ nor $$D$$ in the formula are directly observable, because they are properties now of a galaxy, whereas our observations refer to the galaxy in the past, at the time that the light we currently see left it.

For relatively nearby galaxies (redshift $$z$$ much less than unity), $$v$$ and $$D$$ will not have changed much, and $$v$$ can be estimated using the formula $$v=zc$$ where $$c$$ is the speed of light. This gives the empirical relation found by Hubble.

For distant galaxies, $$v$$ (or $$D$$) cannot be calculated from $$z$$ without specifying a detailed model for how $$H$$ changes with time. The redshift is not even directly related to the recession velocity at the time the light set out, but it does have a simple interpretation: ($$1+z$$) is the factor by which the universe has expanded while the photon was travelling towards the observer.

My question is as follows:

Current proper distance indicates where the galaxy should be by expansion when photons from the past start and reach us now.

In the expression of Hubble's law, Hubble's law has a current proper distance. Therefore, Hubble's law at current time already has a meaning that implies information about photons in the past. It's strange to say that Hubble's law only holds close distance because of the inability to observe current information.

Why does $$cz=Hd$$ exist only at a close distance?

• Short answer: cosmic expansion is not constant, but H = H(t). Sep 22 '21 at 8:58
• @planetmaker Of course, I know that the Hubble parameter changes over time. “Strictly speaking, neither 𝑣( nor 𝐷) in the formula are directly observable, because they are properties now of a galaxy, whereas our observations refer to the galaxy in the past, at the time that the light we currently see left it.” The meaning of this phrase doesn't make sense. Do means past information by definition. But it represents the current information. Sep 22 '21 at 10:11

It's ambiguous what law Hubble should be credited with finding, because there are many different notions of distance that can be used in cosmology, and all of them satisfy some equation of the form $$H_0 D = cz + O(z^2)$$, and Hubble's original data points all had $$z^2<0.000015$$, and they were noisy enough to be equally consistent with any of these notions of distance.
There is one version of "Hubble's law" that is exactly correct at all distances and times in any (exactly homogeneous) FLRW cosmology, regardless of the specific parameters of the model. That is $$v=HD$$ where $$D$$ is the metric distance measured at a constant cosmological time and $$v$$ is the derivative of $$D$$ with respect to cosmological time.
However, the relationship between the quantities in that Hubble law and directly measurable quantities, such as $$z$$, luminosity, and angular size, does depend on the details of the model. There is no law as simple and universal as $$v=HD$$ that relates measurable quantities.


text:
# Actor-critic loss function in reinforcement learning

In actor-critic learning for reinforcement learning, I understand you have an "actor" which is deciding the action to take, and a "critic" that then evaluates those actions, however, I'm confused on what the loss function is actually telling me.

In Sutton and Barton's book page 274 (292 of the pdf) found here http://ufal.mff.cuni.cz/~straka/courses/npfl114/2016/sutton-bookdraft2016sep.pdf

they describe the algorithm.

I can understand that you want to update the actor by incorporating information about the state-value (determined by the critic). This is done through the value of $\delta$ which incorporates said information, but I don't quite understand why it's looking at the gradient of the state-value function?

Shouldn't I be looking at the gradient of some objective function that I'm looking to minimize? Earlier in the chapter he states that we can regard performance of the policy simply as its value function, in which case is all we are doing just adjusting the parameters in the direction which maximizes the value of each state? I thought that that was supposed to be done by adjusting the policy, not by changing how we evaluate a state.

Thanks

Let's first try to build a solid understanding of what $\delta$ means. Maybe you know all of this, but it's good to go over it anyway in my opinion.

$\delta \gets R + \gamma \hat{v}(S', w) - \hat{v}(S, w)$

Let's start with the $\hat{v}(S, w)$ term. That term is the value of being in state $S$, as estimated by the critic under the current parameterization $w$. This state-value is essentially the discounted sum of all rewards we expect to get from this point onwards.

$\hat{v}(S', w)$ has a very similar meaning, with the only difference being that it's the value for the next state $S'$ instead of the previous state $S$. If we discount this by multiplying by $\gamma$, and add the observed reward $R$ to it, we get the part of the right-hand side of the equation before the minus: $R + \gamma \hat{v}(S', w)$. This essentially has the same meaning as $\hat{v}(S, w)$ (it is an estimate of the value of being in the previous state $S$), but this time it's based on some newly observed information ($R$) and an estimate of the value of the next state, instead of only being an estimate of a state in its entirety.

So, $\delta$ is the difference between two different ways of estimating exactly the same value, with one part (left of the minus) being expected to be a slightly more reliable estimate because it's based on a little bit more information that's known to be correct ($R$).

$\delta$ is positive if the transition from $S$ to $S'$ gave a greater reward $R$ than the critic expected, and negative if it was smaller than the critic expected (based on current parameterization $w$).

Shouldn't I be looking at the gradient of some objective function that I'm looking to minimize? Earlier in the chapter he states that we can regard performance of the policy simply as its value function, in which case is all we are doing just adjusting the parameters in the direction which maximizes the value of each state? I thought that that was supposed to be done by adjusting the policy, not by changing how we evaluate a state.

Yes, this should be done, and this is exactly what is done by the following line:

$\theta \gets \theta + \alpha I \delta \nabla_\theta \log \pi(A \mid S, \theta)$

However, that's not the only thing we want to update.

I can understand that you want to update the actor by incorporating information about the state-value (determined by the critic). This is done through the value of δ which incorporates said information, but I don't quite understand why it's looking at the gradient of the state-value function?

We ALSO want to do this, because the critic is supposed to always give as good an estimate as possible of the state value. If $\delta$ is nonzero, this means we made a mistake in the critic, so we also want to update the critic to become more accurate.

• Right, so the critic update isn't really to do with adjusting to give the "highest" value per state, but rather it's adjusting to give the best possible estimate and in doing so, it's the best "critic" for the model. Thanks for making this so clear! They key was my misunderstanding of $\delta$ as you explained. – tryingtolearn Jan 3 '18 at 14:24

format: plain


text:
# Math Help - Show that if x_n > 3^{0.5} then sequence x_{n+1} > 3^{0.5}

1. ## Show that if x_n > 3^{0.5} then sequence x_{n+1} > 3^{0.5}

Hi, I have the following problem which I don't know how to solve... I know how to do part C, but I don't know parts A and B. I will have enough to guide myself if you help me with part A though.

Thanks a lot!

The whole problem is:

"Let $f(x)=(x^2+3)/(2x)$ for $x \not= 0$. Define a sequence of real numbers $x_n$ by

$x_{n+1} =f(x_n)$ for $n \geq 1$, $x_1=2$.

A) Show that if $x> \sqrt 3$, then $f(x)> \sqrt 3$.
B) Show that if $x> \sqrt 3$, then $x>f(x)$. (Hint: show $x-f(x)>0$.)
C) Conclude that the sequence $x_n$ converges."

2. ## Re: Show that if x_n > 3^{0.5} then sequence x_{n+1} > 3^{0.5}

Originally Posted by buenogilabert
Hi, I have the following problem which I don't know how to solve... I know how to do part C, but I don't know parts A and B. I will have enough to guide myself if you help me with part A though.

Thanks a lot!

The whole problem is:

"Let $f(x)=(x^2+3)/(2x)$ for $x \not= 0$. Define a sequence of real numbers $x_n$ by

$x_{n+1} =f(x_n)$ for $n \geq 1$, $x_1=2$.

A) Show that if $x> \sqrt 3$, then $f(x)> \sqrt 3$.
B) Show that if $x> \sqrt 3$, then $x>f(x)$. (Hint: show $x-f(x)>0$.)
C) Conclude that the sequence $x_n$ converges."
A) $f(x)=\frac{x^2+3}{2x}$

$=\frac{x}{2}+\frac{3}{2x}$

$\ge 2\sqrt{\frac{x}{2}\cdot \frac{3}{2x}}$ (AM-GM inequality, which holds for $x>0$)

$=\sqrt{3}$

So, if $x>0$, then $f(x)\ge \sqrt{3}$.

Equality holds only when

$\frac{x^2+3}{2x}=\sqrt{3}$

$x^2+3=2\sqrt{3}x$

$x^2-2\sqrt{3}x+3=0$

$(x-\sqrt{3})^2=0$

$x=\sqrt{3}$

So, if $x>0$ and $x\neq\sqrt{3}$, then $f(x)>\sqrt{3}$.

In particular, if $x>\sqrt{3}$, then $f(x)>\sqrt{3}$.


text:
2,452 views

In relational databases, if relation R is in BCNF, then which of the following is true about relation R?

1. R is in 4NF
2. R is not in 1NF
3. R is in 2NF and not in 3NF
4. R is in 2NF and 3NF

Option 4.
edited
Option 4 is correct
Option D is correct.

$\therefore$ Option $4.$ is correct.

by
A relation is  in 'N' Normal Form it means it must be in 1NF,2NF,......N-1 NF.

Standard Normal Form Hiearchy

1NF - > 2NF - > 3NF - > BCNF

So Realtion is in BCNF then it must be in 1NF,2NF & 3NF Hence Opton 4 is correct.
Option D.

If Relation is in BCNF then it must be 1NF,2NF,3NF.
It also in 2nf and 3 nf


text:
Article

# Unconventional superconductivity in Na$_{0.35}$CoO$_{2}\cdot$1.3D$_{2}$O and proximity to a magnetically ordered phase

[more]
04/2004;
Source: arXiv

ABSTRACT Muon spin relaxation ($\mu$SR) measurements on the new layered cobalt oxide superconductor Na$_{0.35}$CoO$_{2}\cdot$1.3H$_{2}$O and its parent, non-superconducting compounds, have revealed unconventional nature of superconductivity through: (1) a small superfluid energy which implies a surprisingly high effective mass of the charge carriers, approximately 100 times the bare electron mass; (2) the superconducting transition temperature $T_{c}$ scaling with the superfluid energy following the correlations found in high-$T_{c}$ cuprate and some other two-dimensional superconductors; (3) an anisotropic pairing without broken time-reversal symmetry; and (4) the proximity of a magnetically ordered insulating phase at Na$_{0.5}$CoO$_{2}$ below $T_{N}$ = 53 K.

0 Followers
·
79 Views
• Source
##### Article: Possible Spin-Tripletf-Wave Pairing Due to Disconnected Fermi Surfaces In NaxCoO2·yH2O
[Hide abstract]
ABSTRACT: We propose that the spin-triplet pairing mechanism due to disconnected Fermi surfaces proposed in our previous study [Phys. Rev. BPRBMDO0163-1829 63, 174507 (2001)10.1103/PhysRevB.63.174507] may be at work in a recently discovered superconductor NaxCoO2·yH2O. We introduce a single band effective model that takes into account the pocketlike Fermi surfaces along with the van Hove singularity near the K point found in the band calculation results. Applying the fluctuation exchange method and solving the linearized Éliashberg equation, the most dominant pairing is found to have spin-triplet f-wave symmetry, where the nodes of the gap function do not intersect the pocket Fermi surfaces. The presence of finite Tc is suggested in sharp contrast to cases when the gap nodes intersect the Fermi surface.
Physical Review Letters 08/2004; 93(7). DOI:10.1103/PhysRevLett.93.077001 · 7.73 Impact Factor
• ##### Article: Nodal $d+id$ pairing and topological phases on the triangular lattice: unconventional superconducting state of Na$_x$CoO$_2\cdot y$H$_2$O
[Hide abstract]
ABSTRACT: We show that finite angular momentum pairing chiral superconductors on the triangular lattice have point zeroes in the complex gap function. A topological quantum phase transition takes place through a nodal superconducting state at a specific carrier density $x_c$ where the normal state Fermi surface crosses the isolated zeros. For spin singlet pairing, we show that the second nearest neighbor $d+id$-wave pairing can be the dominant pairing channel. The gapless critical state at $x_c\simeq0.25$ has six Dirac points and is topologically nontrivial with a $T^3$ spin relaxation rate below $T_c$. This picture provides a possible explanation for the unconventional superconducting state of Na$_x$CoO$_2\cdot y$H$_2$O. Analyzing a pairing model with strong correlation using the Gutzwiller projection and symmetry arguments, we study these topological phases and phase transitions as a function of Na doping.
• Source
##### Article: Order and disorder in the triangular-lattice t-J-V model at 2 /3 electron density
[Hide abstract]
ABSTRACT: Motivated by the recent discovery of superconductivity in NaxCoO2.yH(2)O, we use series expansion methods and cluster mean-field theory to study spontaneous charge order, Neel order, ferromagnetic order, dimer order and phase-separation in the triangular-lattice t-J-V model at 2/3 electron density. We find that, for t<0, the charge ordered state, with electrons preferentially occupying a honeycomb lattice, is very robust. Quite surprisingly, hopping to the third sublattice can even enhance Neel order. At large negative t and small V, the Nagaoka ferromagnetic state is obtained. For large positive t, charge and Neel order vanish below a critical V, giving rise to an itinerant antiferromagnetically correlated state.
Physical review. B, Condensed matter 07/2004; 70(2). DOI:10.1103/PhysRevB.70.020504 · 3.66 Impact Factor


text:
### 13.3 Completing the Square in Quadratic Expressions

Problem #

Problem Statement

Problems Similar To

1.

What should be added to the expression to complete the square?

$$x^{2}+16x$$

2.

What should be added to the expression to complete the square?

$$x^{2}-9x$$

3.

What should be added to the expression to complete the square?

$$2x^{2}+12x$$

4.

What should be added to the expression to complete the square?

$$4x^{2}-6x$$


text:
Related Tags

java
communitycreator
math.atan()
math

# What is Math.atan() in Java?

Tarun Telang

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Java has a built-in Math class, defined in the java.lang package, which contains important functions to perform basic mathematical operations.

The class has the atan() method, which is used to compute an $\arctan$ or $\tan^{-1}$ (pronounced as “inverse tangent”) of the specified value.

If $tan(\theta)$ is x then $tan^{-1}$(x) or $arctan(x)$ is $\theta$.

## Method definition

public  static double atan(double value);

### Parameter

value represents the double value for which we have to find the arc tangent.

### Return value

The function returns the double value corresponding to the arctangent of the value. The returned value will lie within the range $\pi/2$ to $-\pi/2$.

Note: Math.PI is a constant equivalent to $\pi$ in Mathematics.

If the value is infinity or NaNnot a number, then the returned value is NaN.

Note: To convert an angle measured in radians to an equivalent angle measured in degrees and vice versa, you can use the built-in Math.toDegrees(double angle_in_randians) and Math.toRadians(double angle_in_degrees) methods.

## Code

class HelloWorld {    public static void main( String args[] ) {        double result = Math.atan(1);        System.out.println("atan(1) = " + result);        result = Math.atan(0);        System.out.println("atan(0) = " +  result);        result = Math.atan(0.48);        System.out.println("atan(0.48) = " + result);        result = Math.atan(0.66);        System.out.println("atan(O.66) = " + result);        result = Math.atan(0.8);        System.out.println("atan(0.8) = " + result);        result = Math.atan(1);        System.out.println("atan(1) = " + result);        result = Math.atan(Double.NaN);        System.out.println("atan(NaN) = " + result);        result = Math.atan(Double.POSITIVE_INFINITY);        System.out.println("atan(∞) = " + result);    }}
Example code for Math.atan() in Java

RELATED TAGS

java
communitycreator
math.atan()
math

CONTRIBUTOR

Tarun Telang


text:
For wer points ur kitt's Presentation lymphomia. Summarize the relevant facts of the case Consider the...

Question:

for wer points ur kitt's Presentation lymphomia. Summarize the relevant facts of the case Consider the differential diagnosis Include lab data and indicate if the result is normal or abnormal If infectious decribe the causative agent agent. Describe the pathology of the disease Describe therapy and prognosis On the last slide indicate reference Use atation PPPP

Similar Solved Questions

The decomposition of N2O5 18.3 2N2O5 4NO2+O2 is studied by measuring the concentration of oxygen as...
The decomposition of N2O5 18.3 2N2O5 4NO2+O2 is studied by measuring the concentration of oxygen as a func- tion of time, and it is found that OlP dt (1.5 x 10sN2O5] = at constant temperature and pressure. Under these conditions the reaction goes to completion to the right. What is the half- life of...
We were unable to transcribe this imagewrite this equation as x = g (x ) in three different forms. Apply convergence test to each of these forms, Which g (x) is more suitable for the fixed point...
We were unable to transcribe this imagewrite this equation as x = g (x ) in three different forms. Apply convergence test to each of these forms, Which g (x) is more suitable for the fixed point iteration. Compute first 4 iterations by taking and graph each value of x and g (x) to show convergence o...
Process Costing using the Weighted-Average Method 1. Compute the equivalent units of production using the weighted-average...
Process Costing using the Weighted-Average Method 1. Compute the equivalent units of production using the weighted-average method. 2. Compute the cost per equivalent unit using the weighted average method. 3. Assign costs to units using the weighted-average method 4. Prepare a cost reconciliation re...
Before you begin, print out all the pages in this workbook. Roth Contractors Corporation was incorporated...
Before you begin, print out all the pages in this workbook. Roth Contractors Corporation was incorporated on December 1, 2019. Required: Part A 1 Prepare journal entries to record the December transactions shown on page "Transactions Pt. A". General ledger account numbers and descriptions ar...
1. Brahy 2. KBuo 3. NBS 4. Hz. Pd/C 5. NaCN 6. H30*, heat 7. SOCI...
1. Brahy 2. KBuo 3. NBS 4. Hz. Pd/C 5. NaCN 6. H30*, heat 7. SOCI CH3 H3C 8. (an ou then H20 Work out the above synthesis on a separate sheet of paper, and then draw the organic product of reaction 5. You do not have to consider stereochemistry. • You do not have to explicitly draw H atoms. &bu...
8. Explain the terms: a. hacker, b. criminal hacker (cracker), c. script bunnies, and d. insiders.
8. Explain the terms: a. hacker, b. criminal hacker (cracker), c. script bunnies, and d. insiders....
4-13. Suppose the economy's labor market is competitive and that labor demand can be written as...
4-13. Suppose the economy's labor market is competitive and that labor demand can be written as w = 50 -0.3E while labor supply can be written as w= 8 +0.2E where E is the total amount of employment in millions. What is the market clearing wage? How many people are employed? What is the total va...
Why is it important for firms to maintain a minimum cash balance when the cost of...
Why is it important for firms to maintain a minimum cash balance when the cost of doing so is greater than the return generated by the funds held in reserve?...
You are asked to review patient satisfaction research and make a presentation to your colleagues. Which...
You are asked to review patient satisfaction research and make a presentation to your colleagues. Which of the following best describes the conclusions of research about patient satisfaction? Patients judge caregivers on the following factors (in order of importance): technical skills, good be...
From the IR spectrum shown below, suggest functional groups that you recognized, and with the peak...
From the IR spectrum shown below, suggest functional groups that you recognized, and with the peak (wave number, 1/cm group test you would use. also suggest which functional INFRARED SPECTRUM Transmitance 3000 2000 1000...
Josh starts his sled at the top of a 2.0 m-high hill that has a constant slope of 25 degrees
Josh starts his sled at the top of a 2.0 m-high hill that has a constant slope of 25 degrees . After reaching the bottom, he slides across a horizontal patch of snow. The hill is frictionless, but the coefficient of kinetic friction between his sled and the snow is 0.07....
The FIRST trophic level refers to a. all animals b. all consumers c. all herbivores d....
The FIRST trophic level refers to a. all animals b. all consumers c. all herbivores d. all chemo and photsynthetic organism e. sunlight...
Which one of the following statements is true? The heat of solution in H2O for KOH...
Which one of the following statements is true? The heat of solution in H2O for KOH is the same as that for KOH • H2O. For a compound to spontaneously dissolve in H2O at 25 °C, the solution process must be exothermic. Ne is less soluble in H2O at 2 atm pressure than at 1 atm pressure. C2H4 i...
What are the seven (7) major responsibilities of health educators?
What are the seven (7) major responsibilities of health educators?...


text:
# 13.3. bz2 — Support for bzip2 compression¶

Source code: Lib/bz2.py

This module provides a comprehensive interface for compressing and decompressing data using the bzip2 compression algorithm.

The bz2 module contains:

All of the classes in this module may safely be accessed from multiple threads.

## 13.3.1. (De)compression of files¶

bz2.open(filename, mode='r', compresslevel=9, encoding=None, errors=None, newline=None)

Open a bzip2-compressed file in binary or text mode, returning a file object.

As with the constructor for BZ2File, the filename argument can be an actual filename (a str or bytes object), or an existing file object to read from or write to.

The mode argument can be any of 'r', 'rb', 'w', 'wb', 'x', 'xb', 'a' or 'ab' for binary mode, or 'rt', 'wt', 'xt', or 'at' for text mode. The default is 'rb'.

The compresslevel argument is an integer from 1 to 9, as for the BZ2File constructor.

For binary mode, this function is equivalent to the BZ2File constructor: BZ2File(filename, mode, compresslevel=compresslevel). In this case, the encoding, errors and newline arguments must not be provided.

For text mode, a BZ2File object is created, and wrapped in an io.TextIOWrapper instance with the specified encoding, error handling behavior, and line ending(s).

New in version 3.3.

Changed in version 3.4: The 'x' (exclusive creation) mode was added.

Changed in version 3.6: Accepts a path-like object.

class bz2.BZ2File(filename, mode='r', buffering=None, compresslevel=9)

Open a bzip2-compressed file in binary mode.

If filename is a str or bytes object, open the named file directly. Otherwise, filename should be a file object, which will be used to read or write the compressed data.

The mode argument can be either 'r' for reading (default), 'w' for overwriting, 'x' for exclusive creation, or 'a' for appending. These can equivalently be given as 'rb', 'wb', 'xb' and 'ab' respectively.

If filename is a file object (rather than an actual file name), a mode of 'w' does not truncate the file, and is instead equivalent to 'a'.

The buffering argument is ignored. Its use is deprecated.

If mode is 'w' or 'a', compresslevel can be a number between 1 and 9 specifying the level of compression: 1 produces the least compression, and 9 (default) produces the most compression.

If mode is 'r', the input file may be the concatenation of multiple compressed streams.

BZ2File provides all of the members specified by the io.BufferedIOBase, except for detach() and truncate(). Iteration and the with statement are supported.

BZ2File also provides the following method:

peek([n])

Return buffered data without advancing the file position. At least one byte of data will be returned (unless at EOF). The exact number of bytes returned is unspecified.

Note

While calling peek() does not change the file position of the BZ2File, it may change the position of the underlying file object (e.g. if the BZ2File was constructed by passing a file object for filename).

New in version 3.3.

Changed in version 3.1: Support for the with statement was added.

Changed in version 3.3: The fileno(), readable(), seekable(), writable(), read1() and readinto() methods were added.

Changed in version 3.3: Support was added for filename being a file object instead of an actual filename.

Changed in version 3.3: The 'a' (append) mode was added, along with support for reading multi-stream files.

Changed in version 3.4: The 'x' (exclusive creation) mode was added.

Changed in version 3.5: The read() method now accepts an argument of None.

Changed in version 3.6: Accepts a path-like object.

## 13.3.2. Incremental (de)compression¶

class bz2.BZ2Compressor(compresslevel=9)

Create a new compressor object. This object may be used to compress data incrementally. For one-shot compression, use the compress() function instead.

compresslevel, if given, must be a number between 1 and 9. The default is 9.

compress(data)

Provide data to the compressor object. Returns a chunk of compressed data if possible, or an empty byte string otherwise.

When you have finished providing data to the compressor, call the flush() method to finish the compression process.

flush()

Finish the compression process. Returns the compressed data left in internal buffers.

The compressor object may not be used after this method has been called.

class bz2.BZ2Decompressor

Create a new decompressor object. This object may be used to decompress data incrementally. For one-shot compression, use the decompress() function instead.

Note

This class does not transparently handle inputs containing multiple compressed streams, unlike decompress() and BZ2File. If you need to decompress a multi-stream input with BZ2Decompressor, you must use a new decompressor for each stream.

decompress(data, max_length=-1)

Decompress data (a bytes-like object), returning uncompressed data as bytes. Some of data may be buffered internally, for use in later calls to decompress(). The returned data should be concatenated with the output of any previous calls to decompress().

If max_length is nonnegative, returns at most max_length bytes of decompressed data. If this limit is reached and further output can be produced, the needs_input attribute will be set to False. In this case, the next call to decompress() may provide data as b'' to obtain more of the output.

If all of the input data was decompressed and returned (either because this was less than max_length bytes, or because max_length was negative), the needs_input attribute will be set to True.

Attempting to decompress data after the end of stream is reached raises an EOFError. Any data found after the end of the stream is ignored and saved in the unused_data attribute.

Changed in version 3.5: Added the max_length parameter.

eof

True if the end-of-stream marker has been reached.

New in version 3.3.

unused_data

Data found after the end of the compressed stream.

If this attribute is accessed before the end of the stream has been reached, its value will be b''.

needs_input

False if the decompress() method can provide more decompressed data before requiring new uncompressed input.

New in version 3.5.

## 13.3.3. One-shot (de)compression¶

bz2.compress(data, compresslevel=9)

Compress data.

compresslevel, if given, must be a number between 1 and 9. The default is 9.

For incremental compression, use a BZ2Compressor instead.

bz2.decompress(data)

Decompress data.

If data is the concatenation of multiple compressed streams, decompress all of the streams.

For incremental decompression, use a BZ2Decompressor instead.

Changed in version 3.3: Support for multi-stream inputs was added.


text:
# Tag Info

3

In your first case, you will have 30 * 7 + 1 parameters to explain 30 * 20 data points. With such a complex model you are bound to overfit and memorize your training data to a degree. With such a small sample size, your validation results can also be unreliable and merely due to chance. I would maybe try leave-one-out cross-validation to at least get some ...

0

If prediction of those specific classes is not of particular interest, you can group them. Note that you should have a minimum number of observations per group in order to be able to even estimate your parameters correctly (I can't remember what the formula is off the top of my head). Grouping small classes to meet that minimum requirement is common. With ...

4

Neural networks, in vast majority of cases, need lots of data. If you have 20 observations, neural network is clearly a bad choice. With that small sample size, network would easily memorize the data and overfit. Even cross-validation with that small sample size is disputable, because you'd be validating the results on just few samples at a time. With that ...

1

Assuming that this is a plot of x vs. y, the common variance assumption is clearly off. There is much greater variance on the right side of the plot than the left, indicating that y is less well predicted by x as x increases (at least in absolute terms). You could do various tests for heteroscedasticity, but I suggest using both OLS regression and a model ...

1

Your procedure is overly complicated, just use bootstrap. With bootstrap you would randomly, with replacement, take samples of size $n$, out of your dataset of size $n$. At each iteration you would repeat the whole procedure, including fitting your model, making predictions, and calculating accuracy. You would repeat this many times (hundreds or more) and ...

0

I had same problem. After going through many of suggestions available on web and implementing it (I don't remember exactly which one) I came to know that it happened because of convolution layer got input which is outside the intended input. Introducing batch normalization at the input layer solved the problem for me.

0

TL;DR: Discount factors are associated with time horizons. Longer time horizons have have much more variance as they include more irrelevant information, while short time horizons are biased towards only short-term gains. The discount factor essentially determines how much the reinforcement learning agents cares about rewards in the distant future relative ...

1

Disclaimer: I have not read the 95 pages paper. But I'll tackle the more general question: Aren't training and test sets coming from different distributions usually a problem to be avoided, not something that is done on purpose? No it's not a problem. On the contrary, IMHO it should be done more often. What is problematic is using a model to predict ...

1

Very intersting question, and I've been reading through this paper for a little while now, trying to understand, and here's my best guess at why this was done: The ML part of this paper is just restricted to just the first part of the study, where the objective is to simply predict (using the hourly wage variable in the dataset) which individuals earn an ...

0

0

The key idea is that cross-validation is not a method for finding out how well a model generalizes, but how well a procedure for fitting a model generalizes. So if your model has hyper-parameters that are tuned via cross-validation, then that is an integral part of the model fitting procedure and needs to be included in the outer cross-validation as well, ...

2

The ELBO is, as usual, given by \begin{align} \mathcal{L} ( q ) &= \log p ( x ) - KL ( q ( z ) || p ( z | x) ) \\ &= \int q ( z ) \log \frac{ p ( x, z ) }{ q ( z )} dz \\ &= \mathbf{E}_q \left[ \log p ( x, z ) \right] + \mathcal{H} ( q ) \end{align} where $\mathcal{H}$ is the entropy. Now, if $q ( z ) = \mathcal{N} ( \mu, \Sigma )$, one has ...

0

A few thoughts: First, even if you ultimately need to evaluate the accuracy of your model, training and testing your model on accuracy is probably not be the best way to proceed. This issue is discussed extensively on this site, with this page being a good place to start. That probably explains why your cross-entropy losses (log losses) agree much better ...

2

When the sampling is termed "random" it usually means you do the equivalent of the following, as described in more detail at https://stats.stackexchange.com/a/54894/919 and https://stats.stackexchange.com/a/96000/919: Write down the name of each element of the set $S$ on one or more slips of paper (the "tickets"). Place these tickets into a box in such ...

0

First of all, you need to adjust your usage of some terms. For instance, your problem does not look like an anomaly detection problem because anomaly stands for rare events and abandon a form is not a rare event most of the time. Second is that just because your data is time-based your problem not necessarily turns into a time series modeling problem i.e you'...

0

imagen you have a target class with 10 target classes: class 0, class 2, ...., class 9 In the first example you will have only one target column called sparse labels, e.g.: columnA columnB target 10 10 0 1 24 2 ... in the second exmaple you will have one target column for every class: columnA columnB class 0 class 1 class 2 .... 10 ...

2

Some -- indeed many -- histograms relate to theoretical distributions. They're an entirely natural and conventional way for showing theoretical discrete distributions in particular, such as binomial or Poisson distributions. (But how well they do that is an interesting and sometimes important detail, yet is another story.) With theoretical include fitted, ...

0

This article lists a number of internal cluster validity indices: https://www.ncbi.nlm.nih.gov/pubmed/26389570. These internal indices are used to determine the quality of your clusters and some of these have been implemented in sklearn. Considering your tag I am going to assume that you are using Python. Here is a link to the cluster performance metrics ...

2

Of course, the specifics will depend on your particular nonparametric method. Gradient boosting is a meta-method, and it typically uses classification and regression trees (CARTs), so I'll work with that. An interaction is of the following abstract form: The impact of a predictor A on the outcome depends on the value of a different predictor B. CARTs ...

1

Indeed, it would be best to have a deeper description of the variables at stake, to better understand the available resources and the logistics of the problem. However, if you say that your goal is to forecast delays, just note that those are a time series in themselves; hence, you can directly model them, disregarding delivery times. Now, you have two ...

5

Seaborn's pairplot gives out what's called a "correlation plot" (see another example using MATLAB here). Since a correlation of a variable $X$ and itself is always one, there's little use displaying this. So by convention these plots plot out the variable's histogram/distribution instead. This is also noted in the function's documentation: The diagonal ...

2

My question is how can we know the exact position of the 'test_data', since we do not know the y_label of 'test data' The entire point of training the model is to predict the y_label from the feature precisely because we do not have access to the y_label at prediction time. You are right that we are not certain about the y_label even after fitting the ...

0

It appears the threshold is chosen to maximize the F1-score. Prediction Threshold For classification problems, when running h2o.predict() or .predict(), the prediction threshold is selected as follows: If you train a model with only training data, the Max F1 threshold from the train data model metrics is used. If you train a model with train ...

1

The point isn't to fit the data sample. It's to try to model the underlying physical processes that led to your data sample, in a way that accomplishes some desired goal. Trivially, the "best fit" to your data sample is a function defined only at the observed values of $x_i$, taking the corresponding observed value of $y_i$ at each $x_i$. I know that's not ...

1

If your dataset is so large that working with the entire thing is intractable then I'm not sure you have a choice other than sampling it (unless you're asking if a simple random sample, compared to other sampling techniques, is a good choice). Another sampling technique specifically for imbalanced data is SMOTE (Synthetic Minority Over-sampling Technique). ...

1

Usually a "best" fit is defined by some function of proximity to the data, like ordinary least squares linear fits. Otherwise, "best" is defined by some function of proximity to new data drawn from the same population. Overfitting is when your data matches the sample very closely but the new data from the same population very poorly. In either case, you're ...

1

Here is an article which discusses classification with imbalanced data: https://www.worldscientific.com/doi/abs/10.1142/S0218001409007326. The article mentions that: Classification of data with imbalanced class distribution has encountered a significant drawback of the performance attainable by most standard classifier learning algorithms which ...

1

you might find this article interesting: https://www.ncbi.nlm.nih.gov/pubmed/15572470. It is about: Optimal number of features as a function of sample size for various classification rules. It includes some 3D-plots of the error rate, sample size and feature size, for a number of algorithms e.g. SVM. Their research concluded that: First, the behavior of ...

0

In this context, what is exploitation? Can someone give a concrete example of exploitation? from the article: Then, in the exploitation step, you use the identified characteristics to figure out the next things to explore. You then repeat the above two steps until you are satisfied with what you have learned from the data and the answer is also in the ...

0

If you assume some gaussian prior on weights, and are willing to accept some small quantization error, then you can do the following: Quantize your weights/prior to some very fine tolerance Encode them with the optimal code corresponding to your prior. This should take $-\log P(\theta)$ bits where $P$ is your prior and $\theta$ are your parameters Of ...

0

The direct Fourier interpretation would indeed be $\cos(w^T x), \sin(w^T x)]$, as you've listed. You've actually slightly misunderstood the paper's proposal for only-cosine features, though; they use $\sqrt{2} \cos(w^T x + b)$, with $b \sim \mathrm{Uniform}[0, 2 \pi]$. Then \begin{align} \sqrt{2}\cos(w^T x + b) \sqrt{2}\cos(w^T y + b) &= \cos((w^T x + b)...

2

A related kernel that is valid is $$k(x, y) = \lVert x \rVert^\beta + \lVert y \rVert^\beta - \lVert x - y \rVert^\beta$$ for $0 < \beta \le 2$; see Example 15 of Sejdinovic, Sriperumbudur, Gretton, and Fukumizu, Equivalence of distance-based and RKHS-based statistics in hypothesis testing, Annals of Statistics 2013. You can also use  \lVert x - z \...

1

This will never work! No matter what $\beta$ you choose. Take three distinct points in any $\mathbb{R}^n$ and the determinant of your kernel matrix $(t(x_i,x_j))$ will be negative for every $\beta$. Background: A function $t(\|x-y\|)$ defines a positive kernel on every $\mathbb{R}^n$, iff $t:[0,\infty[\rightarrow\mathbb{R}$ is "totally monotone"; totally ...

1

To me, this looks like normal behaviour. It could happen if, for example: method 1 (black line) is a more complicated model with a large number of trainable parameters method 2 (blue line) is a simpler model with only a few trainable parameters. In that case, for small sample sizes: method 1 has only a few data points for a lot of parameters and overfits ...

1

The interpretation of your results depends on what you want to achieve. What do you cant to achieve by clustering your data? If you want to make predictions of house prices you should use regression models, as you already mentioned yourself. In general, the performance of a clustering algorithm can be measured for instance by inter- and intra-cluster ...

3

We can pose PCA as a variance maximization problem. These are some of the hints: The objective is to find the directions in which the variance, $\Bbb E(\vec X \vec X^T)$, is maximum. Let $\vec w$ denote the unit vector direction along which the variance is maximum. The variance along this direction is given by: \begin{aligned} \sigma_{\vec{\omega}^{2}}^{...

0

There are a couple of problems with your plan. While your goal of improving speed is laudable is it appropriate for the problem at hand. The first problem is that if you are minimizing $f(\theta,\hat{\theta})$ and you are trying to substitute solving it as $g(\theta,\hat{\theta})$ then the question would become "what about this substitution would make ...

1

It depends. If your model will be applied to sound coming from one specific microphone, training the model on only sounds recorded with that microphone makes sense. However, if your model needs to be more robust, and perform well on sound recorded with different microphones, then you should have such variations in your dataset accordingly. As jonnor ...

3

I agree with BruceET comment about Fisher's Exact Test: The only way two Bernoulli distributions may differ from each other is by having different $p$ parameters i.e. the probability of success (it has nothing to do with p-value). So basically you have samples from Bernoulli distribution and you want to do a statistical test if the probabilities of success ...

1

I think your understanding is mostly fine. :) I alluded to what happens during the first boosting iteration in the earlier question: Why we fit xᵢ vs errorᵢ in Gradient Boosting. The first iteration is consider to start either from the 0 or the mean value of the response variable. Some packages (e.g. LightGBM) even go as far as to provide a ...

2

I struggled with this same problem--decomposing variance in high-dimensional prediction problems without limiting myself to fitting many, many linear regression models--and came up with the following solution: Shapley Decomposition of R-Squared in Machine Learning Models (with an R implementation). I would say that the trick in an applied setting is to ...

0

Look into splines which is a quite flexible modeling tool. For instance Flexible and inflexible models in machine learning.

0

If you are using a random sample of people, how can you choose how many from each group? But maybe you want to estimate a model from this sample (and retrospectively obtained demographic data), to use in future ... Maybe in future you really want to find the people in group 3. Then I would try multinomial logistic regression. Then you would have a ...

0

If you are just worried about the distance measure in the clustering, any type of scaling/normalization should work. I would recommend a StandardScaler, but MinMaxScaler or Normalizer should work as well.

0

Is this scenario suitable for a ML approach? Your problem seems to be closer to Information Retrieval than machine learning. Could you point me to any existing algorithms to have a closer look at? Any suggestions for a practical implementation of the given scenario? Search engines, the data structure you are looking for is called inverted index. There ...

0

Are you training your network with a single one of those training sets? Meaning that you just have 200 samples for the training of which one is positive and the rest negative? I think this is a tough classification problem anyways, because you classes are highly imbalanced. In this case, you usually want to re-balance the dataset, but this might be ...

-1

find-s algorithm is used to find the most specific hypothesis it will not consider the instance in which the output is false or 0. So, The Hypothesis are after each instance and neglecting the 3rd instance ['sunny', 'warm', 'normal', 'strong', 'warm', 'same'] ['sunny', 'warm', '?', 'strong', 'warm', 'same'] ['sunny', 'warm', '?', 'strong', '?', '?'] And the ...

1

I would run a sequential neural network in python with keras: https://keras.io/getting-started/sequential-model-guide/ The idea is to vectorize your textes first with the words. For example: I have a dream about yesterday I want to sleep Would give you the Words list: 'I, have, a, dream, about, yesterday, want, to, sleep' Then this words will be your ...

1

For the "leaf" value, you might find an explanation here or here and "cover" according to the documentation (see here) is the average coverage of splits which use the feature where coverage is defined as the number of samples affected by the split.

0

You are mapping intensity as function of time and frequency. That is: you have a map like $\mathbb{R}_+^2 \to \mathbb{R}_+$. This is much like many other types of mappings from 2d coordinates to some 1d level. E.g. height maps, temperature maps, etc. Technically, you would indeed not need colours or 3 RGB channels, to express the (1 dimensional) result. ...

Top 50 recent answers are included


text:
Kepler's Law, focal points - Heliocentric or Barycentric?

It is known that all the mass in the Solar system moves around the Barycenter.

For the two focal points in Kepler's law; is the first focal point $$F_1$$ a Heliocenter? Or is it actually a Barycenter?

If the $$F_1$$ is a Heliocenter, then, can the same exact ellipse and eccentricity of orbit be maintained by adjusting the second focal point $$F_2$$ and taking Barycenter as $$F_1$$ instead of Heliocenter?

Kepler's laws and the associated orbit only hold for a two-body problem, so the 'barycenter' in the question can only be understood as the center of mass of the sun and a particular planet (ignoring the other ones), not as the solar system barycenter. And in this sense the convention is to take the sun at the focus, which means the semi-major axis is the (maximum) distance between the sun and the planet.

If you define the orbits with regard to the center of mass of the two bodies, the semi-major axis is reduced by the mass factor $$m/(M+m)$$ for the planet and $$M/(M+m)$$ for the sun whilst the eccentricity as well as the orbital period stays the same. However, with the center of mass only a fictitious point that does not correspond to a physical object, this hardly makes sense in practice.

Planetary orbits are normally described as heliocentric, but it is possible to describe them from a barycentric point of view. JPL Horizons (https://ssd.jpl.nasa.gov/horizons.cgi) provides for both possibilities.

It depends!

If we plotted the orbits of the innermost planets in our solar system, they would be closer to ellipses with the Sun at one focus.

If we plotted the orbit of Jupiter, the biggest "gravitational bully" in the solar system (it messes with everything!) it would be closer to an ellipse with the Sun-Jupiter barycenter at one focus.

It gets a little complicated out there because the next three planets (Saturn, Uranus and Neptune) also push the Sun around a lot. We might think that lightweight Neptune wouldn't do much, but it's larger distance makes up somewhat for its smaller mass, since the center of mass is weighted by the distance*mass product.

• +1 If one models the solar system composed of the sun and eight planets, is there a way to relate the focus of the orbit of one of those planets to the barycenter of the system? Would it merely be a change of reference frame? Jul 6 at 14:01
• @DaddyKropotkin I think so. To first order Jupiter's effect can be thought of as far enough away and changing slowly enough that it accelerates the Sun and the inner planets in a sufficiently similar way that the inner planets move about the Sun in nice elliptical orbits even though as a group they all dance with Jupiter without "knowing" it.
– uhoh
Jul 7 at 0:51


text:
# 1. The Green Company makes tables. Job 489 is to build 20 tables. Job 489 requires...

###### Question:

1. The Green Company makes tables. Job 489 is to build 20 tables.

Job 489 requires $680 of direct materials and 30 hours of direct labor costing$530. Also use the following information about the company:

Total fixed manufacturing overhead cost estimated for all jobs during the whole year $480,000 Estimated direct labor hours for all jobs during the whole year 60,000 Estimated variable manufacturing overhead cost per direct labor hour$3

Calculate the following if the Green Company uses the traditional method of job order costing with one company-wide predetermined overhead rate using direct labor hours as the allocation base:

b. The manufacturing overhead cost applied to job 489

c. The total cost of job 489

d. The cost per unit (per table)

2. The Blue Company makes boats. Job 589 is to build 10 boats. The company has 2 departments – assembly and fabrication. The assembly department allocates manufacturing overhead to jobs based on direct labor hours. The fabrication department allocates manufacturing overhead to jobs based on machine hours.

Assembly Department Fabrication Department

Total fixed manufacturing overhead cost estimated

for all jobs during the whole year $480,000$560,000

Estimated direct labor hours for all jobs during the whole year 80,000 60,000

Estimated machine hours for all jobs during the whole year 20,000 70,000

Estimated variable manufacturing overhead cost per direct labor hour $9 ------ Estimated variable manufacturing overhead cost per machine hour -----$6

The following data is for Job 589:

Assembly Department Fabrication Department

Direct materials cost $400$600

Direct labor cost $900$300

Direct labor hours used 70 20

Machine hours used 30 50

a. the total direct materials cost

b. the total direct labor cost

c. The predetermined overhead rate for the Assembly department

d. The predetermined overhead rate for the Fabrication department

e. The manufacturing overhead cost applied to job 589 by the Assembly department

f. The manufacturing overhead cost applied to job 589 by the Fabrication department

g. The total manufacturing overhead cost applied to job 589

h. The total cost of job 589

i. The cost per unit (per boat)

#### Similar Solved Questions

##### How many computers? In simple random sample of 200 households, the sample mean nuDer of personal computers Was 2.49_ Assume the population standard deviation is 0.55.Part out 0f 4 Coustruct 98% confidence interval for the Mean number of personal computers. Round the answers t0 two decimal places if necessary:98% confidence Intetval for the MeAn Humber of personal computers Is
How many computers? In simple random sample of 200 households, the sample mean nuDer of personal computers Was 2.49_ Assume the population standard deviation is 0.55. Part out 0f 4 Coustruct 98% confidence interval for the Mean number of personal computers. Round the answers t0 two decimal places if...
##### Docs th: function p6)Choou [e ArtaTeprcsenl discrelc probability distributicn for * = 0 1,3
Docs th: function p6) Choou [e Arta Teprcsenl discrelc probability distributicn for * = 0 1,3...
##### Hip surgery: In sample of 117 hip surgeries of certain type the average surgery time was 135.7 minutes with standard deviation of 21.9 minutes_Pait: 0 / 2Pait of 2Construct a 99590 confidence interval for the mean surgery time for this procedure Round the answers to one decimal placeA 99.500 confidence interva for the mean surgery time for this procedure is< H
Hip surgery: In sample of 117 hip surgeries of certain type the average surgery time was 135.7 minutes with standard deviation of 21.9 minutes_ Pait: 0 / 2 Pait of 2 Construct a 99590 confidence interval for the mean surgery time for this procedure Round the answers to one decimal place A 99.500 con...
##### 2) Octahedral [Cu"(HzO)a] ; tends to distort by elongating (or compressing) two bonds along one of its axes; as shown below. What would the driving force for this distortion be? Answer this question by_OHzOHz Hzolle Cu"'OHz HzO OHzHzolllag Cu" IOHz HzO OHzOHzOHzDaha)_drawing d-orbital splitting diagram for both the octahedral and Dah molecule with elongated bonds_ The Dah character table (shown below) may help with this problem: sure to label the orbitals in your diagram and
2) Octahedral [Cu"(HzO)a] ; tends to distort by elongating (or compressing) two bonds along one of its axes; as shown below. What would the driving force for this distortion be? Answer this question by_ OHz OHz Hzolle Cu"'OHz HzO OHz Hzolllag Cu" IOHz HzO OHz OHz OHz Dah a)_drawi...
##### Find dy for each of the following: dxa) y = (x?+)x -3)b)y = Sin( x2 _ 1)+ cot(3x)
Find dy for each of the following: dx a) y = (x?+)x -3) b) y = Sin( x2 _ 1)+ cot(3x)...
##### 62) What is the solubility of XCOs in a saturated solution of H.COs at pH = 6? [HzCO;] = 0.034 (Spts) XCOs (s) 4 X2+ CO;? Kyp = 1.67.10.9 HCOs 2 Ht CO;? K =241.10 "7
62) What is the solubility of XCOs in a saturated solution of H.COs at pH = 6? [HzCO;] = 0.034 (Spts) XCOs (s) 4 X2+ CO;? Kyp = 1.67.10.9 HCOs 2 Ht CO;? K =241.10 "7...
##### Question 2 (20 points) Find the values of p for which the following integral converges:rP ln(r)dc.Input your answer by writing it a5 an interval. For example; if the values of p where the integral converges were 3 < p then we would put [-3.7) in the blank below: Use INF and -INF (in upper-case letters) for positive and negative infinity if needed: If the improper integral diverges for all values of p, then type in D in the blank provided
Question 2 (20 points) Find the values of p for which the following integral converges: rP ln(r)dc. Input your answer by writing it a5 an interval. For example; if the values of p where the integral converges were 3 < p then we would put [-3.7) in the blank below: Use INF and -INF (in upper-case ...
##### Provide formulas and calculations 2-5 Government Organization A social welfare agency has a govem ment budget...
provide formulas and calculations 2-5 Government Organization A social welfare agency has a govem ment budget appropriation for 20X6 of 850,000. The agency's major mission is to help disabled persons who are unable to hold jobs. On the average, the agency supplements each person's income ...
The following monthly segmented income statement is for Condiment Company, which has three separate product lines (A, B, and C). A B C Total Sales revenue $37,500$50,000 $12,500$100,000 Variable costs $16,000$27,500 $5,000$48,500 Contribution margin \$21,...


text:
Study on Hardening Depth by Induction Hardening Analysis of Sprocket Using FEA and Experiment Results

Title & Authors
Study on Hardening Depth by Induction Hardening Analysis of Sprocket Using FEA and Experiment Results
Choi, Jin Kyu; Nam, Kwang Sik; Kim, Jae Ki; Choi, Ho Min; Yeum, Sang Hoon; Lee, Seok Soon;

Abstract
High frequency induction heating (HFIH) is used in many industries and has a number of advantages, including reliability and repeatability. It is a non-contact method of providing energy-efficient heat in the minimum amount of time without using a flame. Recently, HFIH has been actively studied using the finite element method (FEM), however, these studies only focused on the accuracy of the analysis. In this paper, we can measure joule heat distributions by the electromagnetic analysis for HFIH and the temperature distribution from the heat transfer analysis by applying joule heat for a sprocket. The sprocket is heated over $\small{850^{\circ}C}$ due to joule heat and then cooled to under $\small{200^{\circ}C}$ by using cooling $\small{20^{\circ}C}$ water. These processes were used to calculate the FEM and then compared to our experimental results. The calculated outcome may be used to predict hardening depth in HFIH.
Keywords
High frequency;Induction heating;Induction hardening;Sprocket;FEM;
Language
Korean
Cited by
References
1.
Telning, K. E., "Steel and Its Heat Treatment," Butterworths, pp. 554-564, 1984.

2.
Hong, S.-O., Kim, H.-B., and Cho, G.-J., "A Study on Improvement of Workpiece Deformation in High Frequency Heat Treatment," Journal of the Korean Society of Manufacturing Process Engineers, Vol. 2, No. 2, pp. 31-36, 2003.

3.
Hwang, J., Kwon, O., Yun, J., and Park, K., "Finite Element Analysis of Induction Heating Process for Development of Rapid Mold Heating System," Transactions of Materials Processing, Vol. 16, No. 2, pp. 113-119, 2007.

4.
Sohn, D.-H., Seo, Y.-S., and Park, K., "Three-Dimensional Finite Element Analysis of the Induction Heating Procedure of an Injection Mold," Transactions of Materials Processing, Vol. 19, No. 3, pp. 152-159, 2010.

5.
Abaqus Benchmarks Manual (6.12), "1.11.7 A Simple Steady-State Dynamic Acoustic Analysis," http://xn--90ajn.xn--p1ai/library/abaqus_doc/Documentation/docs/v6.12/books/bmk/default.htm?startat=ch01s11ach79.html (Accessed 21 April 2016)

6.
Wikipedia, "Electrical Resistivity and Conductivity," https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity (Accessed 12 April 2016)

7.
Wikipedia, "Permeability (Electromagnetism)," https://en.wikipedia.org/wiki/Permeability_(electromagnetism) (Accessed 12 April 2016)

8.
The Engineering ToolBox, "Air Properties," http://www.engineeringtoolbox.com/air-properties-d_156.html (Accessed 12 April 2016)

9.
The Engineering ToolBox, "Specific-Heats of Metals," http://www.engineeringtoolbox.com/specific-heat-metals-d_152.html (Accessed 12 April 2016)

10.
The Engineering ToolBox, "Thermal Conductivity of Metals," http://www.engineeringtoolbox.com/thermal-conductivity-metals-d_858.html (Accessed 12 April 2016)

11.
Kim, W. I. and Heo, S. J., "A Study on the Surface Roughness Influenced by SM45C Hardness in High Frequency Induction Hardening," Journal of the Korean Society of Manufacturing Process Engineers, Vol. 6, No. 1, pp. 1-8, 1993.

12.
Ryu, G.-H., Lee, D.-J., Kim, D.-J., Kim, B.-M., and Kim, G.-H., "Process Design of the Hot Pipe Bending Process Using High Frequency Induction Heating," J. Korean Soc. Precis. Eng., Vol. 18, No. 9, pp. 110-121, 2001.


text:
Feeds:
Posts

The vector (or cross) product

In this previous blog, I mentioned that there are two ways in which to multiply vectors, either the dot (scalar) product of the cross (vector) product. The dot product is pretty easy to do. If we have two vectors $\vec{a} \text{ and } \vec{b}$, the dot product is just given by

$\boxed{ \vec{a} \cdot \vec{b} = \lvert a \rvert \; \lvert b \rvert \; \cos(\theta) }$ where $\theta$ is the angle between them.

The vector (cross) product is a little more complicated.

Let us suppose our vectors are $\vec{a} \text{ and } \vec{b}$ and that $\vec{a}$ can bet written as $\vec{a} = a_{x} \hat{x} + a_{y} \hat{y} + a_{z} \hat{z}$ and $\vec{b} = b_{x} \hat{x} + b_{y} \hat{y} + b_{z} \hat{z}$, to find the vector product it is easiest to use matrices. This is the way I have always done it, and the way I teach it to my students, but if anyone reading this has a different method they wish to share that would be great.

So, we write $\vec{a}$ again as $\left( a_{x} \hat{x} + a_{y} \hat{y} + a_{z} \hat{z} \right)$ and $\vec{b}$ as $\left( b_{x} \hat{x} + b_{y} \hat{y} + b_{z} \hat{z} \right)$ where the brackets indicate that these are now matrices.

Using the determinant matrix to calculate the vector product

$\vec{c} = \vec{a} \times \vec{b} = \left| \begin{array}{ccc} \hat{x} & \hat{y} & \hat{z} \\ a_{x} & a_{y} & a_{z} \\ b_{x} & b_{y} & b_{z} \\ \end{array} \right|$ where the expression on the right is the determinant matrix.

To calculate each component we work out the determinant of three separate $2 \times 2$ matrices, as shown below. For the $\hat{x}$ component, we cross out the top line and first column of the $3 \times 3$ matrix, and compute the determinant of the remaining $2 \times 2$ matrix.

To calculate the $\hat{x}$ component we work out the determinant of the $2 \times 2$ matrix as shown.

For our example, this will be $(a_{y}b_{z} - a_{z}b_{y}))\hat{x}$. Similarly, for the $\hat{y}$ component

To calculate the $\hat{y}$ component we work out the determinant of the $2 \times 2$ matrix as shown.

which will be $(a_{x}b_{z} - a_{z}b_{x})\hat{y}$, but not that we take the negative of this. Finally for the $\hat{z}$ component we have

To calculate the $\hat{z}$ component we work out the determinant of the $2 \times 2$ matrix as shown.

which will be $(a_{x}b_{y} - a{y}b_{x})\hat{z}$.

Summarising, we can write $\boxed{ \vec{c} = \vec{a} \times \vec{b} = (a_{y}b_{z} - a_{z}b_{y})\hat{x} - (a_{x}b_{z} - a_{z}b_{x})\hat{y} + (a_{x}b_{y} - a_{y}b_{x}) \hat{z} }$. This is the vector product of the two vectors.

In the simple case where $\vec{a} = a_{x}\hat{x}$ and $\vec{b} = b_{y}\hat{y}$ then $\vec{c} = \vec{a} \times \vec{b}$ will simply be

$\vec{c} = \vec{a} \times \vec{b} = \left| \begin{array}{ccc} \hat{x} & \hat{y} & \hat{z} \\ a_{x} & 0 & 0 \\ 0 & b_{y} & 0 \\ \end{array} \right|$

which comes to be $(0)\hat{x} - (0)\hat{y} + (a_{x}b_{y} - 0)\hat{z} = (a_{x}b_{y})\hat{z}$.

If we want $\vec{b} \times \vec{a}$ then we must write

$\vec{d} = \vec{b} \times \vec{a} = \left| \begin{array}{ccc} \hat{x} & \hat{y} & \hat{z} \\ 0 & b_{y} & 0 \\ a_{x} & 0 & 0 \\ \end{array} \right|$

which comes to be $\vec{d} = (0)\hat{x} - (0)\hat{y} + (0 - a_{x}b_{y})\hat{z} = -(a_{x}b_{y})\hat{z} = -\vec{c}$. This is shown in the figure below.

The cross (vector) product is not commutative, so $\vec{a} \times \vec{b} = \vec{c}$ and $\vec{b} \times \vec{a} = -\vec{c}$.

One Response

1. […] Writing this in terms of vectors, and remembering that division of vectors is not defined, we instead write that where is the vector product (or cross-product), as I discussed in this blog here. […]


text:
# Why build a TRNG?

## Your privacy and free speech

We all cherish the ability to talk to one another in private. It’s a major component of civilised democracy. Many people have dedicated themselves to ensuring that we can say what we want, to whom ever we want, without somebody listening in and monitoring us. Some may be exchanging trivia, but others might be whistle-blowing or performing serious journalism in oppressive societies. We do this via cryptography, which consumes random numbers at a great rate. And the quality (randomness) of those numbers is paramount in guaranteeing the robustness of the cryptographic scheme we use. Whether it’s an AES cipher or the humble one time pad (OTP), random numbers of the highest quality are necessary to generate secret key /nonce material. Otherwise the encryption might be broken. The trouble is that it’s well neigh impossible for a deterministic device like a computer to create true randomness. And encryption schemes built upon one time pads can eat through thousands of bytes of entropy.

Of course most of us have access to pseudo random numbers from our computers. Most computers have either a /dev/urandom stream or use of the CryptGenRandom /BcryptGenRandom APIs. But those are not truly random. They come from algorithms, and no matter their complexity or ingenuity, the output of an algorithm will always be deterministic and therefore ultimately predicable. This may be suitable for some people, some of the time. Maximum security, randomness aficionados and tin foil hat wearing types require truly random numbers. And if your interests or needs revolve around one time pads, by definition there is no alternative but a true random number generator (TRNG). It’s like the difference between a blend and malt whiskey, only more so. So a solution is to buy a commercial device, of which there are many. They range from entry level USB flash drive packaged ones, all the way to top of the range TRNGs built around lasers. There are even laboratory TRNGs that extract entropy from quantum vacuum or photon interference at rates of 300Gbits/s.

Finally, only by everyone(!) building personal TRNGs with their own interpretation of how it should be done, can we avoid ennui and cryptographic mono culturism. Look to the 1840’s Irish or 1930’s Dust Bowl farmers why mono culture is a terrible idea.

The whole issue is complicated by the fact that it is almost impossible to prove a sequence of numbers you’re given is truly random. It may be uniformly distributed and pass all appropriate randomness tests like Dieharder, yet still be entirely predictable. The decimal expansions of the irrationals $\pi$ , $\sqrt{2}$ and $e$ are widely regarded as being entirely random, but are calculable and therefore predicable. Yet these constants pass all randomness tests, and indeed are used as test data sets to verify some of the tests themselves (like NIST SP 800-22). They are not truly random though. The entirety of $\pi$ can be expressed with a Kolmogorov complexity of just the following few mathematical symbols:-

$$\pi = \sum_{n=0}^{\infty} \left( \frac{4}{8n+1} - \frac{2}{8n+4} - \frac{1}{8n+5} - \frac{1}{8n+6} \right) \left( \frac{1}{16} \right)^n$$

And similarly 1GB of perfectly random looking data can actually consist of only three lines of Java as:-

SecureRandom random = SecureRandom();
byte numbers[] = new byte[1_000_000_000];
random.nextBytes(numbers);

Even if you believe that /dev/random is truly so, it blocks and is terribly slow. Certainly insufficient for much one time pad material, so if that is your need you’ll have to go to the market. There are many ready built commercial devices that might be considered for your TRNG, but be warned. How do you know (verifiably) that the number sequence being produced is not predictable by any state actor or otherwise? Can they be audited and proven secure cryptographically? Just what exactly is inside those packages of black epoxy and ceramic? Consider the three following examples of typical commercial TRNGs:-

We have a printed circuit board with a shielded enclosure and closed source FPGA, a sealed USB device and a preeety complex microprocessor. All purport to produce true random numbers of the highest quality, and at (perhaps unbelievably) high rates. We therefore issue the following challenge:-

Prove that the output from any black box TRNG is not just a version of:-

$$AES_{(K \; \oplus \; cpuid)} (CTR)$$

where $K$ = secret agency’s key, $cpuid$ = the id of the microprocessor and $CTR$ is some counter and/or timer.

Tamper resistance which is vigorously marketed as a positive feature of these devices, becomes counter productive in terms of verifiability and independent audit. We are left with no option but to trust the manufacturer’s brand and integrity. What can a user do otherwise? Forcing open a hardware device risks damaging it, and anyway all of the important operations are soft ones in code embedded within very highly integrated chips. The Core i* processors are a case in point. Even if the die was exposed, a contemporary microprocessor is a multilayered silicon fabrication. It is technically impossible to identify the parts of the architecture responsible for implementing RDRAND instructions, never mind reverse engineering it for operational confirmation. Unfortunately for transparency, such a need for trust then collides with realpolitik.

Similarly the main cryptographic primitives and by extension pseudo random number generators (PRNGs), can be verified by comparing their outputs against standard test vectors. No such standard output is possible for a TRNG. The only tests possible are stochastic, and the user is back to the $\pi$ and $e$ situation.

## Threats to randomness

For the avoidance of doubt, we are not concerned (at least for this discussion) with global thermonuclear war, electromagnetic pulse weapons or a 007 type agent hiding in your wardrobe. Those are not the cryptographic threats we will be dwelling upon. We are however concerned with soft threats that have surfaced since America’s 911 attacks, the subsequent war on terror and recent revelations as to the involvement of the security services with many aspects of cryptography and information security.

Glenn Greenwald’s No Place to Hide recently serialised in Britain’s Guardian newspaper, alleges that both Chinese and American security services routinely intercept and tamper with computer communications equipment bound for overseas customers. He cites an example of the National Security Agency’s Tailored Access Operations unit implanting “call home beacons” in routers. SSH or VPN keys or CSPRNG seeds could also be sent. Re-interpreting the general media’s poor grasp of technology, it’s probably the firmware that is re-flashed and then the routers continue on their way.

The cryptography commentator Bruce Schneier iseems to believe that the NSA can break most encryption used routinely on the Internet. With recent announcements that the NSA is moving away from (Suite B) elliptic curve cryptography, there are those in the security community that believe the agency has made progress with the discrete logarithm problem. Similar advances have been made previously by the NSA and kept secret, such as differential cryptanalysis. Or the agency is nudging users towards standardisation of post quantum cryptography with which they might have some advantage in cryptographic analysis. Presumably standardisation of the form they previously tried with the Dual EC-DRBG debacle. The openly secret NOBUS (No Body But Us) policy dictates that it’s okay for everyone to use weakened encryption as long as the US in the only actor able to exploit it. An example of Pax Americana? And the NSA’s Bullrun decryption programme is entirely focused on decryption of on line communications, as is GCHQ’s Edgehill, Bullrun’s little brother. We can only wonder whether it is pure coincidence or a cruel taunt that the NSA mass decryption programme and Intel’s on-chip TRNG share the same name. Has it been the victim of a tactical signals intelligence operation? Or is Intel a recipient of a National Security Letter mandating certain adjustments to the quality of their entropy generator? What about the Broadcom TRNG within the Raspberry Pi single board computer? The underlying hardware implementations for it and Intel’s RDRAND are poorly documented in the literature, bordering on a degree of ambiguity that might be called obfuscation. And as shown, entirely unverifiable by end users. Perhaps some sort of Uber ring oscillators running at GSamples /second? Gigabit TRNGs only appeared recently in academic research labs and they all use optical methods. Use them at your own risk.

And somewhat speculatively the DUHK vulnerability within the US certified ANSI X9.31 based PRNG may have initially begun as a NOBUS vulnerability. The construction is over 30 years old, and it is entirely feasible (with no particular evidence other than cynicism and psychosis) that the fixed key issue was known or suspected a long time ago. We could go on.

But there are other threats too, coming out of our legislatures. The UK’s Home Secretary, Amber Rudd has publicly called for outlawing end to end encryption be it technically possible or not. Those who follow politics will realise that (impossible) technical issues are no bar to proposed legislation. Similarly, Senator Dianne Feinstein is currently trying to relaunch her decrypt-it-on-demand bill. Both seem to champion Joseph Goebbels’ “You have nothing to fear, if you have nothing to hide” argument. The problem is with attitudes and over-reaching legislation exemplified by Cardinal Richelieus who said “If you give me six lines written by the hand of the most honest of men, I will find something in them which will hang him.” WhatsApp, Allo and the Signal protocol should be concerned. If companies do get banned from distributing strong encryption products, the people will be left to their own devices. Perhaps quite literally in the case of scratch built TRNGs.

We could be accused of having a warped perception of reality. Of being too absorbed with conspiracies and the faked moon landings. Perhaps, but Freedom House recently found:-

“Seventy-one countries suffered net declines in political rights and civil liberties, with only 35 registering gains. This marked the 12th consecutive year of decline in global freedom. China and Russia expand their antidemocratic influence. A confident Chinese president Xi Jinping recently proclaimed that China is “blazing a new trail” for developing countries to follow. It is a path that includes politicized courts, intolerance for dissent, and predetermined elections. The past year brought further, faster erosion of America’s own democratic standards than at any other time in memory, damaging its international credibility as a champion of good governance and human rights.”

And there’s that mischievous Snowden chap with his surprising revelations. Perhaps it’s not just us then. Quoting a recent manufacturer of quantum TRNGs, “Random numbers are too important to be left to chance.”

## The solution – DIY TRNGs

If you can’t verify the randomness of a commercial TRNG, the amateur cryptographer is left with little choice but to acquire something that can be exhaustively tested beyond all reasonable doubt. That means building a TRNG yourself.

The psychiatrist Fritz Perls said that the only way to truly believe something is to find it out for oneself. If you’ve built a TRNG from simple, discrete off the shelf parts, you’ll have full transparency. And the confidence that it cannot have been sabotaged by outside actors. It’s unfeasible to believe that voltage regulators, resistors and diodes might have been intercepted in mid shipment and ‘enhanced’ for nefarious purposes. And most importantly, your TRNG can be easily tested with some basic electronics knowledge and tools. With regard to tools and equipment, it is possible to build and test your TRNG with nothing other than the microcontroller being used for the entropy capture. Test equipment in the form of a multimeter or oscilloscope is only required for debugging the circuitry if there are problems. Or for further experimentation which we strongly encourage. After all, diversity is the anthesis of mono culture.

There is also a downstream concept of the OTP, beyond mere circuitry but crucially important. The lure of a OTP’s perfect secrecy is complemented by it being one of the few cryptographically secure ciphers than can be easily verified by hand. AES GCM may be efficient if you’re made of silicon and sprockets, but it’s hard to verify your human implementation. The SIGNAL protocol even more so. 3rd party cryptanalysis and code review helps, but it’s impossible to eliminate all zero day exploits by their very nature. And you might just write bad code. Hence one of the main requirements for lots of truly random numbers is pad generation.

Self built TRNGs are the only sane choice for all of the above reasons.


text:
# Secrets, surveys and statistics

Paula Rowińska uses mathematics to answer some awkward questions

Image: Flickr user Wessex Archaeology, CC BY-NC-SA 2.0

Have you ever shoplifted?

Have you ever cheated on your partner?

Have you driven a car under the influence of alcohol or drugs?

If you ask such sensitive questions in a survey, don’t expect honest answers. Participants might worry that you wouldn’t be able to provide full anonymity and their embarrassing responses might end up in the wrong hands. They may skip more sensitive questions or, even worse, just blatantly lie, which would make your survey utterly useless. Luckily, there is a way to design fully anonymous surveys. All you need is money. No, I’m not asking you to bribe your respondents. A simple fair coin you keep in your pocket serves not only as the means to pay for services, but also as an excellent generator of events with some known probability (in this case with probability $1/2$). In fact, a die or coloured balls in an urn would do, they’d just generate different probabilities.

#### Binary choices

Let’s say that a question in your survey is a sensitive yes/no question, where ticking ‘yes’ would mean admitting to some embarrassing or even criminal activity. To minimise the incentive to lie, you might want to include the following extra instructions in the survey. Ask the participants to flip a coin before answering the question. If they get tails, they should respond truthfully. However, if they get heads, ask them to toss the coin again and record the results: ‘yes’ for heads and ‘no’ for tails. Since you won’t be able to distinguish between responses to the question and those who simply recorded the result of the coin flip, survey-takers can rest assured that they won’t be identified. Hopefully this will encourage honesty and give you some data to work with. But… how do you get any meaningful information from this coin-tossing exercise?

I prefer $\tau$ charts.

Scientific studies usually require large samples, so let’s assume that you have managed to recruit a sufficiently large total number of subjects, which we will call $T$. By the end of the study, you will have collected $T$ (total) answers, one from each participant: $Y$ ‘yes’ responses and $N=T-Y$ ‘no’ responses. On average, $T/2$ of these will be truthful answers (since $T/2$ people will get heads in the first coin flip), and $T/2$ will be meaningless results of second coin tosses. This means that out of $T/2$ people answering the actual question, $Y-T/4$ confirmed and $N = 3T/4-Y$ denied the controversial statement. Now you know that on average $(Y-T/4)/(T/2)$ of the whole population (assuming that the sample was representative) have engaged in the embarrassing activity in question.

Of course, if instead of a fair coin you decide to generate events with probabilities different to $1/2$ using, for example, a biased coin or a die, you must adjust the numbers accordingly. Since the concept remains more or less the same, I’ll leave this as an exercise for the reader (just because I’ve always wanted to use this most-hated phrase of any PhD student).

#### A range of values

Nice, but what if you want to know the number of times the respondent committed the crime as well as whether they had or not? Or in other words, what if the answer to your question is not just ‘yes’ or ‘no’ but a range of values? Don’t worry, maths will save your survey.

Imagine you want to identify some quantity $X$, which the respondents aren’t too happy to share. If they’re able to generate random numbers with known and positive mean $m$ and variance $v$, you’re safe. You can ask them to generate one such number $Z$ and, without disclosing it, answer the question with $Y=XZ$. Again, you have no way of learning the value they’re so afraid of sharing. However, $X$ and $Z$ are independent variables: the value of $X$ doesn’t influence the generated random number $Z$, and vice versa. Then the average of $Y$ is just the product of averages of $X$ and $Z$, where the latter is equal to $m$. Therefore, you can estimate the average value of $X$ as the average of responses $Y$ divided by $m$. You can even quantify the error of your estimation, but I’ll spare you the details. (If you’re interested, you can find them in the paper Scrambled randomized response methods for obtaining sensitive quantitative data by Eichhorn and Hayre.)

So, please flip a coin. If you get heads, toss it again and give me ‘yes’ for heads and ‘no’ for tails. Otherwise, let me know: have you ever attempted to drink and derive?

As a PhD student at Imperial College, London, Paula uses maths and stats to study the impact of wind energy on electricity prices. The title of her TEDx talk `Let’s have a maths party!’ seems to summarise her two favourite activities.
@PaulaRowinska    paularowinska.wordpress.com/    + More articles by Paula

• ### Can computers prove theorems?

And will we soon all be out of a job? Kevin Buzzard worries us all.
• ### In conversation with Clifford Cocks

We chat to the crypto chief about inventing RSA... but not being able to tell anyone
• ### On √2

Yiannis Petridis connects square roots and continued fractions
• ### Spotlight on: Pamela Harris

Pamela E Harris's story, as told by Talithia Williams
• ### Artificial music

Carmen Cabrera Arnau explores the use of AI in composition
• ### They might not be giants

Angela Brett might not be standing on their shoulders


text:
Overarch 2

Bricks are 20cm long and 10cm high. How high could an arch be built without mortar on a flat horizontal surface, to overhang by 1 metre? How big an overhang is it possible to make like this?

Stonehenge

Explain why, when moving heavy objects on rollers, the object moves twice as fast as the rollers. Try a similar experiment yourself.

Maximum Flow

Given the graph of a supply network and the maximum capacity for flow in each section find the maximum flow across the network.

Turbo Turbines

Stage: 5 Challenge Level:

$M_{total} = 3 \int^L_0{k V \left( \frac{3}{4} + \frac{x^2}{4L^2}\right) } dx$

$= 3 k V \left[\frac{3 x}{4} + \frac{x^3}{12 L^2} \right]^L_0$

$= 3 k V \left[\frac{3}{4} L + \frac{1}{12} L \right] = \frac{5}{2} k V L$

Equating this to the resistive torque, $\frac{5}{2} k V L = 5T$

$\therefore V_{crit} = 2T/(kL)$.

Since the torque is fixed, you might decrease the minimum wind speed by improving the geometry of the blade and thus increasing $k$, or by increasing the blade length. Increasing the number of blades on the turbine would also decrease $V_{crit}$.

The rotational analogy is

Power = Torque $\times$ Angular Velocity

The power produced by the generator is thus $A \omega_g^2$. The 1:50 ratio of the gearbox tells us that $\omega_g$ can be approximated by $50 B k V$, when $V > V_{crit}$.


text:
# How to snip same part of screen as last time?

In windows 10, I can use the Snipping Tool or Snip & Sketch to snip a part my screen (basically a screenshot + crop to selection). I would like to snip the same part of the screen after I perform some other operation in another application that changes what's shown in that part of the screen. I have to manually perform this operation for example by pressing some button in another application.

An example use case would be:

1. I run my code to draw something to a canvas in my browser
2. I snip that part of the screen
3. I change the code to modify what's drawn to that part of the screen
4. I'd like to capture the same rectangle from the first snip.

Is there an easy way to do this in Windows 10?

One way I can think of doing this is to screen capture that region (for example using LICEcap) then dig in to find the desired frames. This is non-ideal because my intermediate operation could take a long time, there might be quality issues with the extracted frames, and it's a lot of work to use some tool to extract frames.

## Solution Summary

Multiple solutions worked; here are brief differences (see review sites for more detailed comparisons)

ShareX and Greenshot are the best

• ShareX has more features
• doesn't sacrifice too much convenience
• probably has higher proficiency ceiling so it's preferred if you need to snip on a regular basis
• Greenshot is simpler to use out of the box

Snagit probably also fulfills my needs but I didn't try it because it costs \$50 (didn't bother with the 15 day free trial).

Other methods either didn't work or would not be convenient enough.

• I edited the title and added a line to hopefully clarify the question. I want to snip the same rectangular part of my screen (e.g. 10px from top, 25px from left, 100px height, 200px width - a fully specified rectangular part of my screen) after performing operations in another application (e.g. run my code that draws to canvas). Something equivalent would be to screen capture a video of that part of the screen then find all the relevant frames, but that's non-ideal. – LemonPi Oct 8 at 2:53
• in macOS it's built-in with cmd-shift-5 – theonlygusti Oct 9 at 14:14
• this probably should be on Software Recommendations – phuclv Oct 10 at 13:48

Greenshot has an option to Capture last region. Highly recommended.

Also very easy to do quick edits such as highlighting and obfuscation:

• Did you just use Greenshot to take a screenshot of Greenshot? – Thomas Ayoub Oct 8 at 13:25
• Greenshot-seption. It is actually pretty good. Whatever your mouse was on, it will stay there. Also, it helps a lot to take screenshots of windows and such. – Ismael Miguel Oct 8 at 14:23
• Nice, tried out Greenshot and it's also working great with the exact feature I wanted! Compared to ShareX it seems to be more feature light (not that I mind), and supports macOS. – LemonPi Oct 9 at 1:10
• @ThomasAyoub of course! :) – Glenn Oct 9 at 16:20
• Then have my upvote! – Thomas Ayoub Oct 10 at 7:26

As far as I know there is no way to "re-snip the previously snipped area" using the snipping tool.

The best way to achieve a similar functionality with the snipping tool is to the Window Snip or Full-Screen Snip available in the Mode Menu. Clicking the same window showing a different section of code etc. and trimming it down to the section you want.

Alternatively the open source tool ShareX looks to have a similar functionality as you describe. The menu options for that are further described here in a GitHub feature request for said functionality.

ProTip 1: The keys Shift + Win + S launches the new/alternative (?) snipping tool in Windows 10 quicker.
ProTip 2: Windows 10 in 1903 now has a multi-clipboard build in, turn it on in the settings, and you can use Win + V to paste any of the last 10 (?) copied items.

• I tried out ShareX and it's working great with the exact feature I wanted (Capture > Last region) – LemonPi Oct 8 at 3:56

One fairly straightforward way to do this is to separate the capture operation from the crop operation. Capture either the entire screen with Ctrl-PrnScr or a window with Alt-PrnScr; paste into an image editor which supports layers1; repeat until you have all of the captures as layers of a single image; then crop the image and save the layers out one by one.

1 I use the GIMP, but I'm sure there are plenty of other options.

Is there an easy way to do this in Windows 10?

Unfortunately this isn't possible using any of Windows 10's own screenshot tools.

I am open to using 3rd party tools.

TechSmith Snagit is probably the best tool for the job for this.

I want to snip the same rectangular part of my screen (e.g. 10px from top, 25px from left, 100px height, 200px width - a fully specified rectangular part of my screen)

The following settings would accomplish exactly that:

Using the above configuration, every time you press Print Screen, the same region of the screen would be captured and saved as an image file in your chosen target folder.

• Any reason you didn't say anything about "Greenshot also has an option to Capture last region. Highly recommended." in another answer with a clear software recommendation? Is it because it's freeware or did you just not notice it? – Mr Ethernet Oct 8 at 12:06
• So in other words it was completely arbitrary. No doubt you didn't downvote that answer either. In future, please hold everyone to the same standards. – Mr Ethernet Oct 8 at 13:52
• @Moab did you actually read the page you linked to above? It's the page for "Asking" not "Answering". I didn't post a question, I posted an answer, and nowhere does it say on the answers page not to provide product recommendations. Please re-acquaint yourself with the rules that you like to remind others of: superuser.com/help/answering – Mr Ethernet Oct 8 at 14:10
• What I said is correct though. I've flagged you for your unpleasant behaviour. You have deleted your comment but the mods will still be able to read it. – Mr Ethernet Oct 8 at 14:15

Similar to the Print Screen methods also posted, you could use the Window snip (from Snipping tool). Then as long as the window stays the same size you'll always keep the same section of the screen selected. Alternatively, if window changes size, you can put a larger application in the background and select that with the 'Window Snip', which will capture the screen and all windows in-front of it.

Here's an example of selecting a larger window behind the one of focus:

• In this case the area I want to capture is part of a large window, and I think this method works only if the snipping region is larger than the relevant window. However if that were the case I would just snip the relevant window directly rather than a larger window behind it. So I can only imagine this would be useful if what I wanted to snip spanned more than 1 window (or if I could get an entirely transparent window on top of the snipping region). – LemonPi Oct 9 at 1:17
• Alt+PrintScreen captures the current window. No need to use the snipping tool – phuclv Oct 10 at 13:48

If you size your web browser to the rough snip size and scroll to your desired capture area then you can:

1. Alt+Print Screen
2. Save to file or whatever
3. Make your coding changes
4. Press F5 in the web browser and it should remember how far you scrolled.
5. Go back to Step #1
• Unfortunately areas of the browser that I don't want to snip has the GUI controls for modifying what's displayed. This would work if my desired snip area was a corner that I could scroll to the end to (but it's somewhere in the middle...) – LemonPi Oct 8 at 21:03


text:
# Difference between revisions of "2018 AMC 10B Problems/Problem 23"

23. How many ordered pairs $(a, b)$ of positive integers satisfy the equation $$a\cdot b + 63 = 20\cdot \text{lcm}(a, b) + 12\cdot\text{gcd}(a,b),$$ where $\text{gcd}(a,b)$ denotes the greatest common divisor of $a$ and $b$, and $\text{lcm}(a,b)$ denotes their least common multiple?

$\textbf{(A)} \text{ 0} \qquad \textbf{(B)} \text{ 2} \qquad \textbf{(C)} \text{ 4} \qquad \textbf{(D)} \text{ 6} \qquad \textbf{(E)} \text{ 8}$

Let $x = lcm(a, b)$, and $y = gcd(a, b)$. Therefore, $a\cdot b = lcm(a, b)\cdot gcd(a, b) = x\cdot y$. Thus, the equation becomes

$$x\cdot y + 63 = 20x + 12y$$, $$x\cdot y - 20x - 12y + 63 = 0$$.

Using Simon's Favorite Factoring Trick, we rewrite this equation as

$$(x - 12)(y - 20) - 240 + 63 = 0$$ $$(x - 12)(y - 20) = 177$$. (awesomeag)


text:
# How can I size the components of a square wave generator in order to obtain a 7kHz frequency?

I used this circuit to generate a triangle wave that comes from the - input of the square wave generator. This is part of a circuit that generates a PWM signal. I need to have a frequency of 7kHz and to size the resistors and capacitors in order to get that. Can anyone help we with a formula for the frequency for this circuit?

• Have you come across the subject of RC time-constant in your studies yet? Can you identify which components would determine the frequency of your circuit? – Transistor May 11 at 21:43
• I don't know exactly,I think R4 and C1,am I right? I tried to use the formula T=2R4C1ln(1+a/1-a) where a is R2/R2+R3 but it doesn't quite work – Teodora Bianca May 11 at 21:47
• Start with $\tau = RC$ and see how you get on. Please edit your question to show your calculated values and your measured values. – Transistor May 11 at 21:51
• Well,I chose the values for R2=R3=10k and C1=1uF and then I applied the formula from above to calculate R4 for T=1/f ,but when I run the simulation,it was not correct,so I think that the formula is not correct – Teodora Bianca May 11 at 21:56
• I obtained the value for R4=65 ohms,but my frequency is not 7kHz how I need – Teodora Bianca May 11 at 21:57

What you're making here is called a relaxation oscillator.

Here's a reference for that: http://www.analogzoo.com/2015/01/relaxation-oscillator-design/

The summary for a basic calculation:

• Charge / discharge time is the time constant which is 1.1*RC.
• Period is twice that, or 2.2*RC.
• For frequency we get 1/(2.2*RC)

Some items to check and/or fix in your design:

• 1uf and 68 ohm is kind of a low impedance for an op-amp to drive at that frequency. Scale these to less-demanding, smaller-current values (more below.)
• R1 and V1 are not needed if your intention is a square wave that swings from +VPS to -VPS. You need to refer the Schmitt feedback only to 0V.
• If you want to affect duty cycle, refer R2 to a voltage instead of GND. Note however this will also affect frequency.
• The LM358 is kind of slow, which will affect the charge/discharge time (it will be longer.) A faster op-amp will give closer to predicted results.
• You can compensate for the slower op-amp by reducing the value of R4.

With this in mind, we can select 0.01uF and about 6.5K to get 7Khz with an 'ideal' op-amp. Try it here.

• Thank you very much,now I try to simulate the circuit with this values and see what I get,should I change the LM358 opamp with another type of opamp? – Teodora Bianca May 12 at 11:14
• I simulated with this values and I measured the period and it is more than it should like 233u and I need it to be 142,8u,do you know why is that? – Teodora Bianca May 12 at 11:54
• It’s because of the op-amp. I tried it with the 741 (similar to 358) and got about 4Khz. The slew rate of these devices is slow and so affects the charge / discharge time. Even with a faster op-amp it will be a little off, you will still need to adjust R4 to compensate. – hacktastical May 12 at 16:29
• I changed the op amo with a TL084 and now it works just fine.Thank you so much everybody for your help! I really appreciate it – Teodora Bianca May 12 at 17:55

Here is a simulation that shows how ill-suited the LM358 is for this application. I've used +/-15V supplies which makes the slow slew rate even more of an issue. Note also the asymmetry in the output swing from +13.5 to -15V, a consequence of the output stage of the LM358.

The slow slew rate means that the output frequency is heavily dependent on the power supply voltage as well as the slew rate (which is poorly specified and probably fairly temperature-dependent).

To compare, with an ideal op-amp or comparator the timing is independent of the supply voltage, provided it's relatively stable over the period of a cycle.

• Thank you for your help,so what should I do?Should I change the opamp? – Teodora Bianca May 12 at 11:15

first you need to size/compute the hysteresis input band.

If the band is exactly 1 tau, that may simplify your computation. Note the output drive strength of an opamp will vary with the load current, and both resistors to Vout count as loads.

Then you can think about how to size the R+C tau on the -Vin.

• I don't really know how to compute the hysteresis input band,what exactly should I do? – Teodora Bianca May 11 at 22:26


text:
# Math Help - Logarithmical mess :(

1. ## Logarithmical mess :(

So i need some help with two problems this time and the first one is:

ln910+2ln59ln9

I have already tried to simplify it according to the logarithmical laws but i just can't get it right, maybe i find this so difficult because it's natural logarithms which i am not used to dealing with.

The second one is:
lne3+ln(ee3)+ln1e32

I keep getting the answer 3 but that is apperantly not correct and i honestly can't see why. I figured that since e=e^1/2I would after simplifiyng ee3 get 3/2. I also figured that ln1e32
would equal -3/2. That would mean that the whole thing equals 3...but it's not lol. I could really use some help.

2. ## Re: Logarithmical mess :(

Let me correct the numbers, they jumped all over the place

Number one is

ln(10/9)+2ln(9/5)-ln9

Number two:

ln(e^3)+ln(sqrt e * e^3)+ln (1/ (e^3/2) )

3. ## Re: Logarithmical mess :(

What do you mean you are getting a mess? Write out your steps.

4. ## Re: Logarithmical mess :(

Originally Posted by SlipEternal
What do you mean you are getting a mess? Write out your steps.
On the first one i did this:

ln(10/9)+2ln(9/5)-ln9

ln(10/ (3^2)+ln(9/5)^2-ln(3^2)

After this step im blocked.

Number two i did this:

ln(e^3)+ln(sqrt e * e^3)+ln (1/ (e^3/2) )

3+ ln(e^(1/2) * e^3)+3/2

3+ (3/2) +(3/2) = 3+3=6 (it became 6 this time)

5. ## Re: Logarithmical mess :(

Originally Posted by Foxtrot
ln(10/ (3^2)+ln(9/5)^2-ln(3^2)

After this step im blocked.
Remember that lnA + lnB = ln (AxB), and lnA - lnB = ln(A/B). So your problem becomes

ln((10/9 x (9/5)^2)/9) = ln(10/(5^2)) = ln(10/25) = ln(2/5).

Originally Posted by Foxtrot
Number two i did this:

ln(e^3)+ln(sqrt e * e^3)+ln (1/ (e^3/2) )

3+ ln(e^(1/2) * e^3)+3/2
That should be 3+ ln(e^(1/2) * e^3)- 3/2. Note the minus sign!

Originally Posted by Foxtrot
3+ (3/2) +(3/2) = 3+3=6 (it became 6 this time)
Should be 3 + 1/2 + 3 - 3/2 = 5.

6. ## Re: Logarithmical mess :(

Hello, Foxtrot!

$\ln\left(\tfrac{10}{9}\right)+2\ln\left(\tfrac{9}{ 5}\right)- \ln(9)$

We have: . $\ln\left(\tfrac{10}{9}\right) + \ln\left(\tfrac{9}{5}\right)^2 - \ln(9)$

. . . . . . $=\;\ln\left(\tfrac{10}{9}\right) + \ln\left(\tfrac{81}{25}\right) - \ln(9)$

. . . . . . $=\;\ln\left(\frac{\frac{10}{9}\cdot\frac{81}{25}}{ 9}\right) \;=\;\ln\left(\tfrac{2}{5}\right)$

$\ln\left(e^3\right) + \ln\left(\sqrt{e}\cdot e^3\right)+ \ln \left(\frac{1}{e^{\frac{3}{2}}}\right)$

We have: . $\ln(e^3) + \ln\left(e^{\frac{1}{2}}\cdot e^3\right) + \ln\left(\frac{1}{e^{\frac{3}{2}}}\right)$

. . . . . . $=\;\ln(e^3) + \ln\left(e^{\frac{7}{2}}\right) + \ln\left(\frac{1}{e^{\frac{3}{2}}}\right)$

. . . . . . $=\;\ln\left(e^3\cdot e^{\frac{7}{2}}\cdot\frac{1}{e^{\frac{3}{2}}} \right)$

. . . . . . $=\;\ln(e^5) \;=\;5$


text:
# Calculate min. win ratio needed for a bet to be profitable [closed]

If a bet 12000 to win 4000 my risk/reward ratio is .33 . How often must I win the bet to be profitable? I know it's 75% but have not found the formula yet.

## closed as off-topic by phdstudent, Alex C, LocalVolatility, Bob Jansen♦Apr 11 '18 at 7:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Basic financial questions are off-topic as they are assumed to be common knowledge for those studying or working in the field of quantitative finance." – phdstudent, Alex C, LocalVolatility, Bob Jansen
If this question can be reworded to fit the rules in the help center, please edit the question.

• great thanks. That is what I was looking for. – dared Apr 10 '18 at 12:26

With probablility $p$ you win 4000, with probability $(1-p)$ you lose 12000 (or in other words you "win" -12000)
Write the expectation: $E=4000 p + (-12000)(1-p)$
Find the breakeven $p$ as the $p$ that sets the expectation to zero and solve for $p$:
$4000 p + (-12000)(1-p) = 0 \implies p=\frac{16000}{12000}=0.75$