text:
# Inequality

What are we doing about the growing levels of inequality?

 Random Link ¯\_(ツ)_/¯ Dec 13, 2019 » Third Base [Scott Galloway] 2 min; updated Sep 2, 2021 Third Base Not recognizing your blessings feeds into the dark side of capitalism and meritocracy: success is a choice, and that those who haven’t achieved success are not unlucky, but unworthy. I’m relatively lucky. I don’t know how much of the techie hubris that I bear. I have unresolved feelings about meritocracy and fairness. Race is usually used as a proxy for bridging the gap, e.g. affirmative action at colleges.... Apr 26, 2020 » Philanthropy 3 min; updated Sep 2, 2021 Criticism/Defense Of Billionaire Philanthropy Taxes will probably not go to the same causes, e.g. reforming the bail system, grassroot efforts for migrants, etc. Admittedly, these are things that the government should be doing, but it seems that the government doesn’t do enough. Furthermore, some of these issues so politicized, e.g. immigrants, that government support can be fickle. Foundations are more effective than governments as they do their due diligence, e.... Mar 3, 2021 » On the Dangers of Stochastic Parrots: Can Language Models Be Too Big? 🦜 3 min; updated Jul 15, 2021 The paper is written in a period when NLP practitioners are producing bigger (# of parameters; size of training data) language models (LMs), and pushing the top scores on benchmarks. Environmental Risks Large LMs consume a lot of resources, e.g. training a single BERT base model on GPUs was estimated to use as much energy as a trans-American flight. Marginalized communities are doubly punished. They are least likely to benefit from LMs, e.... Apr 3, 2018 » Pop Quiz: How Well Do You Know the World? 4 min; updated Mar 14, 2021 Quiz It’s hard to give pessimistic answers when the book’s title says “Things Are Better Than You Think”… In all low-income countries across the world today, how many girls finish primary school? 🔲 A: 20 percent ❌ B: 40 percent ✅ C: 60 percent There has been lots of efforts to get girls to finish primary school, e.g. providing sanitary towels. Surely, they must be at $$\ge 40%$$ completion rates....


text:
CKEditor and the MathJax Plugin

Recommended Posts

Hi guys!

Im currently trying to integrate the MathJax plugin (http://ckeditor.com/addon/mathjax) for CKEditor. But it doesnt work. Does any one use this plugin?

It is instaled correctly, is checked in the Field input, all requered plugins are installed, I dont get any JavaScript error but dont see any button.

Any suggestions?

Share on other sites

So solved it by myself! It was the name for the toolbar option.  It wasent mathjax and not MathJax its Mathjax.

Such a stupid mistake …

• 1
Share on other sites

I have not failed. I've just found 10,000 ways that won't work.

Thomas Edison

Share on other sites

• 2 years later...

@jensweigel
Could you or someone please list out the steps on how you were able to integrate Mathjax?
I am kind of new to Processwire and am working with Processwire 2.7 and ckeditor (module version 1.5.4)
Thanks!

Share on other sites

Upload the plugin folder under site/modules/IputfieldCKEditor/plugins, activate the plugin in the field configuration in PW (at the very bottom you will see a group of checkboxes that already includes the PW CKEditor plugins for image upload and links, you should see the uploaded plugin now). Check it.

As stated above, add the correct option in the toolbar configuration. and you should see it in the editor now.

• 2
Share on other sites

@jensweigel @elabx
I downloaded the mathjax plugin and also the other dependencies which included

clipboard,dialogui,lineutiles,notification and widget. When I go the group of checkboxes , I am able to see my field on my page as long as keep mathjax and widget plugins unchecked. As soon as i check them, there is a blank space in edit page option where the field is present. However, when I view the page, the data that had been entered (before I checked these plugins) is displayed (without the latex rendering).

I also tried the toolbar option(through PW GUI) of both Mathjax and mathjax, but it didn't work
Could it be because of the version? The CKeditor page states its for version 4.3+ and I have the Processeswire module version of 1.5.4
Is there any other alternative. Here is a snippet of my config file

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
config.extraPlugins = 'widget';
config.extraPlugins = 'lineutils';
config.extraPlugins = 'dialogui';
config.extraPlugins = 'dialog';
config.extraPlugins = 'clipboard';
config.extraPlugins = 'mathjax';
};

Share on other sites

FYI I  have added this plugin to AdminOnSteroids module and will be available in the next update. Works fine in the admin with the latest PW, on the frontend it needs manual initialization (of course).

Share on other sites

@tpr
I am looking for something on PW 2.7. It is going to be difficult for me to upgrade cause I have just been brought into this project and am new to PW itself

Share on other sites

Sorry, I missed that part, then it's not an option for you.

Share on other sites

• 2 months later...
On 2/14/2018 at 7:13 PM, tpr said:

FYI I  have added this plugin to AdminOnSteroids module and will be available in the next update. Works fine in the admin with the latest PW, on the frontend it needs manual initialization (of course).

Thanks for adding it! I have just added it today where I think the client could probably use it (instead of making images for each formula).

btw here is the link / instruction for the frontend: https://docs.ckeditor.com/ckeditor4/latest/guide/dev_mathjax.html#displaying-on-target-page

Share on other sites

Actually, hold on... I just added this JS, but it doesn't work.

Is there anything else that one needs to do / add?

@tpr and ideas? I'm using PW 3.0.99. Tried to load it via Cloudflare, and also with a local copy (with and without AIOM).

Don't know what I did, but got it to work finally...

Create an account

Register a new account

format: plain


text:
$\left(\frac{a}{b}\right)^\frac{1}{n}= \frac{a^\frac{1}{n}}{b^\frac{1}{n}}$

Problem is to prove this for all $$n\in \mathbb{N}$$ $$\left(\frac{a}{b}\right)^\frac{1}{n}= \frac{a^\frac{1}{n}}{b^\frac{1}{n}}$$ My attempt: $$x=\left(\frac{a}{b}\right)^\frac{1}{n}$$ $$x^n=\frac{a}{b}$$ $$b\cdot x^n=a$$ $$b^{(\frac{1}{n})}\cdot x =a^\frac{1}{n}$$ $$x=\frac{a^\frac{1}{n}}{b^\frac{1}{n}}$$ But problem is that I in 4 line use what I need to prove.

• I think you should be very careful to specify which axioms/theorems you're using at each step. – Theo Bendit Jun 25 at 6:27
• Theo is correct, you should specify which axioms you used. – topologicalmagician Jun 25 at 11:42

Fourth line in error. It should be $$b^{(\frac{1}{n})}\cdot x =a^{(\frac{1}{n})}$$ All else OK

• Are you sure it will be ok? Because in previous line $b\cdot x^n=a$ And I use $n$-th root $(bx^n)^\frac{1}{n} = b^\frac{1}{n}\cdot x$ – josf Jun 25 at 6:43
• The same rule should be applied on both sides of the equation. – Narasimham Jun 25 at 7:01

I will give a you a simple proof.

Let $$x = a$$

Let $$y = \frac{1}{b}$$

Let $$z = \frac{1}{n}$$

Therefore your equation becomes $$(xy)^z = x^z * y^z ⇒ xy * xy * xy..... xy, ntimes = (x * x * x..... x, ntimes) * (y * y * y..... y, ntimes)$$ In this equation, LHS and RHS are equal due to commutativity of multiplication.


text:
# Support Vector Machines

Support vector machines (SVMs) are often considered one of the best 'out of the box' classifiers. The simple maximal margin classifier can be generalized to the support vector classifier, which can be further generalized to the support vector machine.

May 2, 2020 - 13 minute read -

### I. Maximal Margin Classifiers

The maximal margin classifier, or the optimal separating hyperplane, is the separating hyperplane1 that is farthest away from the training observations. This classifier depends directly on only a small subset of the training observations, called support vectors.

The maximal margin hyperplane is the solution to the optimization problem:

Where:

• $M$ is the margin, the minimal orthogonal distance from the training observations to the hyperplane
• The first condition guarantees a unique solution where the orthogonal distance from the $i$th observation to the hyperplane fulfills the second condition.
• The second condition guarantees that each observation is on the correct side of the hyperplane.

We then classify each observation based on where it lies in relation to the hyperplane derived from $\beta_0, \beta_1, ..., \beta_p$ from the optimization problem above.

### II. Support Vector Classifiers

If no separating hyperplane exists, then there is no maximal margin classifier. In the non-separable case, the generalization of the maximal margin classifier is called the support vector classifier.

The support vector classifier, or the soft margin classifier, provides greater robustness to individual observations, and better classification of most of the training observations than the maximal margin classifier.

Where:

• Where $\epsilon_i$ are the slack variables whose sum is less than or equal to the tuning parameter $C$.
• If $\epsilon_i = 0$, then the $i$th observation is on the correct side of the margin
• If $\epsilon_i > 0$, then the $i$th observation is on the wrong side of the margin
• If $\epsilon_i > 1$, then the $i$th observation is on the wrong side of the hyperplane
• $C$ is a “budget” for how much the margin can be violated. No more than $C$ observations can violate the hyperplane at once.
• Choose with cross validation.
• A higher $C$ means the model is more tolerant of margin violations.
• If $C = 0$, then the solution is equivalent to that of the maximal margin classifier.
• A smaller $C$ corresponds with high variance and low bias; a larger $C$ corresponds with high bias and low variance.

The support vectors in this model (the only observations that affect the hyperplane) are the observations that are on the margin or that violate the margin. Support vector classifiers are robust to observations far away from the hypersplane, unlike methods such as linear discriminant analysis.

### III. Support Vector Machines

In non-linear decision boundaries, we can modify the $y_i \bigl( f(x) \bigr) \geq M (1 - \epsilon_i)$ condition in the support vector classifier to include non-linear functions.

The solution to the linear support vector classifier involves only the inner products of the observations, $\langle x, x_i \rangle = \sum_{j = 1}^p x_{ij} x_{i'j}$. It can be shown that the linear support vector classifier can be represented by:

Where:

• There are $n \choose 2$ inner products between all pairs of training observations needed to estimate the parameters $\alpha_1, ..., \alpha_n, \beta_0$.
• $S$ is the collection of indices of support points, since $\alpha_i$ is only non-zero for support vectors.

We can generalize the support vector classifier with a kernel, $K(x_i, x_{i'})$, a function that quantifies the similarity of two observations, instead of the inner product (linear kernel).

Support vector machines use the support vector classifier with a non-linear kernel:

Examples of different kernels:

• Linear Kernel (inner product):
• Polynomial Kernel of degree d
• Radial Kernel (very local behavior)

SVMs are computational nice, since they only need to calculate $K(x_i, x_{i'})$ for $n \choose 2$ distinct pairs $i, i'$. This can be done without explicitly working in an enlarged feature space. The radial kernel feature space is implicit and infinite-dimensional, so we need a kernel to use it.

An ROC curve of the false positive rate against the true positive rate can help graphically compare the performance of SVMs.

Extension to more than two classes

One-versus-one classification

• Constructs $k \choose 2$ SVMs, each of which compares a pair of classes.
• Classify a test observation into each of the $k \choose 2$ pairs, tally the number of times it’s classified into each of those $K$ classes, and assign it to the class for which it was the most frequently assigned.

One-versus-all classification

• Fit $K$ SVMs. For each fit, compare one of the $K$ classes to the other $K - 1$ classes.
• Assign observations to the class for which $\beta_{0k} + \beta_{1k}x_1^* + ... + \beta_{pk} x_p^*$ is largest.

Note: Support vector regression also exists.

Relationship to logistic regression

The loss + penalty function of SVMs, shown below, is very similar to the loss function of logistic regression.

$\lambda$ is a nonnegative tuning parameter. When $\lambda$ is large, then the coefficients are small and more violations to the margin are tolerated for lower variance and higher bias. This equation takes the “Loss + Penalty” form that many other models take, and the loss function of an SVM is known as “hinge loss.”

SVMs perform better when classes are well-separated, while logistic regression performs better with overlapping classes.

A graphical comparison of SVM loss vs. logistic regression loss is shown below.2

### IV. Applications in R

1. A hyperplane in $p$-dimensional space is a flat affine subspace of dimension $p - 1$, and is defined by $\beta_0 + \beta_1 X_1 + ... + \beta_p X_p = 0$

2. Source: James et. al, Intro to Statistical Learning 7th edition, pg. 358


text:
# Parametric curve on cylinder surface

Let $r(t)=(x(t),y(t),z(t)),t\geq0$ be a parametric curve with $r(0)$ lies on cylinder surface $x^2+2y^2=C$. Let the tangent vector of $r$ is $r'(t)=\left( 2y(t)(z(t)-1), -x(t)(z(t)-1), x(t)y(t)\right)$. Would you help me to show that :

(a) The curve always lies on ylinder surface $x^2+2y^2=C$.

(b) The curve $r(t)$ is periodic (we can find $T_0\neq0$ such that $r(T_0)=r(0)$).If we make the C smaller then the parametric curve $r(t)$ more closer to the origin (We can make a Neighboorhood that contain this parametric curve)

My effort:

(a) Let $V(x,y,z)=x^2+2y^2$. If $V(x,y,z)=C$ then $\frac{d}{dt} V(x,y,z)=0$. Since $\frac{d}{dt} V(x,y,z)=(2x,4y,0)\cdot (x'(t),y'(t),z'(t))=2x(2y(z-1))+4y(-x(z-1))=0$, then $r(0)$ would be parpendicular with normal of cylinder surface. Hence the tangent vector must be on the tangent plane of cylinder. So $r(t)$ must lie on cylinder surface.

(b) From $z'=xy$, I analyze the sign of $z'$ (in 1st quadrant z'>0 so the z component of $r(t)$ increasing and etc.) and conclude that if $r(t)$ never goes unbounded when move to another octan ( But I can't guarante $r(t)$ accros another octan.). I also consider the case when $(x=0, y>0), (x=0, y<0,z>1), (x>0, y=0,z>1$and so on) and draw the vector $r'(t)$.

Thank you so much of your help.

-
We can reparameterize $S=\{(\sqrt{C}\cos u,\frac{\sqrt{C}}{\sqrt{2}}\sin u, v): u,v\in \mathbb{R}\}$ since $(\sqrt{C}\cos u)^2+2\left(\frac{\sqrt{C}}{\sqrt{2}}\sin u\right)^2=C$. Let $r(t)= (x(t),y(t),z(t))$ and $r(0)=(x_0,y_0,z_0)$. Define $V(x,y,z)=x^2+2y^2$. Since $V(x,y,z)=C$ then $\frac{dV}{dt}=0$. But, by chain rule we get $0=\frac{dV}{dt}=\nabla{V}\cdot(x',y',z')$ so the tangent vector of the parametrized curve that intersect $S$ in a point always parpendicular with $\nabla{V}$. Since $r(0)$ be in $S$ and $\nabla{V}$ parpendicular with the tangent plane of $S$ at $r(0)$ , then $r'(0)$ be on the tangent plane of $S$ at $r(0)$. By this argument, we can conclude that $r(t)$ must be on $S$. Since $S=\{(\sqrt{C}\cos u,\frac{\sqrt{C}}{\sqrt{2}}\sin u, v): u,v\in \mathbb{R}\}$ then $x(t)=\sqrt{C}\cos (t-t_0)$ and $y(t)=\frac{\sqrt{C}}{\sqrt{2}}\sin (t-t_0)$ with $t_0$ satisfying $x_0=\sqrt{C}\cos t_0$ and $y_0=-\frac{\sqrt{C}}{\sqrt{2}}\sin t_0$. Since $z'=xy$ then $z'(t)=\frac{C}{2\sqrt{2}}\sin(2t-t_0)$, hence $z(t)=-\frac{C}{4\sqrt{2}}\cos(2t-t_0)$. Since $r(2\pi)=(\sqrt{C}\cos (2\pi-t_0),\frac{\sqrt{C}}{\sqrt{2}}\sin (2\pi-t_0),-\frac{C}{4\sqrt{2}}\cos(2\pi-t_0))=(x_0,y_0,z_0)=r(0)$ then $r(t)$ is periodic.


text:
Hi,
Today, when I tried to replicate the ddpg experiment, I found a proble that puzzled me.
Let suppose “actor” and “critic” are the networks, and “state” represents the input tensor.
when I use

actions = actor(state)
q = critic(state, var_actions)
q.backward(torch.ones(q.size())

after q.backward(), I can find var_actions.grad become a tensor(which is the grad of var_actions), but when I use

actions = actor(state)
q = critic(state, actions)
q.backward(torch.ones(q.size())

after q.backward(), when I check the grad of “actions”, the value is None

I can’t find the problem, it seems the only diference is whether to create a new tensor?

PyTorch creates a dynamic computational graph (like a tree) when calculating the gradients.
The leaves of this tree are input tensors. For leaves, you can only get the gradients if I am right.

Gradients are calculated by tracing the graph from the root (output tensor) to the leaf and multiplying every gradient in the way using the chain rule .

I created several examples in here.

``````var_actions = torch.tensor(actions.data, requires_grad=True)
will be a leaf so this is why you are getting the gradients. In non leaf case, you will get `None`, as you confirmed.


text:
# Compact Space in Particular Point Space

## Theorem

Let $T = \struct {S, \tau_p}$ be a particular point space.

Then $\set p$ is compact in $T$.

## Proof

Any open cover of $\set p$ has a finite subcover: any single set that contains $p$ is a cover for $\set p$.

So $\set p$ is compact in $T$.

$\blacksquare$


text:
# Which of the following is a linear polynomial?

Question:

Which of the following is a linear polynomial?

(a) $x+x^{2}$

(b) $x+1$

(c) $5 x^{2}-x+3$

(d) $x+\frac{1}{x}$

Solution:

(b) $x+1$

Clearly, $x+1$ is a polynomial of degree 1 . So, it is a linear polynomial.

Leave a comment


text:
# turicreate.random_forest_regression.create¶

turicreate.random_forest_regression.create(dataset, target, features=None, max_iterations=10, validation_set='auto', verbose=True, random_seed=None, metric='auto', **kwargs)

Create a RandomForestRegression to predict a scalar target variable using one or more features. In addition to standard numeric and categorical types, features can also be extracted automatically from list- or dictionary-type SFrame columns.

Parameters: dataset : SFrame A training dataset containing feature columns and a target column. Only numerical typed (int, float) target column is allowed. target : str The name of the column in dataset that is the prediction target. This column must have a numeric type. features : list[str], optional A list of columns names of features used for training the model. Defaults to None, using all columns. max_iterations : int, optional The number of iterations to perform. max_depth : float, optional Maximum depth of a tree. min_loss_reduction : float, optional (non-negative) Minimum loss reduction required to make a further partition/split a node during the tree learning phase. Larger (more positive) values can help prevent overfitting by avoiding splits that do not sufficiently reduce the loss function. min_child_weight : float, optional (non-negative) Controls the minimum weight of each leaf node. Larger values result in more conservative tree learning and help prevent overfitting. Formally, this is minimum sum of instance weights (hessians) in each node. If the tree learning algorithm results in a leaf node with the sum of instance weights less than min_child_weight, tree building will terminate. row_subsample : float, optional Subsample the ratio of the training set in each iteration of tree construction. This is called the bagging trick and usually can help prevent overfitting. Setting it to 0.5 means that model randomly collected half of the examples (rows) to grow each tree. column_subsample : float, optional Subsample ratio of the columns in each iteration of tree construction. Like row_subsample, this also usually can help prevent overfitting. Setting it to 0.5 means that model randomly collected half of the columns to grow each tree. validation_set : SFrame, optional A dataset for monitoring the model’s generalization performance. For each row of the progress table, the chosen metrics are computed for both the provided training dataset and the validation_set. The format of this SFrame must be the same as the training set. By default this argument is set to ‘auto’ and a validation set is automatically sampled and used for progress printing. If validation_set is set to None, then no additional metrics are computed. This is computed once per full iteration. Large differences in model accuracy between the training data and validation data is indicative of overfitting. The default value is ‘auto’. verbose : boolean, optional If True, print progress information during training. random_seed : int, optional Seeds random operations such as column and row subsampling, such that results are reproducible. metric : str or list[str], optional Performance metric(s) that are tracked during training. When specified, the progress table will display the tracked metric(s) on training and validation set. Supported metrics are: {‘rmse’, ‘max_error’} kwargs : dict, optional Additional arguments for training the model. model_checkpoint_path : str, default None If specified, checkpoint the model training to the given path every n iterations, where n is specified by model_checkpoint_interval. For instance, if model_checkpoint_interval is 5, and model_checkpoint_path is set to /tmp/model_tmp, the checkpoints will be saved into /tmp/model_tmp/model_checkpoint_5, /tmp/model_tmp/model_checkpoint_10, … etc. Training can be resumed by setting resume_from_checkpoint to one of these checkpoints. model_checkpoint_interval : int, default 5 If model_check_point_path is specified, save the model to the given path every n iterations. resume_from_checkpoint : str, default None Continues training from a model checkpoint. The model must take exact the same training data as the checkpointed model. out : RandomForestRegression A trained random forest model for regression tasks.

References

Examples

Setup the data:

>>> url = 'https://static.turi.com/datasets/xgboost/mushroom.csv'
>>> data['label'] = data['label'] == 'p'

Split the data into training and test data:

>>> train, test = data.random_split(0.8)

Create the model:

>>> model = turicreate.random_forest_regression.create(train, target='label')

Make predictions and evaluate the model:

>>> predictions = model.predict(test)
>>> results = model.evaluate(test)


text:
01. [10p] Rotational delay - IOPS calculations

Every disk in your storage system has a maximum theoretical IOPS value that is based on a formula. Disk performance and IOPS is based on three key factors:

• Rotational speed. Measured in RPM, mostly 7,200, 10,000 or 15,000 RPM. A higher rotational speed is associated with a higher-performing disk.
• Average latency. The time it takes for the sector of the disk being accessed to rotate into position under a read/write head.
• Average seek time. The time (in ms) it takes for the hard drive’s read/write head to position itself over the track being read or written.
• Average IOPS: Divide 1 by the sum of the average latency in ms and the average seek time in ms (1 / (average latency in ms + average seek time in ms).

To calculate the IOPS range divide 1 by the sum of the average latency in ms and the average seek time in ms. The formula is:

average IOPS = 1 / (average latency in ms + average seek time in ms).

Let's calculate the Rotational Delay - RD for a 10K RPM drive:

• Divide 10000 RPM by 60 seconds: 10000/60 = 166 RPS
• Convert 1 of 166 to decimal: 1/166 = 0.006 seconds per Rotation
• Multiply the seconds per rotation by 1000 milliseconds (6 MS per rotation).
• Divide the total in half (RD is considered half a revolution around a disk): 6/2 = 3 MS
• Add an average of 3 MS for seek time: 3 MS + 3 MS = 6 MS
• Add 2 MS for latency (internal transfer): 6 MS + 2 MS = 8 MS
• Divide 1000 MS by 8 MS per I/O: 1000/8 = 125 IOPS

[10p] Task A - Calculate rotational delay

Calculate the rotational delay (RD) for a 5400 RPM drive.


text:
# Nix with-expression

with e1; e2

This with-expression adds the attributes in the set e1 to the lexical scope of the expression e2 as if they’d been added in a .

Attributes introduced by a with-expression do not shadow attributes with the same identifier introduced any other way.


text:
# Cognitive result (懂): as a cognitive result

This grammar means something is understood by the preceding verb.

This grammar means something is understood by the preceding verb.


text:
Subjects
PRICING
COURSES
SIGN IN
Start Free Trial
Nicholas H.
College student: Tutor for several years
Tutor Satisfaction Guarantee
Pre-Calculus
TutorMe
Question:

Solve the equation $$2\cos^2 3\theta = \cos 3\theta$$ for $$0\le \theta <2\pi$$.

Nicholas H.
Answer:

$$2\cos^2 3\theta = \cos 3\theta$$ gives $$2\cos^2 3\theta-\cos 3\theta=0$$, so $$(\cos 3\theta)(2\cos 3\theta -1)=0$$. Therefore $$\cos 3\theta=0$$ or $$\cos 3\theta=1/2$$, so either $$3\theta=\pi/2, 3\pi/2, 5\pi/2, 7\pi/2, 9\pi/2, 11\pi/2$$ or $$3\theta=\pi/3, 5\pi/3, 7\pi/3, 11\pi/3, 13\pi/3, 17\pi/3$$. Dividing by 3 to find $$\theta$$, we obtain the solutions $$\theta=\pi/6,\pi/2,5\pi/6,7\pi/6,3\pi/2,11\pi/6$$ and $$\theta=\pi/9,5\pi/9,7\pi/9,11\pi/9,13\pi/9,17\pi/9$$.

Calculus
TutorMe
Question:

Prove that a infinite sequence .99999...= 1

Nicholas H.
Answer:

$$.999... = \sum_{i=1}^{\infty} \frac9{10^i} = \sum_{i=1}^{\infty} \frac{10-1}{10^i} = \sum_{i=1}^{\infty} (\frac{10}{10^{i-1}} - \frac{1}{10^i}) = \frac{1}{10^0} = 1$$ This proves that .999... = 1

Economics
TutorMe
Question:

How does the increase of minimum wage affect the economy?

Nicholas H.
Answer:

Recent evidence shows that any effects of raising the minimum wage would not be extremely significant, but by raising the minimum wage, it is known that the purchasing power of individuals will increase, and reducing employee turnover, which are both positive effects for the consumers.

Send a message explaining your
needs and Nicholas will reply soon.
Contact Nicholas
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.
Made in California
© 2018 TutorMe.com, Inc.


text:
# Is the completion of a CAT(0) open ball a closed ball?

It is well-known that the completion of a metric space which is homeomorphic to a ball can be very wild; in fact, I think, every compact manifold is the closure of an open ball!

But CAT(0) spaces are very different from general manifolds. If I have a CAT(0) with the path metric, that is totally bounded, and that is homeomorphic to an open ball, will its completion be a closed ball?

• I don't understand the question. What is "totally bounded"? "homeomorphic to an open ball", what does it mean? open ball of what?
– YCor
Jun 3, 2017 at 9:01
• I am not able to construct an example right now with bare hands, but I would expect that the topology on the closure could be strictly finer, maybe even discrete on the boundary in certain examples. Jun 3, 2017 at 9:52
• @SebastianGoette thanks; so what's the difference with "bounded"? Also what's a CAT(0) with the path metric, since a CAT(0) space is by definition geodesic?
– YCor
Jun 3, 2017 at 9:54
• @YCor, it's polite not to criticize terminology before googling to see if it's standard. The first hit for "totally bounded" is the Wikipedia article giving the definition: en.m.wikipedia.org/wiki/Totally_bounded_space .
– HJRW
Jun 4, 2017 at 5:44
• For the record, the question can be restated as: Let a bounded CAT(0) metric space be homeomorphic to an open ball of some Euclidean space. Is its completion homeomorphic to a closed ball (in the same Euclidean space)? at least assuming if necessary that the completion is compact?
– YCor
Jun 4, 2017 at 11:34

## 1 Answer

The answer is "no".

Let $\Sigma$ be the suspension over Poincaré homology sphere. It admits a polyhedral $\mathrm{CAT}[1]$-metric.

Let $B$ be the unit ball in the Euclidean cone $\mathrm{Cone}\,\Sigma$.

Note that $B$ is a compact $\mathrm{CAT}[0]$-space; its interior is homeomorphic to the ball in $\mathbb{E}^5$ but its boundary is homeomorphic to $\Sigma$, which is not a manifold.

• A bit of background: en.wikipedia.org/wiki/Double_suspension_theorem Jun 4, 2017 at 18:01
• Thank you. This result seems to crop up in all the strangest of places. I appreciate your work in answering this. Jun 5, 2017 at 5:25


text:
# Example where values in codomain are not in image?

I am familiar with the formal definitions of codomain (or output space) and image, but I would like to better understand what it means when $$image(f)\ne Y$$ for some function $$f$$ from $$X$$ to $$Y$$ where $$f(x)=y$$.

I know that $$im(f)=Y$$ if and only if the function is invertible. That is because if the function is not invertible, some information is "lost" when moving between the input space and the output space, so it is possible to have values that are part of the output space $$Y$$ that are not in the image of $$f$$. This makes sense to me, but I cannot seem to come up with a specific example of when or why that would happen. Can anyone please help?

• Consider $f(x)=2x$. We have $f : \mathbb N \to \mathbb N$ but the image (or range) is not $\mathbb N$: it is the subset of even numbers. – Mauro ALLEGRANZA Oct 2 '18 at 15:42
• @MauroALLEGRANZA Thanks for your reply. I get what you are saying. However, I'm still confused, because my textbook say that if the function is invertible, then it follows that the image of $f$ is the same thing as the output space. In your example, $f(x)=2x$ is an invertible function, but we have that $im(f) \neq \mathbb{N}$. What am I missing? – Hee Jin Oct 2 '18 at 15:51
• $2x$ isn't invertible on naturals. If it were then $2x=3$ would have a natural number solution. – coffeemath Oct 2 '18 at 15:54
• I know that im(f)=Y if and only if the function is invertible No, $\,\operatorname{Im}(f)=Y\,$ if and only if the function is surjective. For example $\,f(x)=x^2\,$ defined as $\,f : \Bbb R \to [0,\infty)\,$ is surjective, and satisfies $\,\operatorname{Im}(\Bbb R)=[0,\infty)\,$, but is not invertible because it is not injective. – dxiv Oct 2 '18 at 16:01
• @coffeemath Thank you!! – Hee Jin Oct 2 '18 at 16:21

The codomain is the space that we are considering the output to "live" in. If we are considering the outputs to be a certain type of number, and not all numbers of that type are a possible output, then the image and codomain are different (other terms for the image and codomain being the same are "onto" and "surjective", so you're looking for functions that aren't onto). For instance, suppose we take the rounding function, where $$f(x)$$ is $$x$$ rounded to the nearest integer. If we consider the output space to be the set of integers, then the function is onto. But if we consider the output space to be real numbers, then it's not onto. This is why, strictly speaking, to know whether a function is onto, we need to know not only what the rule for producing the output is, but also what the codomain is. Other examples of functions that don't map the reals onto the reals are $$f(x)=x^2$$ and $$f(x)=e^x$$; the former maps reals onto the nonnegative real numbers, and the latter maps reals onto positive reals.

For a function to be invertible, the inverse of every element must be well-defined. "well-defined" means that a value exists, and there is only one value (if there were more than one, it wouldn't be well-defined because we wouldn't know which is meant). The condition that for each $$y$$, there exists an $$x$$ such that $$f(x) = y$$ is this onto property. The condition that for every $$y$$, there is at most $$x$$ such that $$f(x)=y$$ is called "into", "one-to-one" or "injective". So being invertible is not equivalent to being onto; a function has to be both onto and into. An example of a function that is onto but not into is $$f(x) = x^3-x = (x-1)x(x+1)$$. This has three roots of $$-1,0,1$$, so it's not it's not into (there are three different values of $$x$$ that give $$y=0$$), but it is onto. You can also have functions that are into but not onto, such as $$\arctan$$.

You put the tag linear-algebra, so you may be thinking of the fact that square matrices are invertible if and only if their columns space is the whole space (i.e., onto). However, this is due to square matrices representing linear transformations between vectors spaces of the same dimension. If a linear transformation goes to a smaller space, it will not be invertible regardless of whether it's onto.

Whether a linear transformation is onto depends, again, on what one considers the output space to be. For instance, consider the transformation $$P$$ that projects a three dimensional vector to the $$xy$$-plane. If we look in three dimensional space, the image is a plane, which is a subset of $$\mathbb{R}^3$$, so it's not onto from that perspective. However, if we consider the codomain to be the $$xy$$-plane, then it is onto. When a linear transformation is represented by a matrix, the number of rows tells you what dimension the codomain is considered to have. If the rows are independent, then the transformation is onto this space.

• For injective it should be "for every $y$ there is at most one $x$ such that $f(x)=y.$ [Unless it's already assumed $f$ is onto.] – coffeemath Oct 2 '18 at 19:26
• @coffeemath "only one" means "at most one", but I suppose the latter is less ambiguous. – Acccumulation Oct 2 '18 at 19:42
• Thank you so much for your detailed and thorough response! This helped me so much. There is a lot to sink my teeth into here and come back to. And yes, I was thinking about all this in the context of square matrices. – Hee Jin Oct 4 '18 at 18:19
• Side note, I am trying to change this to the accepted answer but I am having trouble with this. I cleared the browser's cache and everything...guess it's time to hit meta :) – Hee Jin Oct 4 '18 at 18:23

The codomain of a function $$f:X\to Y$$ is simply a set which includes the image of the domain, i.e. $$f(X)\subset Y$$. This may seem redundant: why do not impose always $$f(X)=Y$$? This is because sometimes it is useful to consider a larger set: for example, it could be useful to consider the function $$x\mapsto y=x^2$$ as a member the class of functions $$\{f:\mathbb{R}\to \mathbb{R}\}$$ even if $$x^2(\mathbb{R})=\mathbb{R}_+=\{x\in\mathbb{R}| x\ge 0\}.$$ Another, more interesting example, is the one given by Mauro Allegranza in his comment: his example is nice because it alludes to the extension of a function from smaller domain and codomain to larger ones. Finally, the condition you state for the equality $$\mathrm{image}(f)=Y$$ to be true is not correct: the real "necessary and sufficient" condition is that $$f$$ should be surjective, i.e. for any $$y\in Y$$ there is (at least one) $$x\in X$$ such that $$f(x)=y$$. This condition is fulfilled if $$f:X\to Y$$ is invertible since in this case $$f$$ is both injective (i.e. $$f(x_1)\neq f(x_2)$$ if $$x_1\neq x_2$$) and sujective.

• Thank you Daniele! This was immensely helpful. So basically, there are sometimes reasons for thinking of the codomain as part of a larger set. For example, maybe you want to make use of the values that aren't in the image of $f$, but are in the codomain. Also it's very helpful to know about the correct condition for $im(f)=Y$. The textbook doesn't say anything about this, but it probably should have, because everything makes much more sense to me now. – Hee Jin Oct 2 '18 at 16:42


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 22 Oct 2019, 01:49

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+

Author Message
TAGS:

### Hide Tags

CEO
Status: GMATINSIGHT Tutor
Joined: 08 Jul 2010
Posts: 2978
Location: India
GMAT: INSIGHT
Schools: Darden '21
WE: Education (Education)
Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+  [#permalink]

### Show Tags

01 Oct 2018, 03:35
00:00

Difficulty:

55% (hard)

Question Stats:

52% (01:41) correct 48% (01:27) wrong based on 52 sessions

### HideShow timer Statistics

Find out the unit digit of $$x$$, if $$x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+......10!^{10}$$

A) 1
B) 3
C) 5
D) 7
E) 9

http://www.GMATinsight.com

_________________
Prosper!!!
GMATinsight
Bhoopendra Singh and Dr.Sushma Jha
e-mail: info@GMATinsight.com I Call us : +91-9999687183 / 9891333772
Online One-on-One Skype based classes and Classroom Coaching in South and West Delhi
http://www.GMATinsight.com/testimonials.html

ACCESS FREE GMAT TESTS HERE:22 ONLINE FREE (FULL LENGTH) GMAT CAT (PRACTICE TESTS) LINK COLLECTION
Intern
Joined: 13 Jun 2013
Posts: 5
Location: India
GPA: 3.88
Re: Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+  [#permalink]

### Show Tags

01 Oct 2018, 04:26
X = 1 + 2^2 + 6^3 + 24^4 + 120^5 + 720^6....

X = 1+4+..6+..6+..0+..0+....
X=5+..2
X=..7

If the explaination helped please give kudos.

Posted from my mobile device
Manager
Joined: 21 Nov 2016
Posts: 70
GMAT 1: 640 Q47 V31
Re: Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+  [#permalink]

### Show Tags

01 Oct 2018, 04:30
3
The one thing we need to know before attempting this question is that the last digit of any factorial starting from 5 and beyond is always zero.
So, effectively we need to find the last digits of the starting terms, that is 1!^1, 2!^2, 3!^3, 4!^4,
1!^1 = last digit 1
2!^2 = last digit 4
3!^3 => 3! is 6 (cyclicity of 6 is 1) so last digit is 6
4!^4 => 4! is 24 (cyclicity of last digit of 24 that is 4 is 2) first is 4 second is 6 so, last digit is 6
1+4+6+6 = 17 => last digit is 7
Senior Manager
Joined: 26 Jun 2017
Posts: 399
Location: Russian Federation
Concentration: General Management, Strategy
WE: Information Technology (Other)
Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+  [#permalink]

### Show Tags

08 Oct 2018, 14:15
GMATinsight wrote:
Find out the unit digit of $$x$$, if $$x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+......10!^{10}$$

A) 1
B) 3
C) 5
D) 7
E) 9

http://www.GMATinsight.com

From 5! the unit digit of each such one will be 0.
So we need only the first four.
$$1!^1$$ unit digit is 1
$$2!^2$$ ---> 4
$$3!^3$$ ---> 6
$$4!^4$$ ---> 6
1+4+6+6=17 --->7
Find out the unit digit of x, if x = 1!^1 + 2!^2 + 3!^3 + 4!^4 + 5!^5+   [#permalink] 08 Oct 2018, 14:15
Display posts from previous: Sort by


text:
# rblock hide command

Syntax

rblock hide <keyword> <range>

Primary keywords:

undo

This command hides or un-hides all rigid blocks in the range. By default, commands that use a range filter will skip hidden objects. This can be overruled with the use-hidden keyword in the range specification.

The following keywords are available:

b

If a boolean type is specified, then if on it hides all rigid blocks in the range. If off it un-hides (or shows) all rigid blocks in the range, and the use-hidden keyword is applied to the range implicitly. on is the default if no keyword is given.

undo

This will reverse the operation of the last rblock hide command. A maximum undo stack of size 12 is retained.


text:
# How to proof mass moment of inertia formula for a hoop with axis across the diameter?

## Moment of inertia of the hoop is given by: $\frac{1}{2} m {r}^{2}$ How to proof that? You may attach a hyperlink or write down the derivation from $I = m {r}^{2}$. Thanks

Jul 20, 2017

See the proof below

#### Explanation:

The volume is $= 2 \pi R t$

The thickness is $= t$

The radius of the hoop is $= R$

The density is $\rho = \frac{M}{2 \pi R t}$

The moment of inertia is

$I = \int {r}^{2} \mathrm{dm}$

As the axis is across the diameter

The distance from the differential mass $\mathrm{dm}$ is $= R \sin \theta$

$\mathrm{dm} = \rho R t d \theta$

$\cos 2 \theta = 1 - 2 {\sin}^{2} \theta$

${\sin}^{2} \theta = \frac{1}{2} - \frac{1}{2} \cos 2 \theta$

Therefore, substituting in the integral, we integrate from $0$ to $\pi$ and multiply by $2$

$I = 2 {\int}_{0}^{\pi} {R}^{2} {\sin}^{2} \theta \rho R t d \theta$

$= 2 {R}^{3} \rho t {\int}_{0}^{\pi} {\sin}^{2} \theta d \theta$

$= 2 {R}^{3} \rho t \cdot {\left[\frac{\theta}{2} - \frac{1}{4} \sin \left(2 \theta\right)\right]}_{0}^{\pi}$

$= 2 {R}^{3} \rho t \left(\frac{\pi}{2}\right)$

$= \frac{M}{2 \pi R t} \cdot 2 {R}^{3} \cdot t \cdot \frac{\pi}{2}$

$= \frac{1}{2} M {R}^{2}$


text:
VERITAS

OIL, POLISH, WAX AND FRESH COATING RESIDUES CLEANER
VERITAS is a swirls highlighter, essential before applying the coating or sealant, which cleans and can also be used innovative, as a check control of the life of the coating during the washing phase: in fact many shampoos leave micro-residues of surfactants that do not allow the coating to express itself at its best and which could thus make the detailer wrong who could mistakenly think that the coating has vanished.

#VERITAS is a swirls highlighter, essential before applying the coating or sealant, which cleans and can also be used in a innovative, as a check control of the life of the coating during the washing phase: in fact many shampoos leave micro-residues of surfactants that do not allow the coating to express itself at its best and which could thus make the detailer wrong who could mistakenly think that the coating has vanished. Thanks to #VERITAS this problem is totally avoided. #VÈRITAS can also be used as a lifeline during the application of a protective nano: in the event that some residue should be left, or the treated surface is particularly sensitive to the passage of the nano, #VERITAS it will eliminate all traces of product in a simple way and will allow you to repeat the operations. #VERITAS has been thoroughly researched, developed and tested in Mafra laboratories in collaboration with the best international detailing centers.

Categories


text:
# Decomposing transverse momentum balance contributions for quenched jets in PbPb collisions at sNN?????=2.76sNN=2.76 TeV

## This item appears in the following Collection(s)

Except where otherwise noted, the use of this item is bound by the following: Attribution 4.0 International (CC BY 4.0)

Center for the


text:
# zbMATH — the first resource for mathematics

The asymptotic behavior of global smooth solutions to the hydrodynamic model for semiconductors with spherical symmetry. (English) Zbl 1025.35028
The paper under review is devoted to the following hydrodynamic model for one carrier transport in semiconductor devices:
(1) $$n_t+\nabla\cdot (n{\mathbf u})=0$$,
(2) $$(n{\mathbf u})_t+\nabla\cdot (n{\mathbf u}\otimes {\mathbf u})+\nabla p(n)=n{\mathbf E} - \frac{n{\mathbf u}}{\tau}$$
(3) $$\nabla\cdot {\mathbf E} = n-b(x)$$
for $$(x,t)\in \Omega\times [0,+\infty[$$, where $$\Omega=\{x\in\mathbb{R}^d \mid 0<R_1\leq|x|\leq R_2<+\infty\}$$.
Here $$n$$ denotes the electron density, $${\mathbf u}$$ the average particle velocity, $${\mathbf E}$$ the electric field, $$p=p(n)$$ the pressure density function, $$\tau>0$$ the momentum relaxation time and $$b=b(x)$$ a fixed density. The system (1)-(3) is completed by the following boundary and initial conditions: ${\mathbf u} = {\mathbf E} = 0 \text{ on } \partial\Omega \times ]0, + \infty[,\quad n=n_0, \quad {\mathbf u} = {\mathbf u}_0 \text{ on } \Omega\times\{0\}.$ The authors consider spherically symmetric solutions of the form $n(x,t)=n(|x|,t), \quad {\mathbf u}=\frac{x}{|x|}u(|x|,t), \quad {\mathbf E}=\frac{x}{|x|} E(|x|,t),$ where $$b(x)=b(|x|)$$ in (3). Then (1)-(3) turns into a system for unknown functions defined on $$[R_1,R_2]\times [0,+\infty[$$.
The main results are as follows.
1. Assume $$0 < {\b{b}}\leq b(x)\leq\bar{b}$$ for all $$x\in\Omega$$. Then there exists a unique solution to the stationary problem.
2. Assume the boundary and initial conditions satisfy an appropriate compatibility condition and a smallness condition including $$\text{osc}_{r\in[R_1,R_2]}b(r)$$. Then for sufficiently small $$\tau$$, there exists a unique global solution to the nonstationary system. In addition, there holds an asymptotic estimate on the solution.
The proof of the first result relies on a fixed point argument, while the proof of the second result is based on a-priori-estimates and the energy method.

##### MSC:
 35Q60 PDEs in connection with optics and electromagnetic theory 82D37 Statistical mechanical studies of semiconductors 76N10 Existence, uniqueness, and regularity theory for compressible fluids and gas dynamics
Full Text:
##### References:
 [1] G.Q. Chen, J.W. Jerome, B. Zhang, Existence and the singular relaxation limit for the inviscid hydrodynamic energy model. Modeling and computation for applications in mathematics, science, and engineering, Evanston, IL, 1996, pp. 189-215 (Numer. Math. Sci. Comput., Oxford University Press, New York, 1998.) [2] Chu, C.; Hattori, H., Asymptotic behavior of the solution to a nonisentropic hydrodynamic model of semiconductors, J. differential equations, 144, 353-389, (1998) · Zbl 0913.35060 [3] Degond, P.; Markowich, P.A., On a one dimensional steady state hydrodynamic model for semiconductors, Appl. math. lett., 3, 25-29, (1990) · Zbl 0736.35129 [4] Degond, P.; Markowich, P.A., A steady state potential flow model for semiconductors, Ann. mat. pura appl., 4, 87-98, (1993) · Zbl 0808.35150 [5] Gamba, I.M., Stationary transonic solutions of a one dimensional hydrodynamic model for semiconductor, Comm. partial differential equations, 17, 553-577, (1992) · Zbl 0748.35049 [6] Hsiao, L.; Luo, T., Nonlinear diffusive phenomena of solutions for the system of compressible adiabatic flow through porous media, J. differential equations, 125, 329-365, (1996) · Zbl 0859.76067 [7] Hsiao, L.; Luo, T.; Yang, T., Global BV solutions of compressible Euler equations with spherical symmetry and damping, J. differential equations, 146, 203-225, (1998) · Zbl 0916.35090 [8] Hsiao, L.; Yang, T., Asymptotics of initial boundary value problems for hydrodynamic and drift diffusion models for semiconductors, J. differential equations, 170, 472-493, (2001) · Zbl 0986.35110 [9] Hsiao, L.; Zhang, K.J., The relaxation of the hydrodynamic model for semiconductors to the drift-diffusion equations, J. differential equations, 165, 315-354, (2000) · Zbl 0970.35150 [10] Jerome, J.W.; Shu, C.W., Energy models for one carrier transport in semiconductor devices, (), 185-207 · Zbl 0946.76516 [11] Luo, T.; Natalini, R.; Xin, Z.P., Large time behavior of the solutions to a hydrodynamic model for semiconductors, SIAM J. appl. math., 59, 810-830, (1998) · Zbl 0936.35111 [12] Majda, A., Compressible fluid flow and systems of conservation laws in several space variables, (1984), Springer Berlin, New York · Zbl 0537.76001 [13] Marcati, P.A.; Natalini, R., Weak solutions to hydrodynamic model for semiconductors and relaxation to the drift-diffusion equation, Arch. rational mech. anal., 129, 129-145, (1995) · Zbl 0829.35128 [14] Markowich, P.A., On steady state eurler – poisson model for semiconductors, Z. angew. math. phys., 62, 389-407, (1991) · Zbl 0755.35138 [15] Markowich, P.A.; Ringhofer, C.; Schmeiser, C., Semiconductors equations, (1990), Springer Vienna, New York [16] Zhang, B., Convergence of the Godunov scheme for a simplified one dimensional hydrodynamic model for semiconductor devices, Comm. math. phys., 157, 1-22, (1993) · Zbl 0785.76053
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
### cgy4ever's blog

By cgy4ever, 5 years ago, ,

Do you want to win a T-shirt? Do you want to learn how to design tasks for programming contest? Do you want to solve 7 tasks in 2.5 hours?

So Codeforces Round #270 is right for you. It was designed by me in California, Assembled in polygon (so Thank you MikeMirzayanov for the system and Gerald for organize and testing), will start on regular time this Sunday, don't miss it!

The organizers of Marathon24 decided to present gifts to the best finishers of the round! Best 25 participants will get Marathon24 tshirts! Thanks!

It is just an image to attract your attention. Real tshirts will be designed specially for Marathon24!

There are some articles introduced how to become a problem setter, like Problemsetter's Memoir and Way of problemsetter, but they focus on the process of contest preparation or high level thoughts. You might still don't know how to begin to write a contest: because you need to come up with ideas about problems in the first place.

In the last 3 years, I've designed lots of tasks, for example, there are 2 Codeforces Round by me (#190 and #228), and there are exactly 100 tasks designed by me on Topcoder. So I want to write a tutorial to share some specific ways to come up with new tasks.. Oh, wait, how about create a contest and write the tutorial in problem statement? So I get this idea: in each problem I will introduce a specific way of design, and I'll tell you how did I use this way to come up with a new task, and you need to solve that new task!

And this round will be a bit special: all contestants from Div1 and Div2 will compete in one contest, and it will contain all 7 problems! The duration is extended from 2 hours to 2.5 hours.

In the last, I'll do some self-introduction like marat.snowbear did in the announcement of last round. I'm Gaoyuan Chen from China, I lived in Beijing for 23 years till this August, and then I went to University of Southern California in Los Angeles to learn Game Design and Game Development. As a game designer, I'll try to make my round interesting and competitive. (And of course, there will be a problem about a popular game!) And I start to use Facebook after moved to US, so if you want to know more about me or want to chat with me, visit my facebook page: https://www.facebook.com/cgy4ever

More information like score distribution (so maybe we will have 3500p for last task!) will be announced later.

Good luck and have fun!

Update1 : score distribution: 500 — 1000 — 1500 — 2000 — 3000 — 3000 — 3500

Update2 : Contest ended. Thanks for participate! Any comment is welcome (you like the task? don't like it? it is too easy? too hard? Do you like the idea of Div1 and Div2 compete together? etc.).

Update3 : Editorial: http://codeforces.com/blog/entry/14028

Update4 : System test finished! Top 5 (in fact Top 6 because of a tie):

Update5 : Thank all of your support! I found I'm on the Top contributors list now. :)

Update6 : Statistics by DmitriyH: http://codeforces.com/blog/entry/14034

Announcement of Codeforces Round #270
Announcement of Codeforces Round #270

• +794

 » 5 years ago, # |   +26 These T-shirts look a bit generic :D
•  » » 5 years ago, # ^ |   +38 It is just an image to attract your attention. Real tshirts will be designed specially for Marathon24!
 » 5 years ago, # | ← Rev. 3 →   -600 Thanks everyone who downvoted this comment . I broke a record and became last one in contribituon list . This is a big achievement in my eyes. Start upvoting now !
•  » » 5 years ago, # ^ |   +29 Neither are your spam comments right for codeforces .
•  » » 5 years ago, # ^ |   +50 What is the current record in most downvoted comment on Codeforces? That one here looks like a pretty good candidate :P.
•  » » » 5 years ago, # ^ |   +1 The author now has the second lowest contribution: http://codeforces.ru/top-contributed/friends/false/page/34
•  » » » » 5 years ago, # ^ |   +11 Now it's definitely the lowest :>. He may be contribution version of worse :D. Btw when I was writing my previous post it got something like -160, now it has -392. This must be record :D.
•  » » » » » 4 years ago, # ^ |   0 Now it has -600. Wow :D
•  » » 5 years ago, # ^ |   -18 I missclicked upvote, how can i get my vote back(to downvote ofc)
•  » » » 5 years ago, # ^ |   +72 You can make another account, downvote from it and repeat as long as you find it fun :D
•  » » 5 years ago, # ^ |   +2 downvoat rating: -206 (min. candidate master, -206)
•  » » » 5 years ago, # ^ |   +9 The amount of downvotes for his comment is below worse's rating :P.
•  » » » » 5 years ago, # ^ |   0 And his comments has more downvotes, than the post has upvotes :D
•  » » 5 years ago, # ^ |   -14 Do we want to win a T-shirt? Yes, we do. Do we want to learn how to design tasks for programming contest? Yes, we do. Do we want to solve 7 tasks in 2.5 hours? Yes, we do.Do we care about your opinion? No, we don't. Do we care if you don't participate in the round? No, we don't.Have a nice day.
•  » » » 5 years ago, # ^ |   0 wow, positive man!
•  » » » 5 years ago, # ^ |   -7
•  » » » » 5 years ago, # ^ |   0 No, that is NOT how you link an image. You're linking your profile page, which is not an image.
•  » » » 5 years ago, # ^ |   0 so, you want to break the record of highest up voted comment? good luck!
•  » » 5 years ago, # ^ |   -6 am i the only one around here who up voted the non edited version of this comment?
•  » » 5 years ago, # ^ |   -11 My pp is very cool
•  » » 5 years ago, # ^ |   0 aaahhh! my record has been broken!
 » 5 years ago, # |   +161 The age of long round descriptions has started
 » 5 years ago, # |   +92 Its really nice and interesting to know about the problem setters.
 » 5 years ago, # | ← Rev. 2 →   +8 So are the top-25 of both rounds getting t-shirts?UPD: sorry I misread, both divisions are competing in one contest
•  » » 5 years ago, # ^ |   0 Acho pls the internet term is EDIT:. btw I'm getting rated tomorrow fosho
 » 5 years ago, # |   -14 Oh yes, this will be very useful for me. Maybe I will learn how to write a non-math problem (!!)
 » 5 years ago, # |   +13 Is this a rated event?
•  » » 5 years ago, # ^ |   +31 Yes. Why not?This is not the first rated round for both division. (e.g. Good Bye 2013 was rated for both div, but the duration is 2:00 instead of 2:30)
•  » » » 5 years ago, # ^ |   0 Just because I saw both division round for the first time. :)
•  » » » 5 years ago, # ^ |   +12 You introduced your self in your blog. But, Something was question to me for a long time. Why is your username cgy4ever? What does cgy means and why forever? :-)
•  » » » » 5 years ago, # ^ |   +14 His name is Gaoyuan Chen; in China, the family name goes first, so Chen Gaoyuan (CGY).
•  » » » » » 5 years ago, # ^ |   +6 So, His username is something like : "Viva me!" ? :D
 » 5 years ago, # |   +25 you are mine one of all time favourite coder , you always write code simple and understandable :) . last couple of rounds was not good for me i hope this time my rating will increase :D . it always great to compete with both division :)
 » 5 years ago, # |   +45 My favourite problem setter !! I have tried to mimic/ learn problem writing by looking at his problems. Your problems are really creative and provide a lot to learn. A big thank to you cgy4ever from heart :)
 » 5 years ago, # |   +11 "then I went to University of Southern California in Los Angeles to learn Game Design and Game Development."That sounds awesome :DIs there any game you've designed?
•  » » 5 years ago, # ^ |   0 That's a Yo Gi Oh Problem setted by him Link , maybe he was a part of the team who designed it ? =D
•  » » » 5 years ago, # ^ |   +7 Oh, no, Yo-Gi-Oh is not designed by me. :)That is indeed a great game, I played it (and watched the anime, at least first season) when I was in primary school.
•  » » » 5 years ago, # ^ |   0 That's impossible timewise, the franchise is from early years of this century.
•  » » 5 years ago, # ^ |   +12 Oh, so you know I just start my way to become a game designer, so don't expect some famous games designed by me at this time.We have a game design course this semester, and we are designing non-digital games every week. (We have not only CS student but also students from School of Cinematic Arts, and most of them don't know how to program, so we design games that do not require programming)That is a fun course, these pictures shows how other people are playing games that my team designed in first few weeks (it is called playtest: they play our game and give us some feedback, then we use these feedback to improve our design, and repeat this process again and again):
•  » » » 5 years ago, # ^ |   +3 I'm sure that if you do the same thing for gameplays as you do for contest problem ideas, you are almost guaranteed to discover a few game-changing ideas eventually. Good luck with that!
 » 5 years ago, # |   +1 Great format: 7 broblems — more place for solving ideas and more interesting standings!At least its my thought.
 » 5 years ago, # |   +17 This round will be on my 17th birthday :) I hope this will be a great round for me and for all.
 » 5 years ago, # |   +31 I do hope you provide sample implementations for the really hard problems. Its always a pleasure to read your code cgy4ever !! :D
 » 5 years ago, # |   +45 I've a feeling like Codeforces is becoming more than a problem solving and programming site , I'm feeling lucky to be in this great community with brilliant minds
 » 5 years ago, # |   +6 Problem setter is very interesting of facebook chat. :D
 » 5 years ago, # |   +1 Just curious, do you have any special reason behind making this contest combined for both divisions?
•  » » 5 years ago, # ^ |   +12 There must be some reasons but I don't know that. :)This decision was made by Gerald (or maybe MikeMirzayanov or some other people in codeforces side). I think this idea is great so I agreed to use it.
•  » » 5 years ago, # ^ |   +34 Probably because there are prizes. It's hard to compare participants if they are given different problems.
•  » » » 5 years ago, # ^ |   +147 And I'm sure there'd suddenly be many incredibly amazing participants in div2
•  » » » » 5 years ago, # ^ |   +5 I think div1 will get all all prizes.
•  » » » » 5 years ago, # ^ |   0 You mean UNRATED ones ??!!
•  » » » » 5 years ago, # ^ |   +3 no_name_weak_vegetable was an unrated user who won T-Shirt :P.
 » 5 years ago, # |   +8 Another Chinese Round arriving!Enjoy the T-shirts:)
 » 5 years ago, # |   +11 What does "cgy" in your handle mean?
•  » » 5 years ago, # ^ |   +42 Maybe it is Chen GaoYuan.
•  » » 5 years ago, # ^ |   +14 Yesterday I was virtually participating in #254 round, and in one problem there is an answer http://codeforces.com/contest/444/problem/D :D
 » 5 years ago, # |   -6 test
 » 5 years ago, # | ← Rev. 2 →   +3 An exciting announcement :) Wish this round success !
 » 5 years ago, # |   +32 Surely the best way of creating new problems — misreading other problems. I created a lot problems that way :D. For example: http://www.artofproblemsolving.com/Forum/viewtopic.phpp=2498536&sid=add5e05df3e05f2371cd0bee14294831#p2498536 — I misunderstood phrase "rounding down to the closest integer", I somehow ignored "down" and focused on choosing the closest integer, so 5,2 should be rounded to 5, but 5,7 should be rounded to 6. It turned out it has a really cute solution and later it that problem was posed in the most popular polish mathematical periodical "Delta" :D. Can you find the solution :)?Lame way of creating new problems: "What can be done by using centroid decomposition?" :P.Another fun way of creating new problems is to get inspiration from real-life situations. For example when being annoyed at people getting on the plane when they block the aisle taking care of their luggage and causing 50 people to wait. It immediately comes to mind that given time of blocking aisle when finding one's place for all people, one should firstly find an optimal arrangement, so that the summed time of waiting is minimized!
•  » » 5 years ago, # ^ |   +40 Two easy ways: change one word swap input and output (see the problems E, I, J from our last gym contest)
•  » » » 5 years ago, # ^ |   0 "change one word" -> most probably minimize to maximize or vice versa :D
•  » » » 5 years ago, # ^ |   0 regarding point 2, it seems cgy4ever agrees with u. :) (see problem D for more context)
•  » » 5 years ago, # ^ |   +16 I once created around 4 problems (for a physics competition) by naming them by quotes from Fish Fillets and creating problems based on them. Of course, it's easier to make physics problems because you just take an IRL scenario and make a simplified model if it's unsolvable :D
 » 5 years ago, # | ← Rev. 2 →   -53 sorry
•  » » 5 years ago, # ^ |   -15 There's no "yuo" on that page, so we'll still minus you.
 » 5 years ago, # |   -11 “all contestants from Div1 and Div2 will compete in one contest”, does it mean a difficult way for the div2 members to get the T-shirt ?
•  » » 5 years ago, # ^ |   0 Yeah, for me too.(I always jump from div1 to div2, then back) :D
•  » » » 5 years ago, # ^ | ← Rev. 3 →   -19 what a sad contest for me!
•  » » 5 years ago, # ^ |   -6 I don't know how exactly the rating is calculated in codeforces contests. But from the limited number of contests I did till now, what I came to know is that my rating would increase/decrease depending on whether I got a better/worse rank than the previous contest. Since this time, Div 2 contestants will be doing the contest with Div 1 contestants, the ranking of Div 2 contestants will most probably not be better than last time. Does this mean that we (Div 2) are going to get a drop in the rating?
•  » » » 5 years ago, # ^ |   -6 No. The update will be adjusted to that unusual contest (I mean, formula for updating ratings covers all cases in a relatively fair way, any special treatment is needed).
•  » » 5 years ago, # ^ |   +10 as difficult as for div.1
•  » » » 5 years ago, # ^ | ← Rev. 3 →   -13 It is so difficult for me!
 » 5 years ago, # |   -17 Жалко что с отбором Минским на ВКОШП пересекается.:(
 » 5 years ago, # |   0 ACM-ICPC rules?
•  » » 5 years ago, # ^ |   +9 Score distribution is mentioned, so probably not.
•  » » » 5 years ago, # ^ |   0 Why are you downvoted?
•  » » » » 5 years ago, # ^ |   -6 I also wonder...
•  » » » » 5 years ago, # ^ | ← Rev. 4 →   0 some people want to watch the world burn.. (may be, some user found it's fun to down-vote)
 » 5 years ago, # |   -19 Is this a rated contest ?
•  » » 5 years ago, # ^ |   0 Yes
 » 5 years ago, # | ← Rev. 2 →   +25 It was designed by me in California, Assembled in polygonAre you mimicking Apple? hahahttps://www.apple.com/designed-by-apple/
•  » » 5 years ago, # ^ |   +10 Yes, I fount it in the back of my iPhone, and it looks interesting.
 » 5 years ago, # |   0 Could be 5k registrants! Fingers Crossed
 » 5 years ago, # |   0 5000+ registration and all of them are official . This is great :D
 » 5 years ago, # |   0 delayed :(
•  » » 5 years ago, # ^ |   0 i think its normal for 5000+ registration
•  » » » 5 years ago, # ^ |   +3 Yeah, and crashing is normal for 5000+ registrations too :D
•  » » 5 years ago, # ^ |   +15 I get the feeling there site will be slow/down often...
 » 5 years ago, # |   -18 Will this round rated??
•  » » 5 years ago, # ^ |   +1 For the n'th time, yes.
•  » » 5 years ago, # ^ |   0 Yes, look for the answer of vishfrnds above.
 » 5 years ago, # |   +6 The contest was delayed because this guy didn't registered at time
 » 5 years ago, # |   +75 5419 Sorry TopCoder It's The Age Of CodeForces
 » 5 years ago, # | ← Rev. 2 →   +3 мне интересно на сколько поднимется рейтинг worse, он сейчас на 500+ месте
 » 5 years ago, # |   +23 worse solved the first 4 problems! I wonder if he is going to hack everyone again!
•  » » 5 years ago, # ^ |   0 also, i just noticed that he solved B in just 32 seconds!
 » 5 years ago, # |   +48 worse solved first 4 problems! I'm going to kill myself :D
•  » » 5 years ago, # ^ |   +5 and didn't do even one unsuccessful hack! :D
•  » » » 5 years ago, # ^ |   +79 Oh my god, I forgot about unsuccessful hacks, what a shame... Now my rainting will increase, it wasn't in my plans, I hate myself :(
•  » » » » 5 years ago, # ^ |   +2 You should solved all 7 problems in contest,and make many many unsuccessful challenge until your score's absolute value equals to the score when you solved 7 problems.
•  » » » » 5 years ago, # ^ |   0 Because you are the one in my friend list, when it came to 2 hours after starting, I was so surprised that you hadn't done any hack! And I doubted that you write the code which can pass pretest and FST. After system test, you surprised me again. In the end, I doubted you either forgot to hack (maybe you forgot it is the "worse" account) or want to make a "V" rating (decreasing and increasing). You can make another achievement that become IGM from white rating (rating below zero)~~ BTW. When I finished the problem C, I clicked the friends' rank and notice your rank is in front of mine... At that time, I felt I am worse than "worse" as well as the "worst"...
•  » » » » » 5 years ago, # ^ |   +13 I can be your friend.
•  » » » » 5 years ago, # ^ |   0 to be honest what ever you did for fun or anything make you as a celebrity :D today anyone from codeforces community at least know about two handle tourist and worse :D Btw i believe oneday you will be a red coder :) i would like to ask you a personal question how old are you ?
•  » » » » » 5 years ago, # ^ |   +1 It's a secret. I'll tell you when I become a red coder ;)
•  » » » » » 5 years ago, # ^ |   +7 "i believe oneday you will be a red coder" — done! ;)Thanks for your belief in me!
 » 5 years ago, # |   +1 Are there maxtests in pretests? Will all those solutions pass?
•  » » 5 years ago, # ^ | ← Rev. 2 →   +5 How do you "check" ? by doing all pair shortest paths specialized for a tree ?EDIT: sorry comment was meant for your MST post for problem D !
•  » » » 5 years ago, # ^ |   +8 yes, checking all shortest pathes by running n dfs's
 » 5 years ago, # |   +3 How is problem D supposed to be solved?
•  » » 5 years ago, # ^ |   +25 I found MST and then check if its correct answer.
•  » » » 5 years ago, # ^ |   0 What algorithm did you use to find MST ?
•  » » » » 5 years ago, # ^ |   +8 I used Prim's algo, but I believe Kruskal's algo will do too.
•  » » » » » 5 years ago, # ^ |   0 Can you please tell me what do you exactly mean by "check if its correct answer." after finding the MST?
•  » » » » » » 5 years ago, # ^ |   +1 Check that all pairwise distances are correct. It could be done in plenty of ways, I used dfs from each vertex.
•  » » » 5 years ago, # ^ |   0 How did you find MST ? How did you derived edges from the distance matrix ?
•  » » 5 years ago, # ^ |   0 There are many ways. For example, if you pick vertices i, j, then you can recover the path between them: k is on this path iff D[i][j] = D[i][k] + D[j][k]; sorting by D[i][k] gives their order on the path. This way, if you pick i as the root and try all j, k, you have all supposed edges and are left with checking their treety.
 » 5 years ago, # |   +3 Okay, I'm probably going to hang myself, but what was the idea for B ? I just didn't get it...
•  » » 5 years ago, # ^ |   0 I use this: try to send people to top floor first and use any spare capacity for the floors below. continue same downwards
•  » » 5 years ago, # ^ |   0 the idea is that you have to move to the highest floor ... so it makes sense to make a greedy approach : pick the highest k people (Fi) and transport them and come back and do the same thing again ...
•  » » 5 years ago, # ^ |   0 Okay, now I know why I didn't get it... I just didn't realize that 1st floor is really 1st, i. e. floors are not 0-based! And it was written in the statement like bazillion times and I was just wondering how they got the answers to the samples... goodbye cruel world :D
 » 5 years ago, # |   +25 Are there any rules which forbid using inline assembler in C/C++ code? With it, problem G becomes super-easy...
•  » » 5 years ago, # ^ |   0 I might get a lot of downvotes for this, but I don't see which assembler magic you can use to make the brute-force approach viable, (if thats what you mean by super-easy...)
•  » » » 5 years ago, # ^ |   +24 Compute bit count via SSE3. (I'd like to note that even without assembler magic, __builtin_popcount results in ~7.9s for the worst case; but SSE3 bitcount results in <3s).
•  » » » » 5 years ago, # ^ |   +17 Good job ilyakor!I have tested builtin_pop_count() and made sure it will fail. But it turns out many people uses cnt[x<<16] + cnt[x>>16] and passed.I think I should learn more knowledge about low level computer science, like assembler.
•  » » » » » 5 years ago, # ^ |   +3 More faster way is splitting 64-bit long long on 4 16-bit shorts.
 » 5 years ago, # |   +6 It was difficult to hack in this round :(
 » 5 years ago, # |   0 Wonder how long System Tests are going to take with so many people and 7 problems...
 » 5 years ago, # |   +16 worse'll increase +inf i think
•  » » 5 years ago, # ^ |   +30 My standing is after worse.Am I worst? T_T
•  » » » 5 years ago, # ^ |   0 And my ranking, too :D
 » 5 years ago, # |   0 Can anyone please tell how to hack a code with code generator .
•  » » 5 years ago, # ^ |   +8 If your test case is too large, for example it has over 100 inputs, you can write a code to generate your test case, then codeforces compile your code and give the output to the selected code for hack.
•  » » 5 years ago, # ^ |   0 I tried to write max_tests with code generator, but did not success. Write 105 integers from 1 to 105 by hands would take to me more than 2,5 hours.
•  » » » 5 years ago, # ^ |   0 do u mean 105?
 » 5 years ago, # | ← Rev. 3 →   +5 http://codeforces.ru/blog/entry/14028 Editorial.
 » 5 years ago, # |   0 How to solve B?
•  » » 5 years ago, # ^ |   0 sort and greedy
 » 5 years ago, # |   +1 worse is going to jump pretty high, i guess :)
•  » » 5 years ago, # ^ |   0 He got AC on A,B,C so far. Wait for D
•  » » » 5 years ago, # ^ |   0 now D also!
•  » » 5 years ago, # ^ |   +15 Today, worse goes up and tourist goes down...must be opposite day!
•  » » » 5 years ago, # ^ |   +13
•  » » » » 5 years ago, # ^ |   0 LOOOOOL :D
 » 5 years ago, # |   +34 I am more interested to see rating change of worse than mine :)
•  » » 5 years ago, # ^ |   0 i don't think he will become higher than Newbie.
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +14 If there is a bug in rating system, he might overshoot tourist :P
•  » » 5 years ago, # ^ |   0 Maybe when you reach negative rating and white color, you will never have it possitive?
 » 5 years ago, # |   0 How to solve C? I submitted a solution which passed pretests but I am afraid that it will fail systests.
•  » » 5 years ago, # ^ | ← Rev. 3 →   0 Greedy. Take the minimum of 1st string according to given permutations.set flag=0Then go to all other permutations in given order and take minimum of them which is greater than the first string and make it as the current string If none of the names now has string greater than current string then break the loop and answer is NO so set a flag=1 else make current string as lower of the two strings of a permutation and do next iterationif(flag) ans=NOelse answer is YES
 » 5 years ago, # |   +4 he is lucky :P submission: 7999344
•  » » 5 years ago, # ^ |   0 Isn't it correct ?
•  » » » 5 years ago, # ^ | ← Rev. 2 →   +3 when n%k equals 0, he is accessing p[-1].
•  » » » » 5 years ago, # ^ | ← Rev. 2 →   0 p[-1] is equal to zero when p is global Because I neglected this fact I made an unsuccessful hack today
•  » » » » » 5 years ago, # ^ |   +5 it's UB not depending on globalness of array.
•  » » » » » » 5 years ago, # ^ |   0 Sorry for getting the fact wrong. What does UB mean by the way ?
•  » » » » » » » 5 years ago, # ^ |   -31 unexpected behavior
•  » » » » » » » 5 years ago, # ^ |   +48 Undefined behavior.
 » 5 years ago, # | ← Rev. 3 →   +3 That's feeling, when you know that your n^3 solution won't pass system testing, but you steel can not stop hoping :|
 » 5 years ago, # |   +3 i tried hacking 8002822 with n = 17, but the code (correctly) returned 8, 9 as output. can anybody explain how?
•  » » 5 years ago, # ^ |   0 I don't know why...It's strange because 8>=n/2 and he have i
•  » » » 5 years ago, # ^ |   0 it's even more puzzling because i successfully hacked 7998356 with the same input n = 17.
•  » » » » 5 years ago, # ^ |   +8 When the round started I was a bit excited to be in the same room with you, since I've noticed you're active and known in the community and also I participated in #258. But then i got disappointed when you hacked me ~10 minutes before the end, when my solution was locked (all because of a missing '=' sign).Nice find though. :)
•  » » » » » 5 years ago, # ^ |   +1 glad to know that i'm atleast a little "famous" :D
•  » » 5 years ago, # ^ |   +3 Well, he reads from not unitialized variable and it's UB(may work in any way), probably it's optimized in that way that a and i are effectively the same variable, because in any correct case(when there's no UB) a and i are equal
•  » » 5 years ago, # ^ |   0 compile this code with clang++ and g++, got two random numbers 8015726
•  » » » 5 years ago, # ^ |   0 did you use -O2 ?
•  » » » » 5 years ago, # ^ |   0 no, I didn't usewith -O2 output is 0 17 with g++ and 8 9 with clang++
•  » » » » 5 years ago, # ^ |   -8 In case anyone's wondering, this page lists the flags used by the compilers on CF. As for "-O2" flag, this manual explains what the flag does. In short: it's a 2nd level optimization.
•  » » » 5 years ago, # ^ |   +11 never use doubles with no eps.never use doubles if int is enough. j*j <= i
 » 5 years ago, # |   +11 D problem was very pleasant for me. After a hour of thinking (and that's what I like) I discovered how to solve it, but sadly I wasn't able to implement a correct solution. Thanks for round!
 » 5 years ago, # |   +8 Petr won this round with a nice margin!
 » 5 years ago, # | ← Rev. 3 →   -6 delete
 » 5 years ago, # |   +1 Can anybody tell me why this solution of mine Timed out. But this got accepted. The first one used scanf to read inputs. The second used cin with sync_with_stdio(false). I assumed both of them are comparable in the time it takes.
•  » » 5 years ago, # ^ |   0 1964 ms is just a question of luck. Just for experiment — try to add cin.tie(NULL) in the second code.
•  » » » 5 years ago, # ^ |   0 Adding that Gave a TLE(http://codeforces.com/contest/472/submission/8016199)
•  » » » » 5 years ago, # ^ |   0 Well, the experiment was failed) I saw that sort = TL but stable_sort = AC, so it's better to write codes that far from TL)
 » 5 years ago, # |   +18 One of the best rounds I've ever participated. Congrats!
•  » » 5 years ago, # ^ |   +5 My rank of contest is R = 2^A + Q where A is a count of my accepted solutions Q is a quality of problemsdidn't you noticed smth like this? :D
 » 5 years ago, # |   0
 » 5 years ago, # |   +3 An identical problem to B was used a few weeks ago in a URI Online Judge contest. Link
•  » » 5 years ago, # ^ |   +4 I have access to the identical problem in Polygon, it's too easy to be unique
•  » » » 5 years ago, # ^ |   0 Even being an easy problem, it's cool to solve. It was a good choice.
 » 5 years ago, # |   +12 I really enjoyed the problems, the mixed divisions was a great idea, as the problems were approachable for both divisions users. Thanks for the great contest.
 » 5 years ago, # |   0 Problem D is one of the most hard problems that I ever sent on contests (if do not take into account that I have copypasted code for DSU and Dijkstra from emaxx:)) ). Thanks for interesting problem D and interesting stories about problem creating:)
 » 5 years ago, # |   +18 When ratings will be updated?
 » 5 years ago, # |   +5 @admins Please can anyone tell the approx time it would take for rating update ? If it is >= 30 mins I will go to sleep :p
 » 5 years ago, # |   +83 Actually, the contest was not balanced. It doesn't deserve +537, too bad that I had voted it before it started. Three easy straightforward problems that almost everyone solved, one problem that requires to think a bit, and three very complicated ones. Many people were doing nothing after they had solved D. Problem E should have been replaced.
•  » » 5 years ago, # ^ |   +1 C should have been harder too . A , B , C were very easy but the jump from C to D was large for low-skilled people like me . So most of the people were able to solve all A,B,C and the ranking was solely determined by speed .
•  » » » 5 years ago, # ^ |   +3 Not only by speed! Don't forget about hacks!
•  » » » » 5 years ago, # ^ |   +10 Oh, of course! Can you imagine how I enjoyed almost 2-hour searching for that s1.compareTo(s2) <= 1 in problem C?
•  » » » 5 years ago, # ^ | ← Rev. 3 →   +18 It was pretty much a div1+div2 round, but with 2xD instead of C+D. That's why 3 easy problems — div2 A,B,C.I would've removed G and put an easier problem after D.Alternatively, there's a nice hack that shouldn't remove the main point from F and makes the code much less tricky: providing additional 64 registers whose values at the end don't matter.
•  » » 5 years ago, # ^ |   +9 Yes you are right. I found E is hard to implement few days ago, but I don't have another task to replace at that moment. Maybe we should swap E and F and don't allow x[i]^=x[i] in F (then it will be much easier: we can get 2 same bases).I tried to made first 2 tasks as easy as possible. (There are 7 tasks, so if you only solve 1 you will kind of feel sad, right.)For C and D, I think the difficulty is fine.
•  » » » 5 years ago, # ^ | ← Rev. 3 →   +13 What about my trick of using additional 64 (or any other power of 2 that doesn't give away much from the solution) registers? You can simply copy the base to them and get rid of a troublesome chunk of code.That is, at least my solution would be much easier :D
•  » » » » 5 years ago, # ^ |   0 Yes, I was thought about add a constraints like n >= 100 (so it will give you 32 registers after Gaussian elimination) , but it will be a bit strange.
•  » » » » » 5 years ago, # ^ |   0 That constraint probably wouldn't do the trick I have in mind.The point is that when you have the base copied into separate registers and in reduced form (dunno if that's the right term, the one where pivot 1s are unique on their columns), constructing a vector from them (in a separate variable) is extremely easy. So when you have the idea, there's just textbook GEM and that left.It does look a bit strange, but it can always be wrapped in a surrealistic story :D and would most likely increase the number of successful solutions.
•  » » » » » » 5 years ago, # ^ |   -11 I don't understand your reply. Since we are dealing with vectors of length <=32, rank of that matrix was <=32 and n>=100 will imply that after reducing whole matrix you will have at least n-rank>=n-32>=68>=32>=rank free registers where you can copy base and do what you have described. In the end you get rid of that copied base. Either you didn't realize what I wrote or I don't understand why that constraint wouldn't do the trick.
•  » » » » » » » 5 years ago, # ^ | ← Rev. 3 →   0 Because these vectors will have to be edited eventually, and that'll mean you don't necessarily have a base in reduced form at some point. Think how easy it is to construct a vector from such a base.You don't "get rid" of the copied base, you still need to convert its vectors to desired ones (in y).
•  » » » » » » » » 5 years ago, # ^ |   0 1) Reduce Xs to base 2) Reduce Ys to base (and put those operations in the end in reversed order) 3) Copy base of X to registers with indices n-rank_x+1, ..., n 4) Erase base of X from registers with indices 1, ..., rank_x 5) Create Ys base in registers with indices 1, ..., rank_y using that copied base of X 6) Erase copied base of XWhat is troublesome here? You don't need here any no longer needed vectors from base of X to newly created vectors from base of Y
•  » » » » » » » » » 5 years ago, # ^ | ← Rev. 3 →   0 Okay, with real separate registers: reduce X to base copy base to registers xor each vector of Y with all necessary vectors of the base You don't actually need a lot of ideas this way — no need to care about x[i]^x[i], no need to put GEM of Y in reverse order, you don't need swaps at all... I don't know if it wouldn't make the problem too easy, because there's almost no difficulty in implementation.
•  » » » » » » » » » 5 years ago, # ^ |   0 Hm, okay, that is a difference, but I think that this difference between what I proposed and what I proposed is 5 times smaller than between what I proposed and between actual solution xd.It is true that my way demands doing operations on Y and to that we need idea of reversing which wasn't obvious for me that we can do this, but the most important thing is that we don't need to erase vectors from base X while deriving vectors from Y, what was really painful for me — we can use whole base of X all the time.
•  » » » » » » » » » 5 years ago, # ^ |   0 difference between what I proposed and what I proposed Undoubtedly :DSince I expressed the vectors of Y in the base of X, moving from one base to another became just like moving from the canonical base to another. And that's quite trivial.
•  » » » » » » » » » 5 years ago, # ^ |   0 OK, so you got base X and want to create base Y. You create first vector from base Y — name it y1. You have to put it somewhere, e.g. in a place of first vector from base X — name it x1. But if you needed x1 to be able to derive other vector from base Y you will have to reuse y1! And that will be OK only in case when y1 included x1 — in opposite case we are already screwed! So we have to care about what we are replacing also. How are you dealing with that problem?
•  » » » » » » » » » 5 years ago, # ^ |   0 Imagine it in matrix form: you start with an identity matrix (base X) and want to create a different matrix (base Y expressed in base X) by standard operations "xor i-th row by j-th". The matrix is in (this is the term) reduced row echelon form, because GEM. It should be pretty obvious by now.Also, if x[i]^x[i] is not permitted, then you still need to get to reduced row echelon form with the base of Y, by sorting rows — or state that it's impossible.
•  » » » 5 years ago, # ^ |   0 I think it would be the best choice to forbid x[i]^=x[i], make it worth 2500 pts instead of 3000 pts and swap E and F. Main ideas will still be included and we won't need anymore pretty ugly piece of code and have much more AC what won't cause such a big jump of difficulty between ABCD and EFG.It is true that we will lose not that obvious part also demanding some thinking, but sometimes it is better to give up on significant issue, because task will become less enjoyable and won't gain interest of number of people which it deserve. I learnt that once when I proposed really nice and pretty hard problem for Polish OI, but I included a bit of geometry in it and people were afraid of that even though that geometry part was pretty easy. It ended with 0 ACs, nobody even knew how to solve it, because people were omitting this task. You can see this task here: http://main.edu.pl/en/archive/oi/21/lam (though it doesn't have english version, maybe translators can do the trick).
•  » » » » 5 years ago, # ^ | ← Rev. 2 →   +3 Depends on the implementation — for me, that "ugly piece of code" is 3 lines when expressing Y in the base of X.
•  » » » » » 5 years ago, # ^ |   0 When we will forbid x[i]^=x[i], reduced bases of X and Y will have to be exactly the same. That will make whole problem much easier. I somehow don't believe that it caused a 3lined difference in your code. In my code 8018580, I wouldn't longer need that last long for loop (that starting with "for (int i = 1; i <= st_y — 1; i++) {") which caused me much more trouble than everything else here.
•  » » » » » » 5 years ago, # ^ |   +3 Codes are public, so it's not really a question of believing :D8018626, lines (originally 3): for(int i =0; i < m; i++) { for(int j =0; j < i; j++) if(M[j][i]) ans.push_back(make_pair(B[j],B[i])); if(!M[i][i]) ans.push_back(make_pair(B[i],B[i]));} If that operation was not permitted, I could've omitted only these 3 lines.
•  » » » » » » » 5 years ago, # ^ |   0 Sorry to say that, but ugh, your solution looks pretty complicated and completely impossible to read, because of incredibly ugly indentation. First for loop after comment "//base" looks really ridiculous, because of places where "}" are put inside it. Is that an effect of some changes in your code while uploading it? I won't believe that it can be your standard coding style.If we will forbid x[i] ^= x[i] problem will be like: Reduce X Reduce Y Check if they are exactly the same and if so then print already generated result.
•  » » » » » » » » 5 years ago, # ^ |   0 Some parts of it are unnecessary, but that's unrelated to the x[i]^x[i] problem.Yes, that's my standard writing style — do you think CF would remove selected indents on upload in my code only? I can't read the style with 1 } on each line and not indented the same way as the loop it completes, so I understand that others can't read mine — but what do I care in a contest?
 » 5 years ago, # | ← Rev. 4 →   +7 i think worse today will cause unexpected behavior for code-forces rating system. :-Dbtw he was in my room.[http://codeforces.com/contest/472/room/131]
 » 5 years ago, # |   +17 Why was the time limit of D so tight? Even n^2logn solutions got TLE.
•  » » 5 years ago, # ^ |   0 Yes, it is true :(((.
•  » » 5 years ago, # ^ |   0 n^2 log(n) passed!this is mine
•  » » » 5 years ago, # ^ |   +6 thats 1.8 seconds in C++. Think about the java users.
 » 5 years ago, # |   -9 you are very good and smart!good boy,so cute~sorry my enlish is bad,hope you can understand.I don't want tell you I lost my sleep and very boring and don't known what I say,why me is so foolish ..TAT...hhhhhhhhhh,good luck and good night:D
•  » » 5 years ago, # ^ |   0 it's time to sleep
•  » » » 5 years ago, # ^ |   +5 I should running in morning in 1 hour..too sad:(
 » 5 years ago, # |   +5 Talking about records... (which I mentioned here http://codeforces.com/blog/entry/13997#comment-189548). I thought that I may have just experienced the biggest drop of rating in whole Codeforces history (-132), but it turned out that tourist got such hopeless place — 21st and got -135 to rating :P. In regular Div1 contest, not joint with Div2, it is impossible to fall below -110 even if tourist would get last place :P.Frankly saying, I prefer regular round than those joint ones. Additional easy A and B cause that they are worth 500 and 1000 and other tasks are each worth additional 1000 and in that case having standard D (here F) accepted in second hour is worth less than standard B (here D) accepted pretty quickly. That is obviously bad feature.
 » 5 years ago, # |   +80 worse only got +319...
•  » » 5 years ago, # ^ |   0 me too :-(.
•  » » » 5 years ago, # ^ |   +4 You got -17 not +319 :>>
•  » » » » 5 years ago, # ^ |   +5 Hmm, I think he means that he's disappointed, too. :D
•  » » » » » 5 years ago, # ^ |   0 Do you really think that I didn't know this? This was a joke :P.
•  » » » » 5 years ago, # ^ |   0 I'm disapointed too.
•  » » 5 years ago, # ^ | ← Rev. 4 →   +1 I woudn't if this will be record, but unfortunetly no((( For example, avelino_2013 get +333, no_name_weak_vegetable(+426, just registered)
•  » » » 5 years ago, # ^ |   -18 See more on Know Your Meme.
•  » » 5 years ago, # ^ |   0 i'm even more disappointed that it was not even among the top 17 rating increases for this round! (reference: round stats by DmitriyH)
 » 5 years ago, # | ← Rev. 2 →   0 In problem D, I don't know why the first one is wrong and second one correct.d[u][v] = d[u][LCA] + d[LCA][v] --> WAd[u][v] = d[u][root] + d[v][root] - 2 * d[LCA][root] --> ACOh lala :'(
 » 5 years ago, # |   0 Anybody help figure out why my submission 8015497 of Problem D is wrong at test 9? Thx.
 » 5 years ago, # |   +9
•  » » 5 years ago, # ^ |   +9 Included it in the announcement.btw, congratulations for become master again!
•  » » » 5 years ago, # ^ |   +4 Thanks! :) And, certainly, thanks for the great round and interesting announcement!
 » 5 years ago, # | ← Rev. 5 →   +3 Because of really good pretests, short (and quite boring) describtion of hacks can be found here.
 » 5 years ago, # | ← Rev. 4 →   +6 Comment Deleted
 » 5 years ago, # |   +39 I had a problem during the contest.My id "techboy" had been shown twice in the list which leads to same id.I solved three problems with 1 WA and 1 AC in A,1 AC in B and 1 AC in C. But it was showing that one id has got 1 WA in A and 1 AC in B while another one got 1 AC in A and 1 AC in C. So in the end i got double negative rating and also was far below in the ranklist than the position I should be in.I need help as soon as possible :(
 » 5 years ago, # | ← Rev. 3 →   0 Comment Deleted
 » 5 years ago, # | ← Rev. 2 →   +9 I think cgy4ever in this competition put his name beside the names of all time big competitors... Just like in sample tests for problem C. :)


text:
Page 1 of 1

### Multiply and Simplify: 7a^7/5p^2 - 25p^6/49a

Posted: Mon May 04, 2009 6:19 am

Posted: Mon May 04, 2009 11:21 am
...multiply and simplify 7a^7/5p^2 - 25p^6/49a
What you've posted means the following:

. . . . .$\frac{7a^2}{5p^2}\, -\, \frac{25p^6}{49a}$

But this is a subtraction, not a multiplication.

$\frac{7a^2}{5p^2}\cdot \frac{-25p^6}{49a}$
$\frac{7a^2}{5p^2}\cdot \frac{-25p^6}{49a}$


text:
# Make first word in macro bold

I have the following use-case:

\cmd{cp \opt{r} \marg{from} \marg{to}}

This should typeset a UNIX command for a manual. I’d like the actual command (here, cp) to be typeset in bold while the rest of the command line is typeset normally. Now, I could obviously just write something along the following lines:

\cmd{\textbf{cp} \opt{r} \marg{from} \marg{to}}

… but I’d prefer if this were possible automatically. I thought of two approaches but cannot get either to work:

1. Make everything bold, cancel bold for nested commands:

\newcommand*\cmd[1]{%
\texttt{\textbf{#1}}
}
\newcommand*\opt[1]{%
\undobf{-#1}
}

… problem: how would \undobf look like? \textrm isn’t appropriate here since I need to preserve the tt style.

2. Define a TeX command containing a space in its arguments:

\newcommand*\cmd[1]{%
\texttt{\setcmd#1}
}
\def\setcmd#1 #2{%
\textbf{#1} #2
}

But this doesn’t work at all, probably because I’m botching the syntax. But even once the syntax is fixed, this still won’t work for cases where I provide no arguments/options for a command (e.g. \cmd{pwd}).

-
Should it only take one argument? With e.g. two arguments you could do something like \newcommand{\cmd}[2]{\textbf{#1} #2} –  Tom Bombadil Oct 14 '12 at 11:44
@Tom Hmpf. I should have seen that solution myself. I’d still prefer if TeX could parse the argument itself (in fact I also dislike the \opt and \marg macros and if I had more time and my TeX weren’t so rusty then I’d fix it so that the usage would be as follows: \cmd{cp -r from to} … but that’s a story for another day. –  Konrad Rudolph Oct 14 '12 at 12:01

One could use the usual TeX/LaTeX programming to decide if the first word has something after it and then choose the right branch.

With LaTeX3 functions it's much easier:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tgcursor} % clone of Courier

\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\cmd}{ m }
{
\krudolph_split_cmd:n { #1 }
}
\cs_new_protected:Npn \krudolph_split_cmd:n #1
{
\seq_set_split:Nnn \l__krudolph_cmd_seq { ~ } { #1 }
\seq_pop_left:NN \l__krudolph_cmd_seq \l__krudolph_cmd_tl
\group_begin:
\normalfont\ttfamily
\textbf{ \l__krudolph_cmd_tl } ~
\seq_use:Nnnn \l__krudolph_cmd_seq { ~ } { ~ } { ~ }
\group_end:
}
\seq_new:N \l__krudolph_cmd_seq
\tl_new:N \l__krudolph_cmd_tl
\ExplSyntaxOff

% missing definitions
\newcommand{\opt}[1]{-#1}
\newcommand{\marg}[1]{<#1>}

\begin{document}
\cmd{cp \opt{r} \marg{from} \marg{to}}

\cmd{pwd}
\end{document}

The argument is split at spaces; then the first element is detached for being printed in boldface; the rest is printed in medium weight, separated by spaces.

-
Hmm, before I can start using this I need to use LaTeX3. Ah well, that day will surely come. –  Konrad Rudolph Oct 15 '12 at 11:03

You had the syntax correct for (2) but if you look in the log file it probably said

LaTeX Font Info:    Font shape T1/cmtt/bx/n' in size <10> not available
(Font)              Font shape T1/cmtt/m/n' tried instead on input line 18.

That is, the standard TeX fonts don't have bold typewriter so although you correctly asked for that you got normal weight instead.

If you don't want cp to be in monospace I think you the following where you just add the grouping in your user command and switch to tt after the bold:

\documentclass{article}

\usepackage[T1]{fontenc}

\def\opt#1{{[#1]}}
\def\marg#1{{\char\{#1\char\}}}

\newcommand*\cmd[1]{{\setcmd#1 }}

\def\setcmd#1 {%
\textbf{#1} \ttfamily
}

\begin{document}

\cmd{cp \opt{r} \marg{from} \marg{to}}

\cmd{pwd}

\end{document}
-
Actually, I’m loading courier so the bold font is available. Sorry, I should have been more explicit in the error message, which is along the lines of “use of \setcmd doesn’t match its definition”. It works after using extra braces around the invocation, as in your example. However, it predictably still fails for \cmd{pwd}. –  Konrad Rudolph Oct 14 '12 at 11:53
That's why the MWE should always be a complete docuement. If you got that error (which I didn't when I ran your example) it was called when there was no explicit space in the input stream, if you need to make sure there is a space, so \newcommand*\cmd[1]{{\setcmd#1 }} with a space after #1. –  David Carlisle Oct 14 '12 at 14:07
I totally agree. I omitted the MWE because I wasn’t actually fishing for a correction of an error, I just wanted to show my thoughts about an approach, i.e. I’d considered my code as pseudo code rather than almost-working TeX. –  Konrad Rudolph Oct 15 '12 at 10:37


text:
Under the auspices of the Computational Complexity Foundation (CCF)

REPORTS > DETAIL:

### Paper:

TR21-177 | 22nd November 2021 00:27

#### Johnson Coverage Hypothesis: Inapproximability of k-means and k-median in $\ell_p$-metrics

TR21-177
Publication: 12th December 2021 06:57
Keywords:

Abstract:

k-median and k-means are the two most popular objectives for clustering algorithms. Despite intensive effort, a good understanding of the approximability of these objectives, particularly in $\ell_p$-metrics, remains a major open problem. In this paper, we significantly improve upon the hardness of approximation factors known in literature for these objectives in $\ell_p$-metrics.

We introduce a new hypothesis called the Johnson Coverage Hypothesis (JCH), which roughly asserts that the well-studied k-max coverage problem on set systems is hard to approximate to a factor greater than $1-\frac{1}{e}$, even when the membership graph of the set system is a subgraph of the Johnson graph. We then show that together with generalizations of the embedding techniques introduced by Cohen-Addad and Karthik (FOCS '19), JCH implies hardness of approximation results for k-median and k-means in $\ell_p$-metrics for factors which are close to the ones obtained for general metrics. In particular, assuming JCH we show that it is hard to approximate the k-means objective:

$\bullet$ Discrete case: To a factor of 3.94 in the $\ell_1$-metric and to a factor of 1.73 in the $\ell_2$-metric; this improves upon the previous factor of 1.56 and 1.17 respectively, obtained under the Unique Games Conjecture (UGC).

$\bullet$ Continuous case: To a factor of 2.10 in the $\ell_1$-metric and to a factor of 1.36 in the $\ell_2$-metric; this improves upon the previous factor of 1.07 in the $\ell_2$-metric obtained under UGC (and to the best of our knowledge, the continuous case of k-means in $\ell_1$-metric was not previously analyzed in literature).

We also obtain similar improvements under JCH for the k-median objective. Additionally, we prove a weak version of JCH using the work of Dinur et al. (SICOMP'05) on Hypergraph Vertex Cover, and recover all the results stated above of Cohen-Addad and Karthik (FOCS '19) to (nearly) the same inapproximability factors but now under the standard NP$\neq$P assumption (instead of UGC).

Finally, we establish a strong connection between JCH and the long standing open problem of determining the Hypergraph Turan number. We then use this connection to prove improved SDP gaps (over the existing factors in literature) for k-means and k-median objectives.

ISSN 1433-8092 | Imprint