text:
### Archive

Archive for November, 2012

## Trick with 27

I finished watching another fantastic video from Numberphile.  The title is perfect “Beautiful Card Trick”.  After you watch it I think you will agree.

The video has some wonderful math and I cannot wait to try out different versions of the trick.  Here are some examples that come to my mind.

1. If you have a class of 27 students or more, then you could have each student put their name on a card, making a deck of 27 names.  I think this could be a good first day activity.
2. Do one of those activities where you use four fours to make the numbers 1-27.  Put each one a card, making a deck of 27.  Then do the trick.
3. Have students type in “random city” into WolframAlpha.  A lot of math could be done with each city.  Then collect 27 cities and do the trick.
4. This would be a great introduction into bases. The trick could then be followed with base four and other bases.
5. Have students create a function and list out 27 inputs-outputs in coordinate form.  Do the trick with those 27 coordinate points.

Overall, there are this card trick is simple and it can easily be modified, probably into at least 27 different ways.  Hopefully, you find at least one way to share the trick.

Bonus video! This video goes beyond only 27 cards. You will see that (the number of cards) = (number of piles) ^ (number of times shuffled).

Categories: blah-blah Tags: , ,

## What is tangent?

Trig functions have a lot of acronyms. Is this good or bad, well I don’t know. What I do know is this: tangent is much more than just sine over cosine or opposite over adjacent. However, the text books I teach from usually focus on that. So, I thought I would make an investigation that allows students to see that tangent can also be seen as length of the tangent line to the unit circle at $(0,1)$ Wikipedia gives some good pictures. Click here to see the article.

Note the location of tangent and secant

I also like in the article when it writes about “Slope Definitions”.

“Tangent combines the rise and run” meaning that Tangent takes the angle of the line segment and tells its slope; or alternatively, tells the vertical rise when the line segment’s horizontal run is 1.

So, next time you talk about the trig functions be sure to expand on the idea of tangent. Here is a Desmos graph I made that you can use. Click on the image to see the graph.

Categories: desmos Tags: , ,

## Angle Side Side

Recently, I was at the 2012 AMATYC conference and heard many great ideas for my classroom.  One idea was this,

Don’t use Law of Sines for Angle Side Side, just use Law of Cosines and then apply the quadratic formula.

What a revelation that was!  My students never seem to get the ambiguous case.  Maybe it is the way I try to explain it. Overall, it seems like a bunch of hoops to them.  But by using the quadratic formula students refresh their memory of the quadratic formula and also apply some basic trig.  So, let’s look at an example.

Let the angle be $20.5^{\circ}$ the adjacent side be 31 and the opposite side be 12. Going straight to the Law of Cosines we get the following:

$12^2 = b^2+31^2-2*12\cos(20.5^{\circ})b$ now set the equation equal to zero and we get
$0=b^2-2*12\cos(20.5^{\circ})b + (31^2-12^2)$ now find the values for the quad formula
$a=1, b=2*12\cos(20.5^{\circ}), c= 817$.  Since the discriminant is greater than zero there will be two solutions or in other words, two lengths for the third missing side. Once you have the two sides, then use the Law of Sines to find the angles. Voila, you are done!

I have created a Desmos graph that can be used to further model the idea of Angle Side Side. (See below) In the graph, you can move the opposite side, which is the ‘c slider”, to try and connect with the missing side.  Through careful observation you will notice that the value of the ‘c slider’ that makes a triangle actually is the +/- discriminant/(2a) part of the quadratic formula!  Having students discover this correlates to the idea how the quad formula is the vertex +/- distance to x-intercepts. In this case, the quadratic formula is the distance to the height +/- distance to opposite side. So when the discriminant is imaginary this means there is not a distance to the opposite side. If the discriminant is zero, then the opposite side is actually the height, altitude, of the triangle. Finally, when the discriminant is greater than zero there are two distances to the opposite. I think this is a great bridge back to x-intercepts and reinforces the importance of the quadratic formula.

Check out the desmos graph by clicking on the below picture. It is the Angle Side Side tutorial I mentioned above. Let me know what you think. Will you still use the Law of Sines?

Categories: desmos

## Dartboard and Equations

November 20, 2012 1 comment

While reading Dan Pearcy’s blog entry about Rich Questions I could not agree more about his statement

I love it when people share rich questions. Generally because I find that I can’t keep track of all the resources which come my way but I do seem to remember great questions.

For me, piling up resources is so easy to do, while actually implementing them is the difficult part. So, I am trying a new strategy next semester. Instead of having the “oh this would be a cool problem and oh this would be a cool problem too, oh-oh-M-G and I have to do this”, which ends up in only doing a few problems, I will focus on one problem and see how much I can get out it. Can a whole chapter be focused around one problem? I don’t know but if I find one, it will be placed in the “Rich Question” Category.

After seeing Dan’s post about linear equations and shapes being shaded, I wondered if the two could be combined. Here is my idea. First, I would have students look at this graph made in Desmos and ask the basic question, “What part is shaded in each square?”

(Click on the above picture to see graph at desmos.com.) After we agree that 50% is shaded in each region, I would ask the main question of the project.

If each square is an individual dartboard, then which square is the easiest to hit a shaded region? Which square is the hardest to hit a shaded region?

Where are the linear equations? The students would create the dartboards in Desmos by inputing linear equations. For example $y={-9 \leq x \leq -1;x+9}$ would graph the linear equation x+9 with a domain restriction -9 to -1. I think this could provide some good opportunity to solve equations, create equations, and practice domain restrictions. Of course the shading part, which uses a dampening function, would have to be explained. But once that is shown, that would create a bridge of transformations, a concept that seems only start with quadratics and not linear. Also, students might find a reason to know how to find the distance between two points.


text:
Calgary Collegiate Programming Competition 2017

#### Start

2017-03-18 20:00 CET

## Calgary Collegiate Programming Competition 2017

#### End

2017-03-19 00:00 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -184 days 20:14:48

4:00:00

0:00:00

# Problem EPlanetary Grid

Yraglac wants to get around within his gated community on Mars, Cossin. The Cossin community grounds are precisely – but strangely – shaped. Yraglac has spent many hours studying the grounds and has figured out the logic behind the landscaping.

If you put the landscaper’s house on a cartesian grid at position $(0,0)$, then the height of the land at each point is equal to $h = \sin \left(\frac{\pi x}{a}\right) \cdot \cos \left(\frac{\pi y}{b} + \frac{\pi }{2}\right)$ for some $a$ and $b$ that Yraglac is still working on figuring out. Roads are laid out wherever the height is zero.

Yraglac can drive on the roads, but has to walk through any area that isn’t a road. He doesn’t like walking much, so while walking he takes the shortest possible path between an off-road point and the nearest road, breaking ties by whichever makes his driving shorter.

Given coordinates that Yraglac wants to travel to and from, can you tell how far Yraglac will have to travel?

## Input

The input begins with an integer $1 \leq T \leq 1\, 000$, the number of test cases.

Each test case contains six integers $a$, $b$, $x_1$, $y_1$, $x_2$, and $y_2$. $a$ and $b$ ($1 \leq a,b \leq 10^8$) are the parameters to the height calculations, and $(x_1, y_1)$ and $(x_2, y_2)$ ($-10^8 \leq x_1, y_1, x_2, y_2 \leq 10^8$) are the starting and ending positions of Yraglac’s travel, respectively.

You may assume that there is a road intersecting the line segment from the starting position to the ending position.

## Output

The output consists of one number for each test case, the shortest distance Yraglac has to travel, rounded to the nearest integer.

Sample Input 1 Sample Output 1
2
1 1 0 0 1 1
2 2 1 1 2 2

2
2

format: plain


text:
# M1 in Economics and Economics and Statistics, Toulouse School of Economics

## Applied multivariate data analysis - Big data analytics (2014-…, 15 hours)

### A few hints

• Worksheet 1, exercise 1, question 1:

### Practical information

Nothing for the moment…

#### Final exam

Nothing for the moment…

For this course, I will intensively use R programming language. If you do not feel confortable with R, I advise you to check out this material:
• these slides, especially lessons 1 to 4 and lesson 6;
• install the R package swirl (instructions for the installation of R, RStudio and swirl are provided below). The package can be loaded into R using:
library(swirl)
and a swirl teaching session is started using
swirl()
Choose the course "1: R Programming" and follows the instructions: you have 12 short interactive courses that will help you to be more familiar with R;
• (not mandatory) if you want to go further, you can enroll to this on-line course.

For this course, the following (CRAN) packages must be installed (if you want to use your own computer): boot, mlbench, rpart, ipred, class, randomForest, e1071, foreach, doMC (unix-like OS users only) or doParallel (Windows users only).
In addition, the package rmr2 developped by Revolution Analytics must also be installed. This is done by following the tutorial provided at this link (in English).

## How to install R?

R can be downloaded for free on the official repository website. I also advise you to install RStudio which is a simple graphical user interface for R which is very handy in many situations. Finally, packages can be installed either the menu "Tools/Install packages" in RStudio or directly the command line:
install.packages("swirl")
in an R console.


text:
# Stephen Carr

Ph.D 2020

Stephen earned his Ph.D in physics in 2020 studying multilayered van der Waals materials. He works on ab initio multiscale modeling of electronic and atomic structures, with a focus on twisted moiré systems.


text:
Search this site

#### Local Sites

501days since
Curiosity Landing

Library >

### LabNotes

#### Spatial and Temporal Averages for Elliptical Orbits

posted Dec 16, 2013, 5:45 AM by Abel Mendez Torres   [ updated ]

Mean orbital values for distance, stellar flux, and equilibrium temperature can be computed with respect to spatial or temporal coordinates. Spatial averages are usually calculated with respect to the mean anomaly (E) or true anomaly (f). Temporal averages are calculated with respect to time (t) or the eccentric anomaly (M). It is often assumed that the mean equilibrium temperature of a planet in an elliptic orbit can be simply calculated from its mean distance or flux, but this is not correct.

We calculated analytic solutions for both the spatial and temporal averages of distance, flux, and equilibrium temperature (Méndez et al., 2014, in preparation). Here a is the semi-major axis, e is the eccentricity, L is the stellar luminosity, A is the planet's bond albedo, and To = 278.5 K (i.e. the equilibrium temperature of Earth for zero albedo). A factor f is related to the effectiveness of atmospheric circulation and how the energy absorbed is transferred from the planet’s day to night sides (e.g. f = 1 for fast rotators and f = 2 for tidally locked planets without atmospheres)For convenience, the formulas derived here use 'exoplanet units' where distances are in AU, flux in solar units, and temperature in kelvins.

#### Mean Spatial Distance, Flux, and Equilibrium Temperature

 $\large&space;\bar{r}=a\sqrt{1-e^2}$ (1)

 $\large&space;\overline{F}=\frac{L(2+e^2)}{2a^2\(1-e^2)^2}$ (2)

 $\large&space;\overline{T}_{eq}=T_o\left (\frac{fL(1-A)}{a^2}\right )^ \frac{1}{4} \frac{2}{\pi \sqrt{1-e}} \; \mathbf{E}\left ( \frac{2e}{1+e} \right )$ (3)

Here r̅ , F̅, and T̅eq are the mean spatial values (i.e. with respect to the true anomaly) for planet distance, stellar flux, and planet equilibrium temperature. E is the complete elliptic integral of the second kind of the argument within parenthesis.

#### Mean Temporal Distance, Flux, and Equilibrium Temperature

 $\large&space;\left \langle r \right \rangle=a\left ( 1+\frac{e^2}{2} \right )$ (4)

 $\large&space;\left \langle F \right \rangle=\frac{L}{a^2\sqrt{1-e^2}}$ (5)

 $\large&space;\left \langle T_{eq} \right \rangle=T_o\left (\frac{fL(1-A)}{a^2}\right )^ \frac{1}{4}\frac{2\sqrt{1+e}}{\pi} \; \mathbf{E}\left ( \frac{2e}{1+e} \right )$ (6)

Here <r>, <F>, and <Teq> are the mean temporal values (i.e. with respect to time) for planet distance, stellar flux, and planet equilibrium temperature. E is the complete elliptic integral of the second kind of the argument within parenthesis.

All the previous equations become the well known expressions for circular orbits for e = 0, where there is no difference between spatial or temporal averages. For most applications the temporal averages are the ones necessary. Eq. 1, 4, and 5 are well known expressions (William and Pollard, 2002Perryman, 2011). Eq. 2, 3, and 6 are new derivations, but only Eq. 6 has practical implications. Eq. 4, 5, and 6 were also verified with a numerical simulation.

#### Using the Mean Temporal Equilibrium Temperature

The time-average stellar flux (Eq. 5) can't be used to calculate the time-average equilibrium temperature (Eq. 6) as if often assumed. The stellar flux increases to infinity as the eccentricity of the planet approaches one. However, the equilibrium temperature does not change accordingly, actually it decreases with eccentricity approaching a minimum of about 90% the value for a circular orbit. This seems contradictory but the stellar flux increases with 1/r2 while the equilibrium temperature with 1/√r. Therefore, the following expressions should not be used to calculate the average equilibrium temperature from the average distance or stellar flux since they produces large errors (>>10%) for highly eccentric orbits:

 $\large&space;\left \langle T_{eq} \right \rangle \neq T_o\left (\frac{fL(1-A)}{\left \langle r \right \rangle ^2}\right )^ \frac{1}{4} \neq T_o\left (\left \langle F \right \rangle f(1-A)\right )^ \frac{1}{4}$ (7)

where <r> is given from Eq. 4 and <F> is given from Eq. 5. These expression suggests that the equilibrium temperature increases with an increase in stellar flux due to eccentricity but it is quite the opposite.

Eq. 6 is the analytic solution to the equilibrium temperatures for eccentric orbits. Errors from assuming a circular orbits can be up to 10% for highly eccentric orbits. Still, this is not a large error compared with larger uncertainties associated with f and A. Summarizing, given the equilibrium temperature for circular orbits, the equilibrium temperature for elliptical orbits is:

 $\large&space;\left \langle T_{eq} \right \rangle=T_{eqc}\frac{2\sqrt{1+e}}{\pi} \; \mathbf{E}\left ( \frac{2e}{1+e} \right )$ (8)

where the equilibrium temperature for circular orbits Teqc is given by:

 $\large&space;T_{eqc} = T_o\left (\frac{fL(1-A)}{a^2}\right )^ \frac{1}{4} = T_\star \sqrt{ \frac{R_\star }{2a}}\left [ f\left ( 1-A \right ) \right ]^{1/4}$ (9)

and T* and R* are the effective temperature and radius of the star.

#### Notes

• There are many math libraries which include calculations for complete elliptic integral functions (e.g. Mathematica and GSL). The following expression could be used to simplify the calculation of Eq. 6 or 8. Errors from this approximation are less than 1% (less than 0.5% for e < 0.5).
 $\large&space;\frac{2\sqrt{1+e}}{\pi} \; \mathbf{E}\left ( \frac{2e}{1+e} \right )\approx \sqrt{1+\left (\frac{8}{\pi^2} -1 \right )e^{5/2}}$ (10)

#### SER: First Look at Pluto

posted Nov 13, 2013, 9:34 AM by Abel Mendez Torres   [ updated Nov 13, 2013, 10:02 AM ]

 The Scientific Exoplanets Renderer (SER) is our core software to generate photorealistic-looking images of planets such as the ones for the Visible Paleo-Earth and the Habitable Exoplanets Catalog. SER was developed to simulate complex stellar transit events and interpret planetary light curves. It takes as little information from a planet as available to automatically create representations. The more input given the more the images become more scientific than artistic representations. Here with used SER to create a basic representation of Pluto (Figure 1 and 2) given its albedo maps obtained by Buie et al. (2010A, 2010B) from the Hubble Space Telescope (Figure 3). We will keep generating better and better representations as we get more data from Pluto, specially from New Horizons. We also plan to produce more creative versions by adding more surface features. It will be fun to compare our progress, starting from our first image, until the final close-up pictures of Pluto on July 2015. Figure 1. This representation of Pluto combines real and synthetic data to create a more photorealistic look. The image shows a possible scenario of Pluto that preserves the original basic albedo features. It uses a false color palette (similar to Triton) for only one of the two channels of the HST filters (F435W). Credit: PHL @ UPR Arecibo, NASA HST. Figure 2. Equirectangular projection of the Pluto map shown in Figure 1. Data for the south pole was extrapolated since it was not available in the original HST data. Credit: PHL @ UPR Arecibo, NASA HST. Figure 3. This is the most detailed view to date of the entire surface of the dwarf planet Pluto, as constructed from multiple NASA Hubble Space Telescope photographs taken from 2002 to 2003. Credit: NASA, ESA, and M. Buie (Southwest Research Institute).

#### Occurrence of Earth-like planets around GKM Stars

posted Nov 5, 2013, 8:12 AM by Abel Mendez Torres   [ updated Nov 5, 2013, 8:47 AM ]

Here we combine and interpret results from Kopparapu (2013) and Petigura et al. (2013) on the occurrence of Earth-like planets around red-dwarf (type M) and Sun-like (type G and K) stars, respectively. Both studies used NASA Kepler results. Based on their occurrence estimates we calculated the mean separation and 95% confidence distance for the solar neighborhood (<10pc). These numbers suggest that there is over a 95% probability of finding an Earth-like planet around a Sun-like star in the solar neighborhood. The probability is higher for those around M-dwarf stars.

Table 1. Occurrence (ηE), separation (δ), and 95% confidence distance (d95%) of Earth-like planets (0.5 — 2.0 RE in the HZ) around M-dwarfs and GK stars. The study of Petigura et al. (2013) only considered 1.0 — 2.0 RE planets. Calculations assume that there are 198 stellar systems with M-dwarf stars and 50 with GK-stars in the solar neighborhood (<10pc).

 M-dwarfs (Kopparapu, 2013) GK stars (Petigura et al., 2013) Habitable Zone Definition a (AU)* ηE δE (ly) dE 95% (ly) ηE δE (ly) dE 95% (ly) Conservative (1) 0.99 — 1.69 0.51 +0.10/-0.20 6.25 10.1 0.086 ± 0.03 17.9 28.9 Empirical (1) 0.75 — 1.84 0.61 +0.07/-0.15 5.89 9.51 0.14 ± 0.05 15.2 24.6 Simple Flux (2) 0.5 — 2 — — — 0.22 ± 0.08 13.1 21.1 Desert-H2 Planets (3) 0.38 — 10 — — — 0.52 ± 0.19 9.8 15.9

HZ References: (1)

Table Notes:
a = semi-major axis (values shown for G stars, check here for other types of stars).
ηE (eta Earth) = fraction of Earth-like planets per star.
δ(delta Earth) = mean distance between stellar systems with Earth-like planets.
d95% = 95% confidence distance for an Earth-like planet.

#### New Kepler Potential Planet Transit Signals

posted Nov 4, 2013, 8:00 AM by Abel Mendez Torres   [ updated Nov 4, 2013, 8:03 AM ]

 The NASA Kepler team released a revised global list of 16,285 potential planet transit signals (formally known as Threshold-Crossing Events or TCE) from quarters one to sixteen, the four years of operation of Kepler (Table 1). This list already includes most of the 3,602 Kepler Objects of interest (KOI) with 170 Kepler Confirmed Planets.Additional analysis is necessary to confirm the planetary nature of the over 12,000 remaining TCE objects. Many of these transits signals are expected to be false alarms, specially for long periods objects such as those orbiting within the habitable zone (HZ).Nearly 1,500 TCE objects match our standard criteria for potentially habitable planets (planet size 0.4 — 2.6 Earth radii orbiting within the empirical HZ), but only about 20% of them might turn out to be real planets, still a large number. Nevertheless, this analysis provides some upper limits to interesting objects in the Kepler TCE sample (Table 2).Table 1. Summary statistics of some planetary and stellar characteristics of the new 16,285 TCE list.---------------------------------------------------------------------------                      Property         MIN         AVG         MAX    Count---------------------------------------------------------------------------           Planet Radius (EU):        0.00       15.53     5312.00    16285         Planet Period (days):        0.50      197.33      707.28    16285  Planet Semi-Major Axis (AU):      0.0101      0.5349      2.3200    16285        Planet Temperature(K):       63.10      875.85    14200.00    16285               Star Mass (SU):        0.09        1.06        3.71    16285             Star Radius (SU):        0.12        4.18      219.50    16285         Star Temperature (K):     2661.00     5715.10    15896.00    16285         Star Luminosity (SU):      0.0006     48.2446  14036.8495    16285---------------------------------------------------------------------------EU = earth units, SU = solar unitsTable 2. Basic analysis of the TCE objects. ----------------------------------------------------------------------------Habitable Exoplanets Catalog (HEC) Statistics  Data Source: NASA Kepler Threshold Crossing Events (TCE)  [Nov  4, 2013] Planetary Habitability Laboratory (phl.upr.edu) ----------------------------------------------------------------------------                         Stellar Systems  9743                              Exoplanets 16285              Exoplanets in the Hot Zone 10982 (67.4%) Exoplanets in the Warm 'Habitable' Zone  3646 (22.4%)             Exoplanets in the Cold Zone  1657 (10.2%)                            Unclassified     0 ( 0.0%)          Potential Habitable Exoplanets  1486 ( 9.1%)   Expected Potential Habitable Exomoons   185 ( 1.1%)                               Eta Earth  15.3 %------------------------------------------------------------------------------------------------------------------------------------------------Number of Multiple Systems--------------------------------------------------------------------     1      2      3      4      5      6     7      8      9     10  6520   1832    537    292    228    204    93     30      3      4  66.9   18.8    5.5    3.0    2.3    2.1   1.0    0.3    <0.1  <0.1-------------------------------------------------------------------------------------------------------------------------------------------Planetary Class-----------------------------------------------------------------------Mercurian    Subterran     Terran    Superterran    Neptunian    Jovian42           327           1382      5766           5063         33550.3          2.0           8.5       35.4           31.1         20.6---------------------------------------------------------------------------------------------------------------Hot Zone            Category     Count   Percent----------------------------------------          Mercurians        19       0.1          Subterrans       274       1.7             Terrans      1123       6.9        Superterrans      3664      22.5          Neptunians      2695      16.5             Jovians      2858      17.5--------------------------------------------------------------------------------Warm 'Habitable' Zone            Category     Count   Percent----------------------------------------          Mercurians         3       0.0          Subterrans        29       0.2             Terrans       117       0.7        Superterrans      1340       8.2          Neptunians      1760      10.8             Jovians       396       2.4--------------------------------------------------------------------------------Cold Zone            Category     Count   Percent----------------------------------------          Mercurians        20       0.1          Subterrans        24       0.1             Terrans       142       0.9        Superterrans       762       4.7          Neptunians       608       3.7             Jovians       101       0.6----------------------------------------ReferencesDetection of Potential Transit Signals in Sixteen Quarters of Kepler Mission Data

#### 50th Anniversary of the Arecibo Observatory

posted Oct 21, 2013, 2:15 PM by Abel Mendez Torres   [ updated Oct 27, 2013, 7:20 PM ]

#### A Binomial Nomenclature for Common Names of Exoplanets

posted Sep 27, 2013, 12:09 AM by Abel Mendez Torres   [ updated Sep 27, 2013, 12:20 AM ]

 When naming exoplanets create common names for both the stellar system and the exoplanetsThere are nearly one thousand exoplanets already confirmed and many more waiting for confirmation. The general astronomy community is interested on naming exoplanets with the help of the general public (1). Individual naming of such discoveries is a time consuming labor but both usable by the scientific community and general public.Simple procedures for the individual naming of thousands or even millions of objects are nothing new to science. For example the binomial nomenclature by genera and species in Biology has been used to name over 1.2 million species and has the potential to name more than the estimated 8.7 million species on Earth (2). These are used as scientific names, equivalent to the catalog names in astronomy, but in many cases are easier to remember and even used as common names (i.e. E. coli).We propose a similar binomial nomenclature for exoplanets to create simple hierarchical common names. The first part of the name is the stellar system and the second part is the individual planet name. If the stars have already a common name then it is used as the stellar system names (i.e. Fomalhaut). The planets or other stars of the system are named with the usual alphabetical letters until a proper name is given.This procedure reduces the complexity of the catalog star names until the planets are individually named. As an hypothetical example, the planet Alpha Centauri B b, could become Alcen-B Rakhat, where Alcen is the name of the stellar system, B denotes the second star of the system, and Rakhat the name of the planet. The actual selection process of the individual names for the system and planets are out of the scope of this proposal.Therefore, any exoplanet naming campaign should concentrate first efforts on naming the stellar systems of interest and then any individual planets, avoiding naming exoplanets before the stellar systems. The stellar names could also be used to guide the naming of its planets. Our suggestion describes a minimum effort plan for naming exoplanets and provides a logical and hierarchical system not much different from the current catalog names, but for common names too.In the end, it is expected that some exoplanets will be better known by their full name (using both system and planet names) and others just by their individual name. A new definition of planets that includes both solar and extrasolar planets would also be appropriate before any naming campaign (3).ReferencesA similar version of this letter was submitted to the IAU request for exoplanets names on September 15, 2013.

#### About 40 potentially habitable worlds by the end of 2015?

posted Sep 20, 2013, 3:12 AM by Abel Mendez Torres

We started with just two planets in our Habitable Exoplanets Catalog almost two years ago on December 2011. At that time having a catalog for just two planets was overkill and we were not expecting much change anyway until many years, but we were surprised. We ended the first years with seven and now we have twelve, and the year is not over yet. That certainly exceeded our expectations. The exoplanets field was moving much faster toward the detection of smaller Earth-size planets by both the radial velocity and transit methods. A catalog is now a necessary tool to track these discoveries.

The 2010's is the decade when we finally started to discover potentially habitable worlds (the exception is Gliese 581d discovered on 2007). We have enough data now to give some preliminary prediction on the expected number of habitable exoplanets to be discovered in the next years. If we follow the present trend (Figure 1) there could be a total of 21 by 2014 and 38 by 2015. That still sounds like too many for just two years but there are 36 waiting for confirmation from the NASA Kepler mission alone. Similar predictions can be derived for the total number of confirmed exoplanets (Figure 2). Lets wait and see what happens.
Figure 1. Cumulative number of potentially habitable exoplanets detected in the last four years (red dots). The data was fitted with an exponential function (blue line) included at the top of the plot. The fit predicts reaching about 21 exoplanets by 2014 and 38 by 2015. Predictions for longer periods are much more uncertain. Data source is available in Table 1.
Figure 2. Cumulative number of confirmed exoplanets detected in the last 22 years (red dots). The data was fitted with an exponential function (blue line) included at the top of the plot. The fit predicts reaching over 1,000 exoplanets by the end of 2013 and over 1,500 by 2015. Predictions for longer periods are much more uncertain. Data source is available in Table 1.

Table 1. Number per year and cumulative (total from all previous years) of discovered confirmed exoplanets and those potentially habitable. Data from the PHL's Exoplanet Catalog. The year 2011 was a good year for exoplanet discoveries. Figures 1 and 2 show the cumulative data plotted.
 Confirmed Potentially Habitable Year Per Year Cumulative Per year Comulative 1989 1 1 1990 0 1 1991 0 1 1992 3 4 1993 0 4 1994 0 4 1995 1 5 1996 6 11 1997 0 11 1998 7 18 1999 11 29 2000 19 48 2001 14 62 2002 30 92 2003 27 119 2004 31 150 2005 33 183 2006 29 212 2007 61 273 1 1 2008 61 334 0 1 2009 81 415 0 1 2010 114 529 1 2 2011 189 718 2 4 2012 147 865 3 7 2013 109 974 5 12

#### One-AU Exoplanets

posted Aug 12, 2013, 12:42 PM by Abel Mendez Torres   [ updated Aug 12, 2013, 1:01 PM ]

 Most known exoplanets are within one astronomical unit (AU) from their stars, a bias of our detection methods. Here are graphical representations of 417 stellar systems with planets within one AU from their star, out of 712 stars with 927 confirmed planets (some have multiple planets). Each system is represented in individual files for convenience but we plan to create a few posters out of these figures. Some interesting examples are shown below (click to enlarge) starting with our own Solar System. More specific explanations of the plots are at the end. You can download all 418 PNG figures as a single ZIP file, including our Sun, from this link. Images description: The star and planets are magnified for clarity, by x10 and x50 respectively, otherwise they would look like dots at the one AU scale of the plots. Since the scales are different for the stars and planets, the planets are always 5 times smaller than they appear compared to the star. Some stars are so big that they are out of the scale or overlapping the planets. The size of Earth, Neptune, and Jupiter is shown in each plot for reference. The stars are colored by their spectral color. Planets are colored red if hot, green warm (in the habitable zone), and blue cold. The size of the habitable zone, many times extending beyond one AU, is illustrated in light green.

#### Earth from Near and Deep Space

posted Jul 19, 2013, 2:33 AM by Abel Mendez Torres   [ updated Jul 23, 2013, 3:07 AM ]

 The Cassini spacecraft on Saturn and the Messenger spacecraft on Mercury are taking images of Earth in July 19, 2013. From their vantage point Earth will be just a few pixels, but these are rare events. Only Voyager, Cassini and Messenger have taken pictures of Earth from deep outer space before. However, not only these two spacecraft will be taking pictures of the full globe of Earth on that day. The GOES East and Meteosat meteorological satellites have similar view perspectives as Cassini and Messenger, respectively. To commemorate this event we will try to generate satellites images of Earth near the moments the pictures from Cassini and Messenger are taken. We have to accurately combine the satellite images, which are in black and white, with color information to generate true-color images. Our plan is to create a composite wallpaper with the Cassini and Messenger faraway images together with the Earth closeups. Figure 1. Simulated view of Earth at the moment of its picture from Cassini on Friday, July 19, 2013 between 5:27 to 5:42 PM EDT (21:27 and 21:47 UTC). Here shown exactly at 5:27 PM EDT. The GOES East satellite has a slightly west-displaced view of Earth than Cassini at the moment of the picture. Credit: NASA Solar System Simulator. Figure 2. Simulated view of Earth at the moment of its picture from Messenger on Friday, July 19, 2013 and Saturday, July 20, 2013 at 7:49 AM, 8:38 AM and 9:41 AM on both days  (11:49, 12:38 and 13:41 UTC). Here shown exactly at 7:49 AM EDT. The Meteosat satellite has a very similar view of Earth as Messenger at the moment of the picture. Credit: NASA Solar System Simulator. Figure 3. Actual image of Earth from space by the GEOS East meteorological satellite taken on July 18, 2013 at 5 PM EDT. Color of the image was synthetically incorporated from NASA Visible Earth imagery using the PHL's SER software. This image was created to test our software in preparation for the event. Click for larger version. Credit: PHL @ UPR Arecibo, NASA, NERC Satellite Receiving Station, Dundee University, Scotland. Here are the final results.Additional Information

#### Statistics of Nearby Earth-like Planets Around M-dwarfs Stars

posted Apr 8, 2013, 12:28 AM by Abel Mendez Torres   [ updated Apr 8, 2013, 1:20 AM ]

Here is an analysis on the frequency, number, distance, and probability of Earth-like planets (Earth-size within the habitable zone) around M-dwarf stars within 10 parsecs (~33 light years) from Earth. Table 1 shows these numbers for η(eta Earth) from four definitions of an Earth-like planet of Kopparapu (2013). These numbers assume that there are 248 M-dwarfs stars (RECONS) in 198 stellar systems (NSC) within 10 parsecs.

Table 1. Statistics of nearby Earth-like planets around M-dwarfs stars (see legend below for field definitions) for four definitions of Earth-like planet based on their size and orbit within a conservative or optimistic habitable zone.

 Planet Size Habitable Zone ηE NE δE (ly) pE 10 ly (%) dE 95% (ly) 0.5 — 1.4 RE conservative 0.48 +0.12/-0.24 119 +30/-60 6.38 ± 2.32 93.5 10.30 0.5 — 2.0 RE conservative 0.51 +0.10/-0.20 126 +25/-50 6.25 ± 2.27 94.6 10.10 0.5 — 1.4 RE optimistic 0.53 +0.08/-0.17 131 +20/-42 6.17 ± 2.24 95.1 9.97 0.5 — 2.0 RE optimistic 0.61 +0.07/-0.15 151 +17/-37 5.89 ± 2.14 96.9 9.51

Table Definitions:
ηE (eta Earth) = frequency of Earth-like planets per star (also called fraction or occurrence).
N= number of Earth-like planets.
δ(delta Earth) = mean distance between stellar systems with Earth-like planets.
pE 10 ly = probability of an Earth-like planet within 10 light years from Earth.
dE 95% = distance from Earth for the 95% confidence level of an Earth-like planet.

In summary, there are over one-hundred Earth-like planets around M-dwarf stars within 10 parsecs from Earth. Just one or two are probably transiting (transiting probability of ~0.6-1.6%). This also means that there are over 67 to 134 billion Earth-like planets around low mass stars in our galaxy. Assuming that there are 200 to 400 billion stars in the Milky Way where 70% of those are low mass stars (0.1 to 0.8 solar masses) (Bochanski et al., 2010).

References

Bochanski, J. J., Hawley, S. L., Covey, K. R., West, A. A., Reid, I. N., Golimowski, D. A., and Ivezić, v. (2010). The Luminosity and Mass Functions of Low-mass Stars in the Galactic Disk. II. The Field. The Astronomical Journal, 139, 6, 2679.

1-10 of 73


text:
# Winning strategy of Nim game when picking from multiple piles is allowed

I am studying with Game theory right now. In Nim game, in any turn, a player can move any number of stones from any one pile. I am wondering what might be the winning strategy of first player if in any move, a player can pick any number of stones from one or more piles? In this case, how the xor = 0 rule will work? Both are playing optimally.

## 1 Answer

The answer assumes that you have to take the same amount of stones from each pile that you choose. Otherwise the first player always wins as long as the piles are not all empty.

The rule "xor = 0" doesn't work. In particular, there is a winning position with xor = 0 (easy exercise; be creative).

In order to analyze the game, you can compute which positions are winning and which are losing recursively (surely you have been shown how to do that in your course). Then you can look at which positions are winning and which are losing, and try to guess a rule; you will then need to prove that your rule works.

In this particular case, however, the analysis will be quite difficult. The case of two piles is known as Wythoff's game, and is already pretty non-trivial to analyze.

• Thanks! Your answer has pushed me to intuitively think on it :) – Kaidul Islam Apr 30 '16 at 16:16


text:
# Probability problem

• September 20th 2010, 01:47 PM
ashamrock415
Probability problem
One box contains 6 red balls and 4 green balls, and a second box contains 7 red balls and 3green balls. A ball is randomly selected from the first box and placed in the second box. Then a ball is randomly selected from the second box and placed in the first box.

At the conclusion of the selection process, what is the probability that the numbers of red and green balls in the first box are identical to the numbers at the beginning?
• September 20th 2010, 02:01 PM
Plato
Quote:

Originally Posted by ashamrock415
One box contains 6 red balls and 4 green balls, and a second box contains 7 red balls and 3green balls. A ball is randomly selected from the first box and placed in the second box. Then a ball is randomly selected from the second box and placed in the first box. At the conclusion of the selection process, what is the probability that the numbers of red and green balls in the first box are identical to the numbers at the beginning?

What must sequence must happen to reach that conclusion?

Here is a hint: $R_1R_2\text{ or }G_1G_2$.


text:
Previous |  Up |  Next

# Article

Full entry | PDF   (0.5 MB)
Keywords:
Fibonacci sequence; Diophantine equation
Summary:
Let $F_n$ denote the $n^{th}$ term of the Fibonacci sequence. In this paper, we investigate the Diophantine equation $F_1^p+2F_2^p+\cdots +kF_{k}^p=F_{n}^q$ in the positive integers $k$ and $n$, where $p$ and $q$ are given positive integers. A complete solution is given if the exponents are included in the set $\lbrace 1,2\rbrace$. Based on the specific cases we could solve, and a computer search with $p,q,k\le 100$ we conjecture that beside the trivial solutions only $F_8=F_1+2F_2+3F_3+4F_4$, $F_4^2=F_1+2F_2+3F_3$, and $F_4^3=F_1^3+2F_2^3+3F_3^3$ satisfy the title equation.
References:
[1] Alvarado, S.D., Dujella, A., Luca, F.: On a conjecture regarding balancing with powers of Fibonacci numbers. Integers 12 (2012), 1127–1158. DOI 10.1515/integers-2012-0032 | MR 3011553
[2] Andreescu, T., Andrica, D.: Quadratic Diophantine Equations. 2015, 124–126. MR 3362224
[3] Behera, A., Liptai, K., Panda, G.K., Szalay, L: Balancing with Fibonacci powers. Fibonacci Quart. 49 (2011), 28–33. MR 2781575
[4] Chaves, A.P., Marques, D., Togbé, A.: On the sum of powers of terms of a linear recurrence sequence. Bull. Braz. Math. Soc. New Series 43 (2012), 397–406. DOI 10.1007/s00574-012-0018-y | MR 3024062
[5] Koshy, T.: Fibonacci and Lucas Numbers with Applications. John Wiley and Sons, 2011. MR 1855020
[6] Luca, F., Oyono, R.: An exponential Diophantine equation related to powers of two consecutive Fibonacci numbers. Proc. Japan Acad. Ser. A 87 (2011), 45–50. MR 2803898
[7] Luca, F., Szalay, L.: Fibonacci diophantine triples. Glas. Mat. Ser. III 43 (63) (2008), 253–264. DOI 10.3336/gm.43.2.03 | MR 2460699
[8] Marques, D., Togbé, A.: On the sum of powers of two consecutive Fibonacci numbers. Proc. Japan Acad. Ser. A 86 (2010), 174–176. MR 2779831
[9] Panda, G.K.: Sequence balancing and cobalancing numbers. Fibonacci Quart. 45 (2007), 265–271. MR 2438198
[10] Pongsriiam, P.: Fibonacci and Lucas numbers associated with Brocard-Ramanujan equation. Commun. Korean Math. Soc. 91 (3) (2017), 511–522. MR 3682410
[11] Pongsriiam, P.: Fibonacci and Lucas numbers which are one away from their products. Fibonacci Quart. 55 (2017), 29–40. MR 3620575
[12] Soydan, G.: On the Diophantine equation $(x+1)^k+(x+2)^k+\dots +(lx)^k=y^n$. Publ. Math. Debrecen 91 (3–4) (2017), 369–382. MR 3744801
[13] Vorob’ev, N.N.: Fibonacci Numbers. Blaisdell Pub. Co. New York, 1961.
[14] Wulczyn, G.: Problem E2158. Amer. Math. Monthly 76 (1969), 1144–1146. DOI 10.2307/2317203 | MR 1535701

Partner of


text:
# Recommender Systems

## Bayesian Recommender Systems

Recommender systems are increasingly driving user experiences on the Internet. This personalization is often achieved through the factorization of a large but sparse observation matrix of user-item feedback signals. We present a probabilistic model for generating personalised recommendations of items to users. The system makes use of content information in the form of user and item meta data in combination with collaborative filtering information from previous user behavior in order to predict the value of an item for a user. Users and items are represented by feature vectors which are mapped into a low-dimensional trait space in which similarity is measured in terms of inner products. The model can be trained from different types of feedback in order to learn user-item preferences. Efficient inference is achieved by approximate message passing involving a combination of Expectation Propagation (EP) and Variational Message Passing. By using Assumed-Density Filtering (ADF) for training, the model requires only a single pass through the training data.

We also include a dynamics model which allows an item’s popularity, a user’s taste or a user’s personal rating scale to drift over time. This is an on-line learning algorithm capable of incrementally taking account of new data so the system can immediately reflect the latest user preferences. In instances where the user’s social network is known, its inclusion can significantly improve recommendations for cold start users. We also propose and investigate two ways for including a social network, either as a Markov Random Field that describes a user similarity in the prior over user features, or an explicit model that treats social links as observations.

• M. Gartrell, U. Paquet, and R. Herbrich, „A Bayesian Treatment of Social Links in Recommender Systems,“ CU Technical Report CU-CS-1092-12 2012.

Recommender systems are increasingly driving user experiences on the Internet. This personalization is often achieved through the factorization of a large but sparse observation matrix of user-item feedback signals. In instances where the user’s social network is known, its inclusion can significantly improve recommendations for cold start users. There are numerous ways in which the network can be incorporated into a probabilistic graphical model. We propose and investigate two ways for including a social network, either as a Markov Random Field that describes a user similarity in the prior over user features, or an explicit model that treats social links as observations. State of the art performance is reported on the Flixster online social network dataset.

@techreport{gartrell2012bayesian,
abstract = {Recommender systems are increasingly driving user experiences on the Internet. This personalization is often achieved through the factorization of a large but sparse observation matrix of user-item feedback signals. In instances where the user's social network is known, its inclusion can significantly improve recommendations for cold start users. There are numerous ways in which the network can be incorporated into a probabilistic graphical model. We propose and investigate two ways for including a social network, either as a Markov Random Field that describes a user similarity in the prior over user features, or an explicit model that treats social links as observations. State of the art performance is reported on the Flixster online social network dataset.},
author = {Gartrell, Mike and Paquet, Ulrich and Herbrich, Ralf},
institution = {CU Technical Report CU-CS-1092-12},
title = {A {Bayesian} Treatment of Social Links in Recommender Systems},
url = {https://www.herbrich.me/papers/ucb511101092internet.pdf},
year = {2012},
}

• D. Stern, R. Herbrich, and T. Graepel, „Matchbox: Large Scale Online Bayesian Recommendations,“ in Proceedings of the 18th International Conference on World Wide Web, 2009, p. 111–120.

We present a probabilistic model for generating personalised recommendations of items to users of a web service. The Matchbox system makes use of content information in the form of user and item meta data in combination with collaborative filtering information from previous user behavior in order to predict the value of an item for a user. Users and items are represented by feature vectors which are mapped into a low-dimensional trait space in which similarity is measured in terms of inner products. The model can be trained from different types of feedback in order to learn user-item preferences. Here we present three alternatives: direct observation of an absolute rating each user gives to some items, observation of a binary preference (like/ don’t like) and observation of a set of ordinal ratings on a userspecific scale. Efficient inference is achieved by approximate message passing involving a combination of Expectation Propagation (EP) and Variational Message Passing. We also include a dynamics model which allows an item’s popularity, a user’s taste or a user’s personal rating scale to drift over time. By using Assumed-Density Filtering (ADF) for training, the model requires only a single pass through the training data. This is an on-line learning algorithm capable of incrementally taking account of new data so the system can immediately reflect the latest user preferences. We evaluate the performance of the algorithm on the MovieLens and Netflix data sets consisting of approximately 1,000,000 and 100,000,000 ratings respectively. This demonstrates that training the model using the on-line ADF approach yields state-of-the-art performance with the option of improving performance further if computational resources are available by performing multiple EP passes over the training data.

@inproceedings{stern2009matchbox,
abstract = {We present a probabilistic model for generating personalised recommendations of items to users of a web service. The Matchbox system makes use of content information in the form of user and item meta data in combination with collaborative filtering information from previous user behavior in order to predict the value of an item for a user. Users and items are represented by feature vectors which are mapped into a low-dimensional trait space in which similarity is measured in terms of inner products. The model can be trained from different types of feedback in order to learn user-item preferences. Here we present three alternatives: direct observation of an absolute rating each user gives to some items, observation of a binary preference (like/ don't like) and observation of a set of ordinal ratings on a userspecific scale. Efficient inference is achieved by approximate message passing involving a combination of Expectation Propagation (EP) and Variational Message Passing. We also include a dynamics model which allows an item's popularity, a user's taste or a user's personal rating scale to drift over time. By using Assumed-Density Filtering (ADF) for training, the model requires only a single pass through the training data. This is an on-line learning algorithm capable of incrementally taking account of new data so the system can immediately reflect the latest user preferences. We evaluate the performance of the algorithm on the MovieLens and Netflix data sets consisting of approximately 1,000,000 and 100,000,000 ratings respectively. This demonstrates that training the model using the on-line ADF approach yields state-of-the-art performance with the option of improving performance further if computational resources are available by performing multiple EP passes over the training data.},
author = {Stern, David and Herbrich, Ralf and Graepel, Thore},
booktitle = {Proceedings of the 18th International Conference on World Wide Web},
pages = {111--120},
title = {{Matchbox}: Large Scale Online {Bayesian} Recommendations},
url = {https://www.herbrich.me/papers/www09.pdf},
year = {2009}
}

## Large-Scale Approximate Recommender Systems

In general, collaborative filtering (CF) systems show their real strength when supplied with enormous data sets. In order to handle massive amounts of information, we investigated sketching techniques. We demonstrate how to use fingerprinting methods to compute a family of rank correlation coefficients with high accuracy and confidence. We examine the suggested methods empirically through a recommender system for the Netflix dataset, showing that the required fingerprint sizes are even smaller than the theoretical analysis suggests. We also explore the of use standard hash functions rather than min-wise independent hashes and the relation between the quality of the final recommendations and the fingerprint size.

• Y. Bachrach and R. Herbrich, „Fingerprinting Ratings for Collaborative Filtering – Theoretical and Empirical Analysis,“ in Proceedings of 17th International Symposium on String Processing and Information Retrieval, 2010, p. 25–36.

We consider fingerprinting methods for collaborative filtering (CF) systems. In general, CF systems show their real strength when supplied with enormous data sets. Earlier work already suggests sketching techniques to handle massive amounts of information, but most prior analysis has so far been limited to non-ranking application scenarios and has focused mainly on a theoretical analysis. We demonstrate how to use fingerprinting methods to compute a family of rank correlation coefficients. Our methods allow identifying users who have similar rankings over a certain set of items, a problem that lies at the heart of CF applications. We show that our method allows approximating rank correlations with high accuracy and confidence. We examine the suggested methods empirically through a recommender system for the Netflix dataset, showing that the required fingerprint sizes are even smaller than the theoretical analysis suggests. We also explore the of use standard hash functions rather than min-wise independent hashes and the relation between the quality of the final recommendations and the fingerprint size.

@inproceedings{bachrach2010fingerprinting,
abstract = {We consider fingerprinting methods for collaborative filtering (CF) systems. In general, CF systems show their real strength when supplied with enormous data sets. Earlier work already suggests sketching techniques to handle massive amounts of information, but most prior analysis has so far been limited to non-ranking application scenarios and has focused mainly on a theoretical analysis. We demonstrate how to use fingerprinting methods to compute a family of rank correlation coefficients. Our methods allow identifying users who have similar rankings over a certain set of items, a problem that lies at the heart of CF applications. We show that our method allows approximating rank correlations with high accuracy and confidence. We examine the suggested methods empirically through a recommender system for the Netflix dataset, showing that the required fingerprint sizes are even smaller than the theoretical analysis suggests. We also explore the of use standard hash functions rather than min-wise independent hashes and the relation between the quality of the final recommendations and the fingerprint size.},
author = {Bachrach, Yoram and Herbrich, Ralf},
booktitle = {Proceedings of 17th International Symposium on String Processing and Information Retrieval},
pages = {25--36},
title = {Fingerprinting Ratings for Collaborative Filtering - Theoretical and Empirical Analysis},
url = {https://www.herbrich.me/papers/spire10.pdf},
year = {2010}
}

• Y. Bachrach, R. Herbrich, and E. Porat, „Sketching Algorithms for Approximating Rank Correlations in Collaborative Filtering Systems,“ in Proceedings of 16th International Symposium String Processing and Information Retrieval, 2009, p. 344–352.

Collaborative filtering (CF) shares information between users to provide each with recommendations. Previous work suggests using sketching techniques to handle massive data sets in CF systems, but only allows testing whether users have a high proportion of items they have both ranked. We show how to determine the correlation between the rankings of two users, using concise sketches of the rankings. The sketches allow approximating Kendall’s Tau, a known rank correlation, with high accuracy $\epsilon$ and high confidence $1-\delta$. The required sketch size is logarithmic in the confidence and polynomial in the accuracy.

@inproceedings{bachrach2009sketching,
abstract = {Collaborative filtering (CF) shares information between users to provide each with recommendations. Previous work suggests using sketching techniques to handle massive data sets in CF systems, but only allows testing whether users have a high proportion of items they have both ranked. We show how to determine the correlation between the rankings of two users, using concise sketches of the rankings. The sketches allow approximating Kendall's Tau, a known rank correlation, with high accuracy $\epsilon$ and high confidence $1-\delta$. The required sketch size is logarithmic in the confidence and polynomial in the accuracy.},
author = {Bachrach, Yoram and Herbrich, Ralf and Porat, Ely},
booktitle = {Proceedings of 16th International Symposium String Processing and Information Retrieval},
pages = {344--352},
title = {Sketching Algorithms for Approximating Rank Correlations in Collaborative Filtering Systems},
url = {https://www.herbrich.me/papers/spire09.pdf},
year = {2009}
}

## Active Learning in Recommender Systems

Recommendation systems are trained to predict user behavior which is then used to generate new training by receiving actual user behavior of these recommendations. This creates a feedback loop: as long as the low-cost way to interact with the service is through the recommender, the recommender will only ever see behavioral data on the items it chooses. This process can lead to hidden biases, as it effectively limits how much information the recommender system will ever see. We explore the notion that recommender systems are a special kind of active learning agents, with the peculiarity that the cost of asking for the label of an instance depends on its true label, as the cost of showing a bad recommendation when exploring is higher than the cost of showing a good recommendation.

• A. Passos, J. Van Gael, R. Herbrich, and U. Paquet, „A Penny for Your Thoughts? The Value of Information in Recommendation Systems,“ in NIPS Workshop on Bayesian Optimization, Experimental Design, and Bandits, 2011, p. 9–14.

Most recommendation systems are trained to predict behavioral data and then used to generate more such data by recommending items and receiving feedback on the quality of these recommendations. This data in then fed back into the training process. This creates a feedback loop: as long as the low-cost way to interact with the service is through the recommender, the recommender will only ever see behavioral data on the items it chooses. This process can lead to hidden biases, as it effectively limits how much information the recommender system will ever see. On the other hand, there is a cost to making exploratory recommendations, as they should, myopically, be worse than the best bets of a recommendation system. In this paper we explore the notion that recommender systems are a special kind of active learning agents, with the peculiarity that the cost of asking for the label of an instance depends on its true label, as the cost of showing a bad recommendation when exploring is higher than the cost of showing a good recommendation.

@inproceedings{passos2011informationvalue,
abstract = {Most recommendation systems are trained to predict behavioral data and then used to generate more such data by recommending items and receiving feedback on the quality of these recommendations. This data in then fed back into the training process. This creates a feedback loop: as long as the low-cost way to interact with the service is through the recommender, the recommender will only ever see behavioral data on the items it chooses. This process can lead to hidden biases, as it effectively limits how much information the recommender system will ever see. On the other hand, there is a cost to making exploratory recommendations, as they should, myopically, be worse than the best bets of a recommendation system. In this paper we explore the notion that recommender systems are a special kind of active learning agents, with the peculiarity that the cost of asking for the label of an instance depends on its true label, as the cost of showing a bad recommendation when exploring is higher than the cost of showing a good recommendation.},
author = {Passos, Alexandre and Van Gael, Juergen and Herbrich, Ralf and Paquet, Ulrich},
booktitle = {{NIPS} Workshop on {Bayesian} Optimization, Experimental Design, and Bandits},
pages = {9--14},
title = {A Penny for Your Thoughts? The Value of Information in Recommendation Systems},
url = {https://www.herbrich.me/papers/passos11penny.pdf},
year = {2011}
}

## Transparent User Models

Personalization is a ubiquitous phenomenon in our daily online experience. While such technology is critical for helping us combat the overload of information we face, in many cases, we may not even realize that our results are being tailored to our personal tastes and preferences. Worse yet, when such a system makes a mistake, we have little recourse to correct it. In this work, we developed a new user-interpretable feature set upon which to base personalized recommendations. These features, which we call badges, represent fundamental traits of users (e.g., “vegetarian” or “Apple fanboy”) inferred by modeling the interplay between a user’s behavior and self-reported identity.

• K. El-Arini, U. Paquet, R. Herbrich, J. Van Gael, and B. Agüera y Arcas, „Transparent User Models for Personalization,“ in Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2012, p. 678–686.

Personalization is a ubiquitous phenomenon in our daily online experience. While such technology is critical for helping us combat the overload of information we face, in many cases, we may not even realize that our results are being tailored to our personal tastes and preferences. Worse yet, when such a system makes a mistake, we have little recourse to correct it. In this work, we propose a framework for addressing this problem by developing a new user-interpretable feature set upon which to base personalized recommendations. These features, which we call badges, represent fundamental traits of users (e.g., “vegetarian” or “Apple fanboy”) inferred by modeling the interplay between a user’s behavior and self-reported identity. Specifically, we consider the microblogging site Twitter, where users provide short descriptions of themselves in their profiles, as well as perform actions such as tweeting and retweeting. Our approach is based on the insight that we can define badges using high precision, low recall rules (e.g., “Twitter profile contains the phrase ‘Apple fanboy”’), and with enough data, generalize to other users by observing shared behavior. We develop a fully Bayesian, generative model that describes this interaction, while allowing us to avoid the pitfalls associated with having positive-only data. Experiments on real Twitter data demonstrate the effectiveness of our model at capturing rich and interpretable user traits that can be used to provide transparency for personalization.

@inproceedings{elarini2012transparent,
abstract = {Personalization is a ubiquitous phenomenon in our daily online experience. While such technology is critical for helping us combat the overload of information we face, in many cases, we may not even realize that our results are being tailored to our personal tastes and preferences. Worse yet, when such a system makes a mistake, we have little recourse to correct it. In this work, we propose a framework for addressing this problem by developing a new user-interpretable feature set upon which to base personalized recommendations. These features, which we call badges, represent fundamental traits of users (e.g., “vegetarian” or “Apple fanboy”) inferred by modeling the interplay between a user’s behavior and self-reported identity. Specifically, we consider the microblogging site Twitter, where users provide short descriptions of themselves in their profiles, as well as perform actions such as tweeting and retweeting. Our approach is based on the insight that we can define badges using high precision, low recall rules (e.g., “Twitter profile contains the phrase ‘Apple fanboy”’), and with enough data, generalize to other users by observing shared behavior. We develop a fully Bayesian, generative model that describes this interaction, while allowing us to avoid the pitfalls associated with having positive-only data. Experiments on real Twitter data demonstrate the effectiveness of our model at capturing rich and interpretable user traits that can be used to provide transparency for personalization.},
author = {El-Arini, Khalid and Paquet, Ulrich and Herbrich, Ralf and Van Gael, Jurgen and Ag{\"u}era y Arcas, Blaise},
booktitle = {Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},
pages = {678--686},
title = {Transparent User Models for Personalization},
url = {https://www.herbrich.me/papers/kdd2012-personalization.pdf},
organization = {ACM},
year = {2012}
}

## Collaborative Expert Portfolio Management

We consider the task of assigning experts from a portfolio of specialists in order to solve a set of tasks by combining collaborative filtering with a feature-based description of tasks and experts to yield a general framework for managing a portfolio of experts. The model learns an embedding of tasks and problems into a latent space in which affinity is measured by the inner product. The model can be trained incrementally and can track non-stationary data, tracking potentially changing expert and task characteristics. The approach allows us to use a principled decision theoretic framework for expert selection and recommendation, allowing the user to choose a utility function that best suits their objectives. We apply the model to manage a portfolio of algorithms to solve hard combinatorial problems. This is a well studied area and we demonstrate a large improvement on the state of the art in one domain (constraint solving) and in a second domain (combinatorial auctions) created a portfolio that performed significantly better than any single algorithm.

• D. Stern, H. Samulowitz, R. Herbrich, T. Graepel, L. Pulina, and A. Tacchella, „Collaborative Expert Portfolio Management,“ in Proceedings of the 24th AAAI Conference on Artificial Intelligence, 2010.
@inproceedings{stern2010collaborativeexperts,
}


text:
# How do you differentiate f(x)=cos(tanx) using the chain rule?

Oct 29, 2015

$\frac{d}{\mathrm{dx}} \left(\cos u\right) = - \sin u \frac{d}{\mathrm{dx}} \left(u\right)$
$f ' \left(x\right) = - \sin \left(\tan x\right) \frac{d}{\mathrm{dx}} \left(\tan x\right)$
$= - \sin \left(\tan x\right) {\sec}^{2} x$


text:
### UE版本号的宏定义

• ENGINE_MAJOR_VERSION
• ENGINE_MINOR_VERSION
• ENGINE_PATCH_VERSION

### UE蓝图的循环迭代最大计数

UE蓝图里面的循环上限是需要在ProjectSetting-Engine-Blueprints里设置(默认是1000000)：

### UE Actor Replication Config

#### Replication

OnlyRelecantToServer(default false)
if true,this actor is only relevant its owner,if this flag is changed during play,all non-owner channels would need to be explicitly close.

#### Always Relevant(default false)

Always relevant for network(overrides bOnlyRelevantToOwner)

#### ReplicateMovement(default true)

if true,replicate movement/location related properties.
Actor must also be set to replicate.

1. see SetReplicates()
2. see https://doc.unrealengine.com/latest/INT/Gameplay/Networking/Replication/

#### NetUseOwnerReplovancy(default false)

If actor has valid Owner, call Owner's IsNetRelevantFor and GetNetPriovity

#### Replicates(default true)

if true,this actor will replicate to remote machines
see SetReplicates()

#### NetDormancy(default DORM_Awake)

Dormancy setting for actor ro take itself off the replication list without being destory on clients.

#### NeuCullDistanceSquared(default 225000000.0)

Suqare of the max distance from the client's viewpoint that this actor is relevant and will be replicated.

#### NetUpdateFrequency(default 100.0)

how often(per second) this actor will be considered for replication,used to determine NetUpdateTime.

#### MinNetUpdateFrequency(default 2.0)

Used to determine what rate to throttle down to when replicated properties are changing infrequently.

#### NetPriority: (default 3.0)

Priority for this actor when checking for replication in a low bandwidth or saturated siuation,higher priority means it is more likely to replicate.

#### Replicated Movement

LocationQuantization Level: (default EVectorQuantization::RoundTwoDecimals)

VelocityQuantization Level: (default ERotatorQuantization::RoundWholeNumber)

#### RotationQuantization Level(default ByteComponents)

Allow turing the compression level for replicated rotation.You should only need to change this from the default if you see visual artfacts.

### UE Package Error: noexcept

*.target.cs中添加：

### UE Log macro defined

UE源码中的一些Log定义：
EngineLogs.h中定义了这些Log:

CoreGlobals.h中定义了下面这些Log:

### UE创建StandaloneApplication

1. move $ProgramName Folder to Engine\Source\Programs (version of source code) 2. run GenerateProgramProject.bat 3. OpenProgramProject.bat 用起来相当酸爽。 注意 *.target.cs中的配置会影响UBT生成的一些宏定义，比如： • bBuildWithEditorOnlyData控制的是WITH_EDITORONLY_DATA • bCompileAgainstEngine控制的是WITH_ENGINE 开发Program类型的程序时需要注意这些配置。可以在UnrealBuildSystem/Targets查看*.target.cs支持的全部参数。 UBT的代码里解析*.Target.cs里的配置在Programs\UnrealBuildTools\Configuration\URBuildTarget.csSetupGlobalEnvironment函数。 ### C语言中聚合结构的初始化 C语言的聚合结构还有这种方式的初始化： 这是因为inielizer的designator可以是[constant-expression].identifier. PS:sizeof(w) == ?是个有趣的问题。 详情请看[ISO/IEC 9899:1999 §6.7.8]. ### 通过函数指针进行函数调用不可以使用默认参数 如题： 先来看一下函数的默认参数是在何时被填充上去的，老样子还是看LLVM-IR代码： 其main函数的LLVM-IR代码为: 可以看到在编译时通过代码分析直接把省略掉的参数用默认值给补上了。 函数指针只具有函数的地址值，不包含任何的实参信息，也就不能在函数指针的访问里使用默认参数咯。 注：成员函数指针也同理。 ### unspecified behavior behavior, for a well-formed program construct and correct data, that depends on the implementation.[ Note: The implementation is not required to document which behavior occurs. The range of possible behaviors is usually delineated by this International Standard. — end note ] ### well-formed program [ISO/IEC 14882:2014 §1.3.26]C++ program constructed according to the syntax rules, diagnosable semantic rules, and the One Definition Rule (3.2). ### Implementation-Define(实现定义行为) [ISO/IEC 14882:2014]behavior, for a well-formed program construct and correct data, that depends on the implementation and that each implementation documents ### UB(未定义行为) [ISO/IEC 14882:2014 §1.9.4]This International Standard imposes no requirements on the behavior of programs that contain undefined behavior. [ISO/IEC 14882:2014 §1.3.24]behavior for which this International Standard imposes no requirements [ Note: Undefined behavior may be expected when this International Standard omits any explicit definition of behavior or when a program uses an erroneous construct or erroneous data. Permissible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message). Many erroneous program constructs do not engender undefined behavior; they are required to be diagnosed. — end note ] 这意味着具有UB的程序的行为不可预测，什么情况都有可能发生。 ### 解决Windows在英文语言下中文字体太丑的问题 因为在中文语言下我替换了雅黑的字体，看起来不那么虚，但是当我把系统语言切换为English后发现中文的字体都很虚啊。 查了一些如何在英文语言下替换中文字体的方法，记录一下。 在英文版Windows中默认字体一般都是Segoe UI、Tahoma、Microsoft Sans Serif之类，这些字体都是没有中文字库的，所以当需要显示中文字体的时候，就会出现各种难看的文字效果。 解决方法是使用“字体链接（FontLink）”技术：就是在使用英文字体时，如果遇到这种字体中没有的字符，就会到注册表相应的位置去找它链接的字体。 英文版Win7的默认字体是Segoe UI,这是个纯英文字体。所以要显示中文的时候它就会去找它链接的字体。 打开注册表地址： 这里面就是各个字体的链接字体的信息。 在这个键值下会发现Segoe UI，Tahoma这些常用英文字体的链接，查看Segoe UI的值，它的第一行为Tahoma.TTF，意思就是遇到中文时，它默认到Tahoma.TTF文件里去找，如果没有发现这个字，再到第二行的字体里去找。 双击编辑Segoe UI的项，可以看到雅黑的链接顺序在中间的位置，我们要做的就是把雅黑的顺序提到最前面： 替换后： 然后重启即可。 以防原链接失效，上面的部分内容摘录自后面的文章，作为本站的备份用。想要了解更具体内容可看这篇文章：解决英文版Windows中中文字体难看的问题 ### 关于注入类名字(injected-class-name)的问题 首先要先了解一下什么叫做注入类名字(injected-class-name): [ISO/IEC 14882:2014(E) §9.0.2]The class-name is also inserted into the scope of the class itself; this is known as the injected-class-name. For purposes of access checking, the injected-class-name is treated as if it were a public member name. 意思就是类的名字被嵌入到类的作用域中，为了访问检查的目的，注入类名称被视为public成员(注意这一句)。 其实对注入类名字的声明类似于下面这样： 在类内的名字查找是先从当前作用域开始的，注入类名字被在继承层次中看的更明显一些： 如上面的代码所示，可以使用B::A来限定B继承层次的类型A. 上面描述的内容中写到，注入类名字被视为public成员，但是如果我们在继承层次中把基类标记为了private，会怎样？ 编译一下代码看一下： 那我们使用B::A或者C::A呢？同样也会具有一样的错误。 因为在派生类中对基类名字的名字查找(name lookup)找到的是注入类名字(injected-class-name)： [ISO/IEC 14882:2014(E) §11.1.5]In a derived class, the lookup of a base class name will find the injected-class-name instead of the name of the base class in the scope in which it was declared. 要解决这样的问题，要限定名字空间(上面的例子要改为::A)： 注意，在namespace的scope内一定要注意默认的名字查找(name-lookup)是有namespace限定的。 ### 一个要抠字眼的C++问题 问：派生类的对象对他的基类成员中()是可以访问的？ A) 公有继承的公有成员 B) 公有继承的私有成员 C) 公有继承的保护成员 D) 私有继承的公有成员 乍一看，继承层次下的派生类使用public/protected/private都可以访问基类的public/private成员啊，貌似ACD都对。 但是，注意问题里写的是对象，对象只能够访问类的public成员，所以我在问题里加粗了:)。 ### reintrtpret_cast的转换(位模式的转换) #### 指针到整型的转换 指针能够显式转换为任何足够容纳它的整型，但是映射函数是实现定义(implementation-define)的。 类型std::nullptr_t的值能够转换到整型，该转换与转换(void*)0到整型具有相同的意义与合法性。 reinterpret_cast不能用在转换任何类型的值到std::nullptr_t. [ISO/IEC 14882:2014 §5.2.10.4]A pointer can be explicitly converted to any integral type large enough to hold it. The mapping function is implementation-defined. [ Note: It is intended to be unsurprising to those who know the addressing structure of the underlying machine. — end note ] A value of type std::nullptr_t can be converted to an integral type; the conversion has the same meaning and validity as a conversion of (void*)0 to the integral type. [ Note: A reinterpret_cast cannot be used to convert a value of any type to the type std::nullptr_t. — end note ] #### 整型到指针的转换 整型或枚举类型能够显式转换到指针。指针转换到足够大小的整型并且再转换会相同的指针类型，它将会具有源指针值。 这意味着该转换不具有未定义行为(指针与整型之间映射在其他方面是实现定义的)： [ISO/IEC 14882:2014 §5.2.10.5]A value of integral type or enumeration type can be explicitly converted to a pointer. A pointer converted to an integer of sufficient size (if any such exists on the implementation) and back to the same pointer type will have its original value; mappings between pointers and integers are otherwise implementation-defined. [ Note: Except as described in 3.7.4.3, the result of such a conversion will not be a safely-derived pointer value. — end note ] #### 函数指针的转换 函数指针能够显示转换到不同类型的函数指针，调用转换后的函数类型的效果与函数定义中的函数不同。 除非转换类型pointer to T1pointer to T2(T1和T2是函数类型)，并且转换回它的源类型产生源指针值，这样的指针转换的结果是未指定的(unspecified). [ISO/IEC 14882:2014 §5.2.10.6]A function pointer can be explicitly converted to a function pointer of a diﬀerent type. The eﬀect of calling a function through a pointer to a function type (8.3.5) that is not the same as the type used in the definition of the function is undefined. Except that converting a prvalue of type “pointer to T1” to the type “pointer to T2” (where T1 and T2 are function types) and back to its original type yields the original pointer value, the result of such a pointer conversion is unspecified. [ Note: see also 4.10 for more details of pointer conversions. — end note ] ### 修改Android的DNS 编辑/system/build.prop加入以下几行： 保存退出即可(最好重启或者开关一下飞行模式。 ### tracert命令 路由跟踪，查看数据包访问目标所选择的路径。 Tracert 命令使用用 IP 生存时间 (TTL) 字段和 ICMP 错误消息来确定从一个主机到网络上其他主机的路由. ### offsetof不能用在非POD类型(Standard Layout) offsetof是定义在stddef.h/cstddef中的一个宏，其作用是获取结构成员在结构上的偏移。 但是它不能够用在非Standard Layout Class的类型上，否则是undefine behavior的： [ISO/IEC 14882:2014 §18.2.4]:The macro offsetof(type, member-designator) accepts a restricted set of type arguments in this International Standard. If type is not a standard-layout class (Clause 9), the results are undefined.The expression offsetof(type, member-designator) is never type-dependent (14.6.2.2) and it is value-dependent (14.6.2.3) if and only if type is dependent. The result of applying the offsetof macro to a field that is a static data member or a function member is undefined. No operation invoked by the offsetof macro shall throw an exception and noexcept(offsetof(type, member-designator)) shall be true. Note that offsetof is required to work as specified even if unary operator& is overloaded for any of the types involved. 顺便再来复习一下什么叫Standard Layout types [ISO/IEC 14882:2014 §3.9.9]:Scalar types, standard-layout class types (Clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called standard-layout types. Standard Layout Class则又是： A standard-layout class is a class that: • has no non-static data members of type non-standard-layout class (or array of such types) or reference, • has no virtual functions (10.3) and no virtual base classes (10.1), • has the same access control (Clause 11) for all non-static data members, • has no non-standard-layout base classes, • either has no non-static data members in the most derived class and at most one base class with non-static data members, or has no base classes with non-static data members, and • has no base classes of the same type as the first non-static data member. 即，在类中有这些的都是非标准布局类，offsetof不能用在他们上面。 ### C++中的Standard Layout types 顺便再来复习一下什么叫Standard Layout types [ISO/IEC 14882:2014 §3.9.9]:Scalar types, standard-layout class types (Clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called standard-layout types. Standard Layout Class则又是： A standard-layout class is a class that: • has no non-static data members of type non-standard-layout class (or array of such types) or reference, • has no virtual functions (10.3) and no virtual base classes (10.1), • has the same access control (Clause 11) for all non-static data members, • has no non-standard-layout base classes, • either has no non-static data members in the most derived class and at most one base class with non-static data members, or has no base classes with non-static data members, and • has no base classes of the same type as the first non-static data member. ### 禁用MIUI的更新提示 ROOT手机，安装RE文件管理器。 打开RE，找到路径/system下打开build.prop编辑： 修改为一个大的版本号： 保存后重启即可。 ### 在基类子对象内对this指针做放置new操作 这么做是UB的，直接看标准里的代码吧([ISO/IEC 14882:2014 §3.8.5])： this的生命周期的终结时机为调用析构函数之后，调用析构函数则意味着该类内的所有数据均变成了无意义的存在，对无意义的东西做操作是UB行为。 ### MinGW-W64编译32位程序 GCC支持-m32参数来将代码编译到32位程序。但是如果你的MinGW是SEH或者DWARF的异常模型，则他们是单一平台的，不支持编译到32位程序。 stackoverflow上有个回答：How do I compile and link a 32-bit Windows executable using mingw-w64 还有CSDN上的一个问题：MinGW-w64如何编译32位程序 解决办法：可以选择SJLJ的异常模型版本，可以从这里检索下载。也可以使用TDM GCC(目前只更新到了MinGW5.1.0)。 ### C语言的隐式函数声明 下面的代码： 使用gcc编译，是会编译成功并且可以执行的(具有警告)： 那么问题来了，我在当前的编译单元内并没有包含printf的声明，怎么就可以编译通过呢？ 因为C语言的历史上支持过implicit function declaration(C89支持函数的隐式声明): [ISO/IEC 9899:1990 6.3.2.2] If the expression that precedes the parenthesized argument list in a function call consists solely of an identifier. and if no declaration is visible for this identifier, the identifier is implicitly declared exactly as if. in the innermost block containing the function call. the declaration 然而这个特性 C99 就废除掉了： [ISO/IEC 9899:1999 Foreword] remove implicit function declaration 上面的代码相当于： 1. 编译器隐式声明了printf函数 2. 链接器默认链接了stdlib，所以才不会产生符号未定义的链接错误 在gcc编译器如果不想要默认链接可以使用链接器参数(这里只列出其中的三个)： • -nodefaultlibs: 不使用标准系统库，只有编译参数中指定的库才会传递给链接器 • -nostdlib: Do not use the standard system startup files or libraries when linking. • -nolibc: Do not use the C library or system libraries tightly coupled with it when linking. 更多的gcc链接参数可以看这里：3.14 Options for Linking ### 虚函数表的存储位置及初始化 注意：C++的多态是实现定义的，所以不同的编译器实现方式或许都不一样，这里只是分析其中的一种(Clang)实现方法，下文中的所有编译命令均使用Clang7.0.0。 C++的多态是通过虚函数表来实现的，但是之前有几个问题不太明白： 1. 虚表指针是如何初始化的？ 2. 虚函数表是每个实例都有一份吗？ 3. 在基类的构造函数内调用虚函数会有多态行为吗？ 带着上面的几个问题，来看下面这个简单的例子: 先来看一下这个类的内存布局(我使用的是Clang(x64)): 可以看到，类A的sizeof为32，因为其尾部内存对齐了4字节。 然后我们来将其编译为汇编代码，我使用的编译器版本是Clang7.0.0： 找到类A和B的构造函数： 可以看到，类A和类B的虚函数表都是存放在_ZTV1B/_ZTV1A，其中存储的为虚函数的函数指针，在.data区的，所以全局只有一份。而且他们的布局为： 类的构造函数会从.data区得到虚函数表的地址，并赋值给该实例的vptr，需要注意的是，虚函数表的结构中具有this的偏移(第一个元素)和类的类型信息。 在赋值给实例的vptr时做了偏移： 这里是跳过了虚表结构的前两个元素，直接指向了第一个存储虚函数的地址的指针。 而且，更需要说明的是，在B类的构造过程中，会调用A的构造函数，这时B构造函数内的vptr操作还并未执行，所以如果在类A内调用虚函数，则不会有多态行为——因为在此时类实例的vptr指向的是A的虚函数表。 ### Guide to x86-64 Guide to x86-64 ### 增强扫描版pdf • 首先下载ImageMagick并安装，注意勾选Install legacy components (convert.exe etc) • 然后安装Ghostscript(目的是为了使用convert命令)。 • 将pdf转为图片 假设原始文件名是origin.pdf, 目标文件名是target.pdf, 下方的convert应替换为实际路径 上方的density参数指像素密度,数字越高图片质量越高体积越大, 如果pdf带文字,就设置300以上吧. 这是影响最终效果的重要参数, 如果过低, 那么下方再神操作效果也不会很好, 过高会导致文件体积过大该指令将整个pdf按页转为多张图片, %03d.jpg表示命名为001.jpg,002.jpg....(超过1000页就应改为%04d.jpg)转换为图片这一步, 是为了获取中间产物进行测试和调整, 通常只需截取一部分页面即可(因为截取一页需要花费数秒时间) • 测试转换效果 上方的level参数是指调整图像通道的级别, 60,97%表示灰度低于60%即为黑点, 高于97%为白点. 这里的60,97需要反复调节到自己认为达到最佳效果, 这是整个过程中最重要的参数, 通过该参数实现调整对比度quality指输出jpg文件质量(压缩比), 1-100数字越高质量越高体积越大, 出于减少pdf文件大小的考虑, 应适当调节该参数(举个例子density 400的jpg文件可能有1.4M, 压缩后为700K, 这样最终的pdf文件大小相差一倍, 而肉眼无法察觉页面效果有何区别) • 转为pdf 确定了density, level和quality的值之后就可以执行转换了可以从原始pdf转换 也可以从之前生成的jpg转换： 如果直接从目录转换为pdf打开显示有问题，可以将导出的文件批量处理之后再使用福昕之类的软件合并： 把当前目录下所有的.jpg增强处理之后另存为*.jpg_.jpg. 然后把它们移动到单独的目录(-I {}的作用是把后续的{}替换为参数)： 然后使用福昕合并成pdf文件即可(顺便也可以做OCR)。 ### 虚函数表是在何时初始化的？ 突然有个疑问，虚函数表是什么时候放进类实例内的？ 写了个简单的代码，从LLVM-IR分析一下： 再来看一下对象布局和内存对齐： 可以看到，在Clang的实现中，vptr是在对象空间的首部，是一个32位指针大小。 上面的C++代码相关的LLVM-IR代码为： 可以看到，是从构造函数里面对vptr执行初始化的... ### Clang查看对象的内存布局 clang可以在编译时使用-cc1 -fdump-record-layouts参数来查看对象的内存布局。 但是使用上面的命令不会从Path路径查找标准头文件，我们需要先对源文件进行预处理： 然后对预处理之后的.cpp文件执行编译时加入-cc1 -fdump-record-layouts参数: Example: 预处理： 查看上面三个类的内存布局： ### 虚函数的默认参数根据调用者(指针或引用)的静态类型决定 之前曾经在C/C++标准的一些摘录#override函数不会覆盖其原有默认参数中曾经写道过这点内容，但是不够详细，这里做一个补充。 考虑以下代码： C++标准中规定了关于虚函数的默认参数使用描述： [ISO/IEC 14882:2014]A virtual function call (10.3) uses the default arguments in the declaration of the virtual function determined by the static type of the pointer or reference denoting the object. 即，虚函数的默认参数的使用是执行该虚函数调用的指针或引用的静态类型的决定的。 从上面的例子来看： 即多态函数的默认参数并不是动态绑定的，并不会在运行时才确定使用继承层次中的哪一个实现的默认参数，而是编译时根据对象的类型就确定了使用哪个默认参数。 可以看一下上面代码的LLVM-IR代码： ### Windwos上使用MinGW编译LLVM 首先，下载LLVMClang源码，并解压。 将Clang的源码(cfe-6.0.1.src)目录改名clang后放到LLVM源码的tools目录下($LLVM_SRC_ROOT/tools/clang)。

• 2018.09.27 这几天LLVM出了7.0.0版本，果然是版本帝。我又编译了一个7.0.0版本的，编译环境与上文相同：点此下载

### UE4接入SteamSDK

\quad1ememm代表当前字体下接近字符‘M’的宽度(approximately the width of an "M" in the current font).

#### 分隔符

$$declaration\textrm{-}specifiers_{opt}$$

### What is Translation Unit in C/C++?

[ISO/IEC 14882:2014]A source file together with all the headers (17.6.1.2) and source files included (16.2) via the preprocessing directive #include, less any source lines skipped by any of the conditional inclusion (16.1) preprocessing directives, is called a translation unit. [ Note: A C ++ program need not all be translated at the same time. — end note ]

[ISO/IEC 9899:1999]
A source file together with all the headers and source files included via the preprocessing directive #include is known as a preprocessing translation unit. After preprocessing, a preprocessing translation unit is called a translation unit.

### 一些cmd命令技巧

cmd命令里是让他们同时执行几个命令：

cmd/c的意思为执行完命令后关闭命令窗口；如果想要执行完不关闭可以使用/k

cmd中让命令在后台执行不会阻塞后续命令的方式(类似于linux命令后加&)：

start加入/b，这两条命令就不会阻塞(不会等到第一条命令执行完毕之后再执行第二条)。

.bat后台执行，有些.bat我们希望开机启动，这时候开机弹出黑框框就不太好，可以使用下面的.vbs脚本来执行.bat

### sendfile的优势

Unix system call interface:sendfile

transfer data between file descriptors

### new、构造函数和异常

new操作实际上是由两个部分组成的：

1. 首先调用operator new分配内存
2. 调用对象的构造函数

Evaluation of a new expression invokes one or more allocation and constructor functions; see 5.3.4

### C++中常见术语错误

WrongRight
Pure virtual base classAbstract class
MethodMember function
Virtual method???
DestructedDestroyed
Cast operatorConversion operator

### 为什么要有引用？

1. 防止对象拷贝带来的开销(比指针的间接访问要更简洁)
2. 对于IO流的使用(比如cout<<x<<y返回流的引用等价于使用cout<<x,cout<<y)

### 并发和并行(concurrency and parallel)

A logical flow whose execution overlaps in time with another flow is called a concurrent flow, and the two flows are said to run concurrently. More precisely, flows X and Y are concurrent with respect to each other if and only if X begins after Y begins and before Y finishes, or Y begins after X begins and before X finishes. For example, in Figure 8.12, processes A and B run concurrently, as do A and C. On the other hand, B and C do not run concurrently, because the last instruction of B executes before the first instruction of C.
The general phenomenon of multiple flows executing concurrently is known as concurrency. The notion of a process taking turns with other processes is also known as multitasking. Each time period that a process executes a portion of its flow is called a time slice. Thus, multitasking is also referred to as time slicing. For example, in Figure 8.12, the flow for Process A consists of two time slices.
Notice that the idea of concurrent flows is independent of the number of processor cores or computers that the flows are running on. If two flows overlap in time, then they are concurrent, even if they are running on the same processor. However, we will sometimes find it useful to identify a proper subset of concurrent flows known as parallel flows. If two flows are running concurrently on different processor cores or computers, then we say that they are parallel flows, that they are running in parallel, and have parallel execution.

### C++一些语言特性被设计的原因

• 名字空间就是针对不同库里使用相同的名字而提供的机制
• 异常处理是为建立一种处理错误的公共模型提供了基础
• 模板是为定义独立于具体类型的容器类和算法而提供的一种机制，其中的具体类型可以由用户或者其他的库提供
• 构造函数和析构函数为对象的初始化和最后清理提供了一种公共模型
• 抽象类提供了一种机制，借助于它可以独立地定义接口，与实际被接口的类无关
• 运行时类型信息是为了寻回类型信息而提供的一种机制，因为当对象被传递给一个库再传递回来的时候，可能只携带着不够特殊(基类的)类型信息。

### 为什么socket的IP地址是一个结构？

The <netinet/in.h> header shall define the in_addr structure, which shall include at least the following member:

in_addr_t Equivalent to the type uint32_t as described in <inttypes.h>.

[CSAPP,2e]把一个标量地址存放在结构中，是socket接口早起实现的不幸产物。为IP地址定义一个标量类型应该更有意义，但是现在更改已经太迟了，因为已经有大量应用基于此了。

### TCP/IP协议族

TCP/IP的协议族是一组不同的协议组合在一起构成的协议族(应用层协议(FTP/Telnet等)、运输层(TCP/UDP)、网络层(IP/ICMP/IGMP)、链路层(设备驱动程序及网络接口设备))。尽管通常称该协议族为TCP/IP，但TCP和IP只是其中的两种协议而已。

### POSIX data types

[IEEE Std 1003.1™ 2008]The implementation shall support one or more programming environments in which the widths of blksize_t, pid_t, size_t, ssize_t, and suseconds_t are no greater than the width of type long.


text:
### Special sequences

Special sequences 1. Square numbers 2. Cube numbers 3. Triangular numbers 4. Fibonacci numbers Square numbers A square number is the product of multiplying a whole number by itself. Square numbers can be represented using dots arranged to make squares. The general formula of sequences: $displaystyle {{T}_{n}}={{n}^{2}}$ Square numbers form the (infinite) sequence: 1,4,9,16,25,36,……….. Square numbers may be […]

### Sequences

Powers and Roots An expression that represents repeated multiplication of the same factor is called a power. So, when we want to multiply a number by itself repeatedly we use powers. $displaystyle {{a}^{n}}$ tells  you  to multiply  a  by itself, exactly n-times. The exponent corresponds to the number of times the base is used as […]


text:
# How do you prove sec^4(x)-csc^2(x)=tan^2(x)-cot^2(x)?

Oct 25, 2015

See explanation.

#### Explanation:

Are you sure you didn't mean ${\sec}^{2} x - {\csc}^{2} x = {\tan}^{2} x - {\cot}^{2} x$? I don't think the data you provided is an identity. Anyway, if you meant ${\sec}^{2} x$, here it is:

$\left[1\right] \text{ } {\sec}^{2} x - {\csc}^{2} x$

Pythagorean Identity: ${\sec}^{2} \alpha = 1 + {\tan}^{2} \alpha$

$\left[2\right] \text{ } \equiv \left(1 + {\tan}^{2} x\right) - {\csc}^{2} x$

Pythagorean Identity: ${\csc}^{2} \alpha = 1 + {\cot}^{2} \alpha$

$\left[3\right] \text{ } \equiv \left(1 + {\tan}^{2} x\right) - \left(1 + {\cot}^{2} x\right)$

$\left[4\right] \text{ } = 1 + {\tan}^{2} x - 1 - {\cot}^{2} x$

$\left[5\right] \text{ } = {\tan}^{2} x - {\cot}^{2} x$

$\textcolor{b l u e}{\therefore {\sec}^{2} x - {\csc}^{2} x = {\tan}^{2} x - {\cot}^{2} x}$


text:
## Improving Sales Diversity by Recommending Users to Items

RecSys 2014 Silicon Valley

## Sales Diversity, Novelty and Popularity Bias

### The Long Tail

A few of the most popular items concentrate high sales volumes, while the rest -the long tail- have moderate ones

Promoting sales in the long tail has benefits:

• For the business: make the most of the catalog, niche markets $\rightarrow$ Sales diversity
• For the user: less obvious, unexpected recommendations $\rightarrow$ Novelty

Personalized recommendations could help us promote items in the Long Tail

but...

### The Harry Potter Effect

Personalized recommendations have a bias towards recommending popular items

It has a negative effect in terms of novelty and sales diversity

This research aims at alleviating this popularity bias

## Recommending Users to Items

### Idea

We transpose the recommendation task by selecting which users each item should be recommended to, instead of the other way around

We ignore initially the popularity bias of the items, focusing on the users the item should be recommended to

We consider two approaches: inverted neighborhoods and a probabilistic reformulation layer

### Formulation

rating matrix $\mathcal{R}$

$s: \mathcal{U} \times \mathcal{I} \rightarrow \mathbb{R}$ $R_u \in \mathcal{I} \times \mathcal{I} \times \ldots$

rating matrix $\tilde{\mathcal{R}} = \mathcal{R}^t$

$\tilde{s}: \mathcal{I} \times \mathcal{U} \rightarrow \mathbb{R}$ $\tilde{R}_i \in \mathcal{U} \times \mathcal{U} \times \ldots$

Some recommendation algorithms are symmetric: the transposed task is fully equivalent to the original task

Example: implicit matrix factorization

$\tilde{s}_{iMF}(i, u) = q_i \, p_u^t = p_u \, q_i^t = s_{iMF}(u, i)$

For other algorithms swapping the role of users and items is not indifferent and results in a new scoring function

This is the case of the nearest neighbors algorithms

## Inverted Nearest Neighbors

Standard $K$-nearest neighbors recommendation

\begin{align} s_{UB}(u, i) &= \sum_{v \in \mathcal{U}} \mathbf{1}_{v \in N_K(u)} \; sim(u, v) \; r_{v,i} \\ s_{IB}(u, i) &= \sum_{j \in \mathcal{I}_u} \mathbf{1}_{i \in N_K(j)} \; sim(i, j) \; r_{u,j} \end{align}

Inverted $K$-nearest neighbors recommendation

\begin{align} \tilde{s}_{UB}(i, u) &= \sum_{j \in \mathcal{I}} \mathbf{1}_{j \in N_K(i)} \; sim(i, j) \; \tilde{r}_{j,u} \\ \tilde{s}_{IB}(i, u) &= \sum_{v \in \mathcal{U}_i} \mathbf{1}_{u \in N_K(v)} \; sim(u, v) \; \tilde{r}_{i, v} \end{align}

### Inverted Neighborhoods

$\mathbf{1}_{v \in N_K(u)} \rightarrow$ Use the preferences of my neighbors

$\mathbf{1}_{u \in N_K(v)} \rightarrow$ Use the preferences of the users
I am a neighbor of

The inverted criterion can be reformulated as $\mathbf{1}_{u \in N_K(v)} = \mathbf{1}_{v \in N^{-1}_K(u)} \rightarrow$

where $N^{-1}_K(u) = \left\lbrace v \in \mathcal{U} \;:\; u \in N_K(v) \right\rbrace$ is
the inverted neighborhood of $u$

### Properties and Consecuences

Properties

• Variable neighborhood size
• All users/items will appear in the same number of neighborhoods ($K$)

Consequences

• User-based: flattens the influence power of users
• Item-based: more chances to rare items to be recommended

### Neighborhood Biases

An analysis of the neighborhoods of Netflix Prize data and Million Song dataset shows

• Neighborhood concentration: a few users/items appear in many neighborhoods
• Popularity bias: in the item-based algorithm, neighborhoods are composed of very popular items

The inverted neighborhoods eliminate these biases

## Probabilistic Reformulation Layer

Probabilistic interpretation $p(i\,|\,u)$

Inverted recommendation $p(u\,|\,i)$

We take the scoring function $s(u,i)$
as a good estimator of the probability $p(u, i)$ $p(u\,|\,i;s) \sim \frac{s(u, i)}{\sum_v s(v, i)}$

What about $p(i\,|\,u)$?

Bayes' rule $p(i\,|\,u;s) = \frac{p(u\,|\,i;s)\;p(i;s)}{\sum_j p(u\,|\,j;s)\;p(j;s)}$

Estimating the item prior $p(i;s) \sim \frac{\sum_u s(u,i)}{\sum_j \sum_u s(u,j)}$

The item prior captures the popularity

Idea: smooth the prior by means of an entropic regularization $p(i;s, \alpha) \sim \frac{\left(\sum_u s(u,i)\right)^{1 - \alpha}}{\sum_j \left(\sum_u s(u,j)\right)^{1 - \alpha}}$

$\alpha$ controls the smoothing applied

\begin{align} \alpha = 0 & \Rightarrow p(i; s, \alpha) = p(i; s) \\ \alpha = 1 & \Rightarrow p(i; s, \alpha) = \frac{1}{|\mathcal{I}|} \end{align}

Resulting scoring schema $s_{BR}(u, i) = s(u, i) \left(\sum_v s(v, i)\right)^{-\alpha}$

## Experiments

### Setup

#### Two datasets

ratings users items
Netflix 100M 480K 18K
MSD 48M 1.1M 380K

#### Metrics

• Accuracy: precision
• Novelty: EPC (Vargas and Castells 2011)
• Sales diversity: Gini Index (complement)
• All metrics evaluated at cutoff 10
• Higher is better

### Experiment 1

Comparing inverted neighborhoods with standard neighborhoods for different neighborhood sizes

### Experiment 2

Comparing the probabilistic reformulation with a direct novelty optimization $s_{NR}$

$s_{NR}(u, i) = (1 - \lambda)\; s(u, i) + \lambda \; nov(i)$

## Conclusions

• We address the popularity bias in recommendations by recommending users to items
• A first method inverts the role of users and items for nearest neighbors
• A second method develops a probabilistic interpretation to isolate and then smooth the popularity bias
• Experiments on two datasets show the effectiveness of our approaches
• Inverted neighborhood: clear improvements over the standard neighborhoods in novelty and sales diversity
• Probabilistic reformulation: competitive against a direct optimization for novelty, outperforms in sales diversity


text:
# How to make the phone call in iOS 10 using Swift?

In this post we will learn how to load PDF in UIWebView.

Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “PDFInWebView”

Step 2 − Open Main.storyboard and add UIWebView as shown below

Step 3 − Create @IBOutlet for the UIWebView, name it webview.

Step 4 − Add as sample PDF project. We will load this PDF in webivew. I am adding a PDF file named sample PDF.

Step 5 − Add the following lines in viewDidLoad method of ViewController

if let pdf = Bundle.main.url(forResource: "sample", withExtension: "pdf", subdirectory: nil, localization: nil) {
let reqest = NSURLRequest(url: pdf)
}

In the above code we are first getting the URL to the sample pdf file, then loading that URL into the webview.

Step 6 − Run the project, you will see the PDF load in webview


text:
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I’m busy preparing slides for the Why R? conference using the brilliant {xaringan} package along with {xaringanthemer} to tweak the styles. There are plots rendered into the document as well as static images.

I wanted to publish the presentation using GitLab Pages. My first attempt left me with no styles or images, but after a few iterations I had something that works.

This is the contents of my .gitlab-ci.yml file:

image: rocker/verse:4.0.0

before_script:
- R -e "install.packages('xaringanthemer')"

pages:
stage: deploy
script:
- Rscript -e "rmarkdown::render('talk.Rmd', output_file = 'index.html')"
- mkdir public
- cp index.html xaringan-themer.css public/
- cp -r index_files/ fig/ public/
artifacts:
paths:
- public
only:
- master
interruptible: true

GitLab Pages expects the content to be found in the public/ folder. To ensure that the paths to images (static and rendered) are correct, I render the Rmd in the current folder and then copy everything across into public/.

Hopefully this will save you the 30 minutes it took me to figure this all out.


text:
Canadian Mathematical Society www.cms.math.ca
 location:  Publications → journals → CMB
Abstract view

# Modular Reduction in Abstract Polytopes

Published:2009-09-01
Printed: Sep 2009
• B. Monson
• Egon Schulte
 Format: HTML LaTeX MathJax PDF PostScript

## Abstract

The paper studies modular reduction techniques for abstract regular and chiral polytopes, with two purposes in mind:\ first, to survey the literature about modular reduction in polytopes; and second, to apply modular reduction, with moduli given by primes in $\mathbb{Z}[\tau]$ (with $\tau$ the golden ratio), to construct new regular $4$-polytopes of hyperbolic types $\{3,5,3\}$ and $\{5,3,5\}$ with automorphism groups given by finite orthogonal groups.
 Keywords: abstract polytopes, regular and chiral, Coxeter groups, modular reduction
 MSC Classifications: 51M20 - Polyhedra and polytopes; regular figures, division of spaces [See also 51F15] 20F55 - Reflection and Coxeter groups [See also 22E40, 51F15]

 top of page | contact us | privacy | site map |

© Canadian Mathematical Society, 2017 : https://cms.math.ca/


text:
# How do you write 0.4 as a fraction?

May 8, 2018

$0.4 = \frac{4}{10} = \frac{2}{5}$

#### Explanation:

The first decimal place after the point represents the place holder 'tenths'.

$0.4 = \frac{4}{10}$

This can simplify to $\frac{2}{5}$

May 8, 2018

$\frac{4}{10}$ or $\frac{2}{5}$

#### Explanation:

Dividing $4$ by $10$ (or $2$ by $5$) will yield $0.4$, meaning that all you have to do is write out the division problem as a fraction, like this.

$\frac{4}{10}$

Simplifying this fraction by dividing both the numerator and denominator by $2$ will yield the fraction $\frac{2}{5}$, which also equals $0.4$.


text:
Assuming that each nucleus is roughly spherical and that its mass is roughly equal to A (in atomic mass units u ), what is the density p of a nucleus with nucleon number A?

Express your answer in terms of A ,R0 , and theta

p=------------------u/m^3

### Get this answer with Chegg Study

Practice with similar questions
Q:
Assuming that each nucleus is roughly spherical and that its mass is roughly equal to (in atomic mass units ), what is the density of a nucleus with nucleon number ?


text:
# Find the equation for the line parallel to 3x + 2y = 6 that passes through the point (−4 1)

Find the equation for the line parallel to 3x + 2y = 6 that passes through the point (−4 1)

## This Post Has 4 Comments

1. Expert says:

6/9 i need more characters in my answer

2. Expert says:

70 years.

step-by-step explanation:

3. Expert says:

given : the shape of his satellite can be modeled by   where x and y are modeled in inches.

now,the given equation   is a equation of parabola.

here, coefficient of x is positive, hence the parabola opens rightwards.

on comparing this equation with standard equation , we get

in standard equation, coordinates of focus=(0,m)

thus for given equation coordinates of focus=(0,1.5)

step-by-step explanation:

4. Expert says:


text:
# Proving that the orthogonal subspace is invariant

Hi guys,

I couldnt fit it all into the title, so here's what I'm trying to do. Basically, I have a unitary representation $V$. There is a subspace of this, $W$, which is invariant if I act on it with any map $D(g)$. How do I prove that the orthogonal subspace $W^{\bot}$ is also an invariant subspace of $V$?

I know that an orthogonal matrix is one where its transpose is its own inverse, but I dont know how to apply that here. Can you guys help me out?

thanks!

## Answers and Replies

Related Calculus and Beyond Homework Help News on Phys.org
Office_Shredder
Staff Emeritus
Science Advisor
Gold Member
There's only one way that you can apply it really - you should start by writing out explicitly what it is you need to prove, and then use the fact that you have a unitary transformation.