Saturday Morning Breakfast Cereal - Self-Driving Car Ethics

http://ift.tt/29oCg5w



New comic!

Today's News:

Hey geeks-- we've been doing some testing and software stuff this week and it's created a lot of issues with bad ads and RSS feed bugs. We are working to get everything ironed out, but if you see something buggy, please let me know. If something has changed for the worse on your end, it is not intentional!



from Saturday Morning Breakfast Cereal http://ift.tt/gvqPHa
via IFTTT

Would You Survive the Titanic? A Guide to Machine Learning in Python

http://ift.tt/29eaiq8

What if machines could learn?  

This has been one of the most intriguing questions in science fiction and philosophy since the advent of machines. With modern technology, such questions are no longer bound to creative conjecture. Machine learning is all around us. From deciding which movie you might want to watch next on Netflix to predicting stock market trends, machine learning has a profound impact on how data is understood in the modern era.

This tutorial aims to give you an accessible introduction on how to use machine learning techniques for your projects and data sets. In just 20 minutes, you will learn how to use Python to apply different machine learning techniques — from decision trees to deep neural networks — to a sample data set. This is a practical, not a conceptual, introduction; to fully understand the capabilities of machine learning, I highly recommend that you seek out resources that explain the low-level implementations of these techniques.

Our sample dataset: passengers of the RMS Titanic. We will use an open data set with data on the passengers aboard the infamous doomed sea voyage of 1912. By examining factors such as class, sex, and age, we will experiment with different machine learning algorithms and build a program that can predict whether a given passenger would have survived this disaster.

Setting Up Your Machine Learning Laboratory

The best way to learn about machine learning is to follow along with this tutorial on your computer. To do this, you will need to install a few software packages if you do not have them yet:

There are multiple ways to install each of these packages. I recommend using the “pip” Python package manager, which will allow you to simply run “pip3 install <packagename>” to install each of the dependencies: http://ift.tt/1gmce2W.

For actually writing and running the code, I recommend using IPython (which will allow you to run modular blocks of code and immediately view the output values and data visualizations) along with the Jupyter Notebook as a graphical interface: https://jupyter.org.

You will also need the Titanic dataset that we will be analyzing. You can find it here: http://http://ift.tt/29q05ehDataSets/titanic3.xls.

With all of the dependencies installed, simply run “jupyter notebook” on the command line, from the same directory as the titanic3.xls file, and you will be ready to get started.

The Data at First Glance: Who Survived the Titanic and Why?

First, import the required Python dependencies.

Once we have read the spreadsheet file into a Pandas dataframe (imagine a hyperpowered Excel table), we can peek at the first five rows of data using the head() command.

The column heading variables have the following meanings:

  • survival: Survival (0 = no; 1 = yes)
  • class: Passenger class (1 = first; 2 = second; 3 = third)
  • name: Name
  • sex: Sex
  • age: Age
  • sibsp: Number of siblings/spouses aboard
  • parch: Number of parents/children aboard
  • ticket: Ticket number
  • fare: Passenger fare
  • cabin: Cabin
  • embarked: Port of embarkation (C = Cherbourg; Q = Queenstown; S = Southampton)
  • boat: Lifeboat (if survived)
  • body: Body number (if did not survive and body was recovered)

Now that we have the data in a dataframe, we can begin an advanced analysis of the data using powerful single-line Pandas functions. First, let’s examine the overall chance of survival for a Titanic passenger.

The calculation shows that only 38% of the passengers survived. Not the best odds. The reason for this massive loss of life is that the Titanic was only carrying 20 lifeboats, which was not nearly enough for the 1,317 passengers and 885 crew members aboard. It seems unlikely that all of the passengers would have had equal chances at survival, so we will continue breaking down the data to examine the social dynamics that determined who got a place on a lifeboat and who did not.

Social classes were heavily stratified in the early twentieth century. This was especially true on the Titanic, where the luxurious first-class areas were completely off limits to the middle-class passengers in second class, and especially to those who carried a third class “economy price” ticket. To get a view into the composition of each class, we can group data by class, and view the averages for each column:

We can start drawing some interesting insights from this data. For instance, passengers in first class had a 62% chance of survival, compared to a 25.5% chance for those in 3rd class. Additionally, the lower classes generally consisted of younger people, and the ticket prices for first class were predictably much higher than those for second and third class. The average ticket price for first class (£87.5) is equivalent to $13,487 in 2016.

We can extend our statistical breakdown using the grouping function for both class and sex:

While the Titanic was sinking, the officers famously prioritized who was allowed in a lifeboat with the strict maritime tradition of evacuating women and children first. Our statistical results clearly reflect the first part of this policy as, across all classes, women were much more likely to survive than the men. We can also see that the women were younger than the men on average, were more likely to be traveling with family, and paid slightly more for their tickets.

The effectiveness of the second part of this “Women and children first” policy can be deduced by breaking down the survival rate by age.

Here we can see that children were indeed the most likely age group to survive, although this percentage was still tragically below 60%.

Why Machine Learning?

With analysis, we can draw some fairly straightforward conclusions from this data — being a woman, being in 1st class, and being a child were all factors that could boost your chances of survival during this disaster.

Let’s say we wanted to write a program to predict whether a given passenger would survive the disaster. This could be done through an elaborate system of nested if-else statements with some sort of weighted scoring system, but such a program would be long, tedious to write, difficult to generalize, and would require extensive fine tuning.  

This is where machine learning comes in: we will build a program that learns from the sample data to predict whether a given passenger would survive.

Preparing The Data

Before we can feed our data set into a machine learning algorithm, we have to remove missing values and split it into training and test sets.  

If we perform a count of each column, we will see that much of the data on certain fields is missing. Most machine learning algorithms will have a difficult time handling missing values, so we will need to make sure that each row has a value for each column.

Most of the rows are missing values for “boat” and “cabin”, so we will remove these columns from the data frame. A large number of rows are also missing the “home.dest” field; here we fill the missing values with “NA”. A significant number of rows are also missing an age value. We have seen above that age could have a significant effect on survival chances, so we will have to drop all of rows that are missing an age value. When we run the count command again, we can see that all remaining columns now contain the same number of values.

Now we need to format the remaining data in a way that our machine learning algorithms will accept.

The “sex” and “embarked” fields are both string values that correspond to categories (i.e “Male” and “Female”) so we will run each through a preprocessor. This preprocessor will convert these strings into integer keys, making it easier for the classification algorithms to find patterns. For instance, “Female” and “Male” will be converted to 0 and 1 respectively. The “name”, “ticket”, and “home.dest” columns consist of non-categorical string values. These are difficult to use in a classification algorithm, so we will drop them from the data set.

Next, we separate the data set into two arrays: “X” containing all of the values for each row besides “survived”, and “y” containing only the “survived” value for that row. The classification algorithms will compare the attribute values of “X” to the corresponding values of “y” to detect patterns in how different attributes values tend to affect the survival of a passenger.

Finally, we break the “X” and “y” array into two parts each — a training set and a testing set. We will feed the training set into the classification algorithm to form a trained model. Once the model is formed, we will use it to classify the testing set, allowing us to determine the accuracy of the model. Here we have have made a 20/80 split, such that 80% of the dataset will be used for training and 20% will be used for testing.

Classification – The Fun Part

We will start off with a simple decision tree classifier. A decision tree examines one variable at a time, and splits into one of two branches based on the result of that value, at which point it does the same for the next variable. A fantastic visual explanation of how decision trees work can be found here: http://ift.tt/1IBOGTO.

This is what a trained decision tree for the Titanic dataset looks like, if we set the maximum number of levels to 3:

machine learning

The tree first splits by sex, and then by class, since it has learned during the training phase that these are the two most important features for determining survival. The dark blue boxes indicate passengers who are likely to survive, and the dark orange boxes represent passengers who are almost certainly doomed. Interestingly, after splitting by class, the main deciding factor determining the survival of women is the ticket fare that they paid, while the deciding factor for men is their age (with children being much more likely to survive).

To create this tree, we first initialize an instance of an untrained decision tree classifier. (Here we will set the maximum depth of the tree to 10). Next we “fit” this classifier to our training set, enabling it to learn about how different factors affect the survivability of a passenger. Now that the decision tree is ready, we can “score” it using our test data to determine how accurate it is.

The resulting reading, 0.7703, means that the model correctly predicted the survival of 77% of the test set. Not bad for our first model!

If you are being an attentive, skeptical reader (as you should be), you might be thinking that the accuracy of the model could vary depending on which rows were selected for the training and test sets. We will get around this problem by using a shuffle validator.  

This shuffle validator applies the same random 20:80 split as before, but this time it generates 20 unique permutations of this split. By passing this shuffle validator as a parameter to the “cross_val_score” function, we can score our classifier against each of the different splits, and compute the average accuracy and standard deviation from the results.

The result shows that our decision tree classifier has an overall accuracy of 77.34%, although it can go up to 80% and down to 75% depending on the training/test split. Using scikit-learn, we can easily test other machine learning algorithms using the exact same syntax.

The “Random Forest” classification algorithm will create a multitude of (generally very poor) trees for the data set using different random subsets of the input variables, and will return whichever prediction was returned by the most trees. This helps to avoid “overfitting”, a problem that occurs when a model is so tightly fitted to arbitrary correlations in the training data that it performs poorly on test data.

The “Gradient Boosting” classifier will generate many weak, shallow prediction trees and will combine, or “boost”, them into a strong model. This model performs very well on our data set, but has the drawback of being relatively slow and difficult to optimize, as the model construction happens sequentially so it cannot be parallelized.

A “Voting” classifier can be used to apply multiple conceptually divergent classification models to the same data set and will return the majority vote from all of the classifiers. For instance, if the gradient boosting classifier predicts that a passenger will not survive, but the decision tree and random forest classifiers predict that they will live, the voting classifier will chose the latter.

This has been a very brief and non-technical overview of each technique, so I encourage you to learn more about the mathematical implementations of all of these algorithms to obtain a deeper understanding of their relative strengths and weaknesses. Many more classification algorithms are available “out-of-the-box” in scikit-learn and can be explored here: http://ift.tt/29j3F7d.  

Computational Brains — An Introduction to Deep Neural Networks

Neural networks are a rapidly developing paradigm for information processing based loosely on how neurons in the brain processes information. A neural network consists of multiple layers of nodes, where each node performs a unit of computation and passes the result onto the next node. Multiple nodes can pass inputs to a single node and vice versa.

The neural network also contains a set of weights, which can be refined over time as the network learns from sample data. The weights are used to describe and refine the connection strengths between nodes. For instance, in our Titanic data set, node connections transmitting the passenger sex and class will likely be weighted very heavily, since these are important for determining the survival of a passenger.  

By Glosser.ca, CC BY-SA 3.0, source: http://ift.tt/29q07CV

A Deep Neural Network (DNN) is a neural network that works not just by passing data between nodes, but by passing data between layers of nodes. Each layer of nodes is able to aggregate and recombine the outputs from the previous layer, allowing the network to gradually piece together and make sense of unstructured data (such as an image). Such networks can also be heavily optimized due to their modular nature, allowing the operations of each node layer to be parallelized en masse across multiple CPUs and even GPUs.

We have barely begun to skim the surface of explaining nueral networks. For a more in depth explanation of the inner workings of DNNs, this is a good resource: http://ift.tt/1Kizco0.

This awesome tool allows you to visualize and modify an active deep neural network: http://ift.tt/20zEYX6.

The major advantage of neural networks over traditional machine learning techniques is their ability to find patterns in unstructured data (such as images or natural language). Training a deep neural network on the Titanic data set is total overkill, but it’s a cool technology to work with, so we’re going to do it anyway.

An emerging powerhouse in programing neural networks is an open source library from Google called TensorFlow. This library is the foundation for many of the most recent advances in machine learning, such as being used to train computer programs to create unique works of music and visual art (http://ift.tt/1UvEbUI). The syntax for using TensorFlow is somewhat abstract, but there is a wrappercalled “skflow” in the TensorFlow package that allows us to build deep neural networks using the now-familiar scikit-learn syntax.

Above, we have written the code to build a deep neural network classifier. The “hidden units” of the classifier represent the neural layers we described earlier, with the corresponding numbers representing the size of each layer.  

We can also define our own training model to pass to the TensorFlow estimator function (as seen above). Our defined model is very basic. For more advanced examples of how to work within this syntax, see the skflow documentation here: http://ift.tt/29q06Pu.

Despite the increased power and lengthier runtime of these neural network models, you will notice that the accuracy is still about the same as what we achieved using more traditional tree-based methods. The main advantage of neural networks — unsupervised learning of unstructured data — doesn’t necessarily lend itself well to our Titanic dataset, so this is not too surprising.  

I still, however, think that running the passenger data of a 104-year-old shipwreck through a cutting-edge deep neural network is pretty cool.

These Are Not Just Data Points. They’re People.

Given that the accuracy for all of our models is maxing out around 80%, it will be interesting to look at specific passengers for whom these classification algorithms are incorrect.

The above code forms a test data set of the first 20 listed passengers for each class, and trains a deep neural network against the remaining data.  

Once the model is trained we can use it to predict the survival of passengers in the test data set, and compare these to the known survival of each passenger using the original dataset.

The above table shows all of the passengers in our test data set whose survival (or lack thereof) was incorrectly classified by the neural network model.

Sometimes when you are dealing the data sets like this, the human side of the story can get lost beneath the complicated math and statistical analysis. By examining passengers for whom our classification model was incorrect, we can begin to uncover some of the most fascinating, and sometimes tragic, stories of humans defying the odds.

For instance, the first three incorrectly classified passengers are all members of the Allison family, who perished even though the model predicted that they would survive. These first class passengers were very wealthy, as can be evidenced by their far-above-average ticket prices. For Betsy (25) and Loraine (2) in particular, not surviving is very surprising, considering that we found earlier that over 96% of first class women lived through the disaster.  

machine learning

From left to right: Hudson (30), Bess (25), Trevor (11 months), and Loraine Allison (2)

So what happened? A surprising amount of information on each Titanic passenger is available online; it turns out that the Allison family was unable to find their youngest son Trevor and was unwilling to evacuate the ship without him. Tragically, Trevor was already safe in a lifeboat with his nurse and was the only member of the Allison family to survive the sinking.

Another interesting misclassification is John Jacob Astor, who perished in the disaster even though the model predicted he would survive. Astor was the wealthiest person on the Titanic, an impressive feat on a ship full of multimillionaire industrialists, railroad tycoons, and aristocrats. Given his immense wealth and influence, which the model may have deduced from his ticket fare (valued at over $35,000 in 2016), it seems likely that he would have been among of the 35% of men in first class to survive. However, this was not the case: although his pregnant wife survived, John Jacob Astor’s body was recovered a week later, along with a gold watch, a diamond ring with three stones, and no less than $92,481 (2016 value) in cash.

machine learning

John Jacob Astor IV

machine learning

Olaus Jorgensen Abelseth

On the other end of the spectrum is Olaus Jorgensen Abelseth, a 25-year-old Norwegian sailor. Abelseth, as a man in 3rd class, was not expected to survive by our classifier. Once the ship sank, however, he was able to stay alive by swimming for 20 minutes in the frigid North Atlantic water before joining other survivors on a waterlogged collapsible boat and rowing through the night. Abelseth got married three years later, settled down as a farmer in North Dakota, had 4 kids, and died in 1980 at the age of 94.

Initially I was disappointed by the accuracy of our machine learning models maxing out at about 80% for this data set. It’s easy to forget that these data points each represent real people, each of whom found themselves stuck on a sinking ship without enough lifeboats. When we looked into data points for which our model was wrong, we can uncover incredible stories of human nature driving people to defy their logical fate. It is important to never lose sight of the human element when analyzing this type of data set. This principle will be especially important going forward, as machine learning is increasingly applied to human data sets by organizations such as insurance companies, big banks, and law enforcement agencies.

What next?

So there you have it — a primer for data analysis and machine learning in Python. From here, you can fine-tune the machine learning algorithms to achieve better accuracy on this data set, design your own neural networks using TensorFlow, discover more fascinating stories of passengers whose survival does not match the model, and apply all of these techniques to any other data set. (Check out this Game of Thrones dataset: http://ift.tt/29j42i2). When it comes to machine learning, the possibilities are endless and the opportunities are titanic.

WRITTEN BY



from Hacker News http://ift.tt/YV9WJO
via IFTTT

Something "Unexpected" Happened After Starbucks Raised Minimum Wages

http://ift.tt/29boCoe

One year ago, when the political push to raise the minimum wage hit a crescendo, the CEO of Starbucks had some words of caution. Howard Schultz told CNN that minimum wage "should go up across the country", however he warned that "it will be very difficult for small business in the country at a $15 level to pay those kinds of wages." What about for his own company? "For Starbucks come January 1 we are taking wages up across the country and we will pay above the minimum wage in every state we operate. Starbucks is way above the minimum wage. I have always looked at total compensation.

His conclusion: "I have always believed that our success as a company is best shared."

 

One year later, something "unexpected" has happened as a result of the Schultz' all too eager push to "share" his company's success by hiking minimum wages, namely the realization by the company's employees (if not so much the CEO, management and certainly shareholders) that total compensation is a function of two things: hourly wages and number of hours worked.

As Reuters reports, an online petition accusing Starbucks of "extreme" cutbacks in work hours at its U.S. cafes, hurting both employee morale and customer service, has been signed by more than 9,000 people. Suddenly Starbucks' eagerness to raise its wages becomes all too clear: after all, it would merely have to reduce work hours, to keep profitability humming.

The world's biggest coffee chain, trying to address cooling growth at its U.S. shops, recently introduced technology that allows customers to order and pay from mobile devices. That service aims to boost sales and reduce bottlenecks in stores; it also aims to reduce work hours. 

In short: Starbucks is finding itself in a sales and profit squeeze (its shares have gone nowhere for the past year), and having been such a fervent supporter of minimum wage hikes, is now far less willing to "share" its success as a company, especially if it means a stagnant stock price for the foreseeable future.

Starbucks CEO Howard Schultz and other top brass have spoken with Jaime Prater, a Southern California barista and the online petition's creator, the Seattle-based company said. It declined to give details but Starbucks spokeswoman Jaime Riley said it is not uncommon for Schultz to reach out to members of its 160,000-strong U.S. workforce. She said that Starbucks has a software system that determines labor needs based on business trends.

In which case, one wonders what the company's attempt to squeeze out every last penny from the bottom line by implementing "extreme" cutbacks to work hours says about business trends in the US, and the economy in general.

But back to the disgruntled employees who don't share Schultz' optimism that this is all merely orindary course of business. Comments on the petition painted a picture of broad discontent at the company known for offering better wages and benefits than other chains, including healthcare coverage, retirement account contributions and paid vacation days.

Prater and many signers say they noticed cutbacks in U.S. staffing hours after Starbucks in April reported a deceleration in quarterly cafe sales growth. Several of them said store managers were under pressure to comply with the dictates of Starbucks' software system.

Translated: boost profits by reducing overall pay.

Almost 7,000 signers of the petition described themselves as employees, according to Prater. They did not give their full names and Reuters was not immediately able to confirm that signers worked for Starbucks. 

"The labor situation has gone from tight to infuriating," Prater said.

One central California store has seen its labor allotment shrunk by about 10 percent, even though sales are up, its manager, who asked not to be identified for fear or reprisal, told Reuters. Similar complaints were heard from many signers of the online petition.

"No matter what we do to save on labor at my store, the system tells us EVERY SINGLE DAY that we are at least 8 hours over in labor for the day and have to cut even more," wrote signer Aaron I. "We're suffering, & so are our customers. It's not working," wrote Leslie S, a self-described shift manager.

But... just one year ago an euphoric Howard Schultz said he was so eager to raise minimum wages. What he forgot to add is that he is just as eager to cut work hours if it means preserving profitability.

"Mobile orders have increased sales and created more need for labor, yet the company is cutting labor," wrote Makenna S, a shift supervisor.

And the punchline: like other restaurants and retail companies, Starbucks is wrestling with the effects of local minimum wage increases. Some petitioners said Starbucks had not boosted pay for existing workers in areas where minimum wages have increased - creating a situation where new hires are paid about the same wage as more experienced peers.

The longer we look at it, the more it appears that the CEO was not exactly genuine in his enthusiastic support for minimum wages.

As for the cherry on top: some employees said take-home pay had also taken a hit because tipping has fallen substantially amid broad customer adoption of the "Starbucks Rewards" program, which allows customers to pay with a loyalty card or mobile phones. 

* * *

And just like that, the grim picture of the "minimum wage hike effect" is starting to be appreciated by all, and explains why over the past few months even the BLS has reported that average work hours have been shrinking, incidentally something we warned about over a year ago when the topic of minimum wage increases first emerged. Because as was obvious all along, the simple math is that as mandatory wages rise, there is far less "success" to be shared.

To be sure Starbucks is neither the first nor the last corporation to show its true colors. One year ago we reported that "Economics 102: WalMart Cuts Worker Hours After Hiking Minimum Wages", and just four weeks ago we followed up that "Half Of Washington DC Employers Have Cut Jobs, Hours Due To Minimum Wage Increases - And It's Going To Get Worse."

The Starbucks news confirms just that; expect much more.

Meanwhile, we can only hope that more realize that politicians pandering to populism by conducting a phony "war on inequality" via minimum wage propaganda is merely serving their corporate overlords. Because as Starbucks employees are the latest to learn the hard way, as wages go up, all in comp is rapidly dropping while layoffs are rising. Maybe next time Obama mandates a minimum wage to show how much he cares about the "little worker", he should also issue an executive order requiring minimum hours too. Naturally, that would merely unleash even more central-planning hell, but in a world in which the central banks already control everything, why the hell not?



from Zero Hedge http://ift.tt/qouXdu
via IFTTT

Feynman on Fermat's Last Theorem

http://ift.tt/29ax04u

Richard Feynman was probably one of the most talented physicists of the 20th century. He was known for having a tremendous mathematical and physical intuition that allowed him to deconstruct complex concepts and approach problems from first principles. There are countless anecdotes that show Feynman’s genius, from his ability as an undergrad at MIT to use his own methods to solve seemingly untreatable integrals to coming up with his own derivation of the Schrödinger equation as a grad student in Princeton. While reading more about Feynman’s derivation of the Schrödinger equation in Schweber’s book QED and the Men who made it I ended up finding a mention to an undated two-page manuscript written by Feynman about Fermat’s Last Theorem. The manuscript doesn’t appear in the book but Schweber casts some light on Feynman’s approach which I will try to explain here in more detail.

Fermat claimed in the 17th century that if \(n\) is a positive integer greater than \(2\), the equation \( x^n + y^n = z^n \) does not admit integer non-trivial solutions, i.e. a solution where all three \(x\), \(y\) and \(z\) are non-zero. This statement is universally known as “Fermat’s Last Theorem” (or FLT), and the equation therein is called “the Fermat equation”.

During more than three and half centuries this difficult problem received the attention of many mathematicians of great fame, such as, among others, L. Euler, Legendre, P.G.L. Dirichlet, E.E. Kummer, and more recently D.R. Heath-Brown, G. Frey, and A. Wiles, who finally solved the problem.

Schweber doesn’t mention the date of the manuscript but since Feynman died in 1988 and Andrew Wiles published the proof of the Theorem in 1995 we know that when Feynman wrote it FLT was still one of the most famous open problems in mathematics. What’s interesting about the manuscript is that Feynman’s approach to the problem is purely probabilistic. He starts by calculating the probability that a number \(N\) is a perfect \(n^{th}\) power. To do this we need to calculate the distance between \(\sqrt[n]{N}\) and \(\sqrt[n]{N+1}\), where N is a large integer (I will explain later why we are doing this) $$ d = \sqrt[n]{N+1}-\sqrt[n]{N} = \sqrt[n]{N}\sqrt[n]{1+\frac{1}{N}}-\sqrt[n]{N}=\sqrt[n]{N}\left(\sqrt[n]{1+\frac{1}{N}}-1\right) $$ If we now use the power expansion \( (1+x)^{k}= 1 + kx + \frac{k(k-1)}{2}x^2+…\) for \( -1< x<1\) $$ d =\sqrt[n]{N}\left(\left(1 + \frac{1}{n}\frac{1}{N} + \frac{\frac{1}{n}(\frac{1}{n}-1)}{2}\frac{1}{N^2}+…\right)-1\right) $$ where \(k=\frac{1}{n}\) and \(x=\frac{1}{N}\). Note that we can use the power expansion since \(\frac{1}{N}<1\). Taking the limit \(N\rightarrow \infty\) and preserving only the larger terms of the expansion we end up with $$ d \approx \frac{\sqrt[n]{N}}{nN} $$

Note that \(d \approx \frac{\sqrt[n]{N}}{nN} =\frac{1}{n \underbrace{\sqrt[n]{N}…\sqrt[n]{N}}_{n-1 \text{ times}}} < 1\) since \(n>1\), \(\sqrt[n]{N}>1\) and so \(n\sqrt[n]{N}…\sqrt[n]{N} >1\).

Feynman then writes “the probability that \(N\) is a perfect \(n^{th}\) power is \(\frac{\sqrt[n]{N}}{nN}\) ” . He didn’t explain how he got to this conclusion so here is what I think his thought process was. If \(N\) is a perfect power \(N=z^n\), there exists at least one integer ( \(\sqrt[n]{N} = z \)) in the interval \([\sqrt[n]{N},\sqrt[n]{N+1}]\). Since the distance between all consecutive integers is \(1\) the probability that \([\sqrt[n]{N},\sqrt[n]{N+1}]\) contains an integer is the ratio of the length of the intervals between two integers and the distance between \(\sqrt[n]{N}\) and \(\sqrt[n]{N+1}\): \(\frac{d}{1}\). A good way to visualize this is imagining a line where the distance between all consecutive integers is 1 meter. If someone drops a ruler of length d meter on top of the line the probability the ruler “hits” an integer is \( \frac{d \text{ meter}}{1 \text{meter}}= d \approx \frac{\sqrt[n]{N}}{nN} \).

Now in the case of FLT, \( N=x^n + y^n \) and so the probability that \( x^n + y^n \) is a perfect perfect \(n^{th}\) power is \(\frac{\sqrt[n]{x^n + y^n}}{n(x^n + y^n )}\). Of course this probability is for a specific \(x\) and \(y\) so if we want to calculate the total probability for any \( x^n + y^n \) we need to sum over all \( x> \mathsf{x}_{0} \) and \( y > \mathsf{y}_{0} \). Feynman chose to integrate the expression instead of summing it. My assumption is that he chose integrals because they are normally easier to handle than sums and the final result wasn’t going to be affected if instead of summing over integers we just integrate over all \(x\) and \(y\).

Feynman also chose to do \(\mathsf{x}_{0}=\mathsf{y}_{0}\) . He ends up with the following expression:

$$ \mathsf{\int}_{\mathsf{x}_{0}}^{\infty} \mathsf{\int}_{\mathsf{x}_{0}}^{\infty} \frac{1}{n}(x^n + y^n)^{-1+\frac{1}{n}} dx \ dy = \frac{1}{n\mathsf{x}_{0}^{n-3}}c_n \ $$

$$ c_n = \mathsf{\int}_{0}^{\infty} \mathsf{\int}_{0}^{\infty} (u^n + v^n)^{-1+\frac{1}{n}} du \ dv $$

To obtain \(c_n\) Feynman performs 2 changes of variables. The first one is \(\theta=\frac{x-\mathsf{x}_{0}}{\mathsf{x}_{0}}\) \(\phi=\frac{y-\mathsf{x}_{0}}{\mathsf{x}_{0}} \)

Doing the first change of variables:

$$ \mathsf{\int}_{\theta(\mathsf{x}_{0})}^{\infty} \mathsf{\int}_{\phi(\mathsf{x}_{0})}^{\infty} f(x(\theta,\phi),y(\theta,\phi)) \left|\frac{\partial(x,y)}{\partial(\theta,\phi)}\right| d \theta \ d \phi = $$ $$ =\mathsf{\int}_{0}^{\infty} \mathsf{\int}_{0}^{\infty} \frac{1}{n} \mathsf{x}_{0}^{1-n}((\theta + 1)^n + (\phi + 1)^n)^{-1+\frac{1}{n}} \mathsf{x}_{0}^{2} d \theta \ d \phi = $$ $$ =\frac{1}{n\mathsf{x}_{0}^{n-3}} \mathsf{\int}_{0}^{\infty} \mathsf{\int}_{0}^{\infty} ((\theta + 1)^n + (\phi + 1)^n)^{-1+\frac{1}{n}} d \theta \ d \phi $$

where \(\left|\frac{\partial(x,y)}{\partial(\theta,\phi)}\right|= \frac{\partial x}{\partial \theta}\frac{\partial y}{\partial \phi }-\frac{\partial x }{\partial \phi}\frac{\partial y}{\partial \theta} = \mathsf{x}_{0}^2 \) is the Jacobian and \(\theta( \mathsf{x}_{0})=\frac{\mathsf{x}_{0}-\mathsf{x}_{0}}{\mathsf{x}_{0}} = 0\) \( \phi( \mathsf{x}_{0} ) = \frac{\mathsf{x}_{0}-\mathsf{x}_{0}}{\mathsf{x}_{0}} = 0 \) .

Finally we do the second change of variables \(u = \theta + 1\) and \(v = \phi + 1\)

$$ \frac{1}{n\mathsf{x}_{0}^{n-3}} \mathsf{\int}_{0}^{\infty} \mathsf{\int}_{0}^{\infty} ((\theta + 1)^n + (\phi + 1)^n)^{-1+\frac{1}{n}} d \theta \ d \phi = $$ $$ =\frac{1}{n\mathsf{x}_{0}^{n-3}} \mathsf{\int}_{1}^{\infty} \mathsf{\int}_{1}^{\infty} (u^n + v^n)^{-1+\frac{1}{n}} d u \ d v $$

I think there’s actually a typo in the lower limits of the integral (\(c_n\)) that Feynman derived as they should be 1’s and not 0’s. Note that \(u(0) = 0 + 1 = 1\) and \(v(0) = 0 + 1 = 1\).

Finally we got an expression for the probability that \( z^n=x^n + y^n \) is an integer and we can calculate it for several \(n\)’s. Setting \(\mathsf{x}_{0}=2\) we can see that the probability of there being integer solutions to \( z^n=x^n + y^n \) (\(\frac{1}{n\mathsf{x}_{0}^{n-3}} \mathsf{\int}_{1}^{\infty} \mathsf{\int}_{1}^{\infty} (u^n + v^n)^{-1+\frac{1}{n}} d u \ d v\)) does decrease with increasing \(n\).

Feynman also knew about Sophie Germain’s result, who proved in the early 19th century that Fermat’s equation has no solution for \(n \leq 100\). Since it gets more and more difficult to find a solution as \(n\) increases, Feynman tried to calculate the probability of finding a solution to Fermat’s equation using the knowledge that there’s none for \(n \leq 100\).

For sufficiently large n (I invite readers to derive this limit)

\(c_n \approx \frac{1}{n}\)

Therefore the probability of finding a solution for a particular \(n\) is \(\frac{1}{n^2\mathsf{x}_{0}^{n-3}}\) and consequently the probability of finding a solution for any \(n>\mathsf{n}_{0}=100\) is \(\int_{100}^{\infty} \frac{1}{n^2\mathsf{x}_{0}^{n-3}} dn\). If we calculate the integral for \(\mathsf{x}_{0}=2\)

$$ \int_{100}^{\infty} \frac{1}{n^2 2^{n-3}} dn \approx 8.85 \times 10^{-34} $$

which means that the probability is less than \(10^{-31}\)%. Feynman concluded: “for my money Fermat’s theorem is true”. This is of course not very formal from a mathematical standpoint and is far from the real 110 pages long proof of FLT that took A.Whiles years to put together, notwithstanding it’s a really good example of Feynman’s scientific approach and genius. As Feynman used to say:

the main job of theoretical physics is to prove yourself wrong as soon as possible.



from Hacker News http://ift.tt/YV9WJO
via IFTTT

Why you should aim for 100 rejections a year

http://ift.tt/292XKFf


In the book Art & Fear, authors David Bales and Ted Orland describe a ceramics class in which half of the students were asked to focus only on producing a high quantity of work while the other half was tasked with producing work of high quality. For a grade at the end of the term, the “quantity” group’s pottery would be weighed, and fifty pounds of pots would automatically get an A, whereas the “quality” group only needed to turn in one—albeit perfect—piece. Surprisingly, the works of highest quality came from the group being graded on quantity, because they had continually practiced, churned out tons of work, and learned from their mistakes. The other half of the class spent most of the semester paralyzed by theorizing about perfection, which sounded disconcertingly familiar to me—like all my cases of writer’s block.

Being a writer sometimes feels like a paradox. Yes, we should be unswerving in our missions to put passion down on paper, unearthing our deepest secrets and most beautiful bits of humanity. But then, later, each of us must step back from those raw pieces of ourselves and critically assess, revise, and—brace yourself—sell them to the hungry and unsympathetic public. This latter process is not only excruciating for most of us (hell, if we were good at sales we would be making good money working in sales), but it can poison that earlier, unselfconscious creative act of composition.

In Bird by Bird, Anne Lamott illustrates a writer’s brain as being plagued by the imaginary radio station KFKD (K-Fucked), in which one ear pipes in arrogant, self-aggrandizing delusions while the other ear can only hear doubts and self-loathing. Submitting to journals, residencies, fellowships, or agents amps up that noise. How could it not? These are all things that writers want, and who doesn’t imagine actually getting them? But we’d be much better off if only we could figure out how to turn down KFKD, or better yet, change the channel—uncoupling the word “rejection” from “failure.”

There are two moments from On Writing, Stephen King’s memoir and craft book, that I still think about more than 15 years after reading it: the shortest sentence in the world, “Plums defy!” (which he presented as evidence that writing need not be complex), and his nailing of rejections. When King was in high school, he sent out horror and sci-fi fantasy stories to pulpy genre magazines. For the first few years, they all got rejected. He stabbed his rejection slips onto a nail protruding from his bedroom wall, which soon grew into a fat stack, rejection slips fanned out like kitchen dupes on an expeditor’s stake in a crowded diner. Done! That one’s done! Another story bites the dust! That nail bore witness to King’s first attempts at writing, before he became one of the most prolific and successful authors in the world.



from Hacker News http://ift.tt/YV9WJO
via IFTTT

Against Prestige

http://ift.tt/29dTNgw

My life has been, in part, a series of crusades. First I just wanted to understand as much as possible. Then I focused on big problems, wondering how to fix them. Digging deeper I was persuaded by economists: our key problems are institutional. Yes we can have lamentable preferences and cultures. But it is hard to find places to stand and levers to push to move these much, or even to understand the effects of changes. Institutions, in contrast, have specific details we can change, and economics can say which changes would help.

I learned that the world shows little interest in the institutional changes economists recommend, apparently because they just don’t believe us. So I focused on an uber institutional problem: what institutions can we use to decide together what to believe? A general solution to this problem might get us to believe economists, which could get us to adopt all the other economics solutions. Or to believe whomever happens to be right, when economists are wrong.  I sought one ring to rule them all.

Of course it wasn’t obvious that a general solution exists, but amazingly I did find a pretty general one: prediction markets. And it was also pretty simple. But, alas, mostly illegal. So I pursued it. Trying to explain it, looking for everyone who had said something similar. Thinking and hearing of problems, and developing fixes. Testing it in the lab, and in the field. Spreading the word. I’ve been doing this for 28 years now.

And I will keep at it. But I gotta admit it seems even harder to interest people in this one uber solution than in more specific solutions. Which leads me to think that most who favor specific solutions probably do so for reasons other than the ones economists give; they are happy to point to economist reasons when it supports them, and ignore economists otherwise. So in addition to pursuing this uber fix, I’ve been studying human behavior, trying to understand why we seem so disinterested.

Many economist solutions share a common feature: a focus on outcomes. This feature is shared by incentive contracts, track records, and prediction markets, and people show a surprising disinterest in all of them. And now I finally think I see a common cause: an ancient human habit of excess deference to the prestigious. As I recently explained, we want to affiliate with the prestigious, and feel that an overly skeptical attitude toward them taints this affiliation. So we tend to let the prestigious in each area X decide how to run area X, which they tend to arrange more to help them signal than to be useful. This happens in school, law, medicine, finance, research, and more.

So now I enter a new crusade: I am against prestige. I don’t yet know how, but I will seek ways help people doubt and distrust the prestigious, so they can be more open to focusing on outcomes. Not to doubt that the prestigious are more impressive, but that letting them run the show produces good outcomes. I will be happy if other competent folks join me, though I’m not especially optimistic. Yet. Yet.

GD Star Rating
loading...



from Overcoming Bias http://ift.tt/ue755I
via IFTTT

Why startup business culture has little time for golf

http://ift.tt/295tpWY


The golf course as a makeshift conference room has long been a staple of business culture. When we think of golf's deal-making potential, we think of two CEOs hashing out a merger while lining up par putts, or a sales executive wooing new clients by way of a plush tee-time. In 2011, when President Barack Obama and then Speaker of the House John Boehner sought to find common ground, they met for a cordial 18 holes.

You've heard all of the selling points for the game. Golf is a window into a person's character. It measure one's ability to handle adversity. Plus, there's just so much built-in time to get to know someone.

So why is it that the modern entrepreneurs don't play as much golf? Perhaps because the new economy doesn't present the same set of needs. In a story on Inc.com, called "The Real Reasons Entrepreneurs Don't Play Golf," writer Chris Heivly explains why startup culture doesn't value golf the way traditional big business does.

As Heivly, an expert on startups who was one of the co-founders of MapQuest, writes, one reason lies in the general feeling of impermanence around a startup. As important as relationships are to any business, the startup is first consumed with the bare essentials of surviving.

"Startups are worried if they even have a customer, if that customer is willing to pay and for how long," Heivly writes. "Startups are concentrating on building out a product or service that has obvious value and does not require outsize sales or marketing efforts to create awareness. Startups are concerned with the amount of capital required to scale appropriately given all of the variables mentioned above. For many reasons, golf is not important to startups."

Ultimately, the challenge golf presents has to due with time. There is the short-term time challenge of carving out five hours during the day when other works needs to be done. But there is also the more daunting time consideration, which is there's no point in building out a relationship when you don't know how long you'll be around.

"Startups are first trying to survive and their moves made are based on a three-to-six month view. These change all the time as the startup's vision morphs," Heivly writes.

Mind you, it's not all bad news for golf. There can come a time when the game can play a role, particularly after a company survives through its early, formative period and can start looking beyond its immediate future. At some point relationships do matter in helping a business grow, and that's where golf can be a valuable tool.


WATCH GOLF DIGEST VIDEOS



from Golf Digest http://ift.tt/Pwhu2w
via IFTTT

Is This Gary Johnson/Bill Weld Spot the Greatest Presidential Ad Ever?

http://ift.tt/292FyXN

Libertarian Party presidential nominee Gary Johnson and his running mate Bill Weld have just released a masterful ad that touts their impressive records as two-term governors (of New Mexico and Massachusetts, respectively) while drawing sharp distinctions among their positions and those of Hillary Clinton and Donald Trump.

This is hands down powerful, powerful stuff and highlights Johnson's interest in capturing what he calls the "broad middle" of Americans who are socially liberal, fiscally conservative, and desperate for "small, efficient government" that gets core tasks done without blowing up the budget to pad the payrolls of favored businesses, bomb and drone foreign countries into the Stone Age, and strangle us all in regulatory red tape.

Take a look and comment it up below.

If you're interested in presidential commercials dating back to 1952, check out The Living Room Candidate, an exhaustive archive of such strange and wonderful artifacts.



from Hit & Run : Reason Magazine https://reason.com/blog
via IFTTT

‘Return on Investment’: The Narrow, Short-Sighted Finance Concept That Has Taken Over Society

http://ift.tt/29d14vO

What’s a good use of money?

For investors, that question comes down to a relatively straightforward calculation: Which of the available options has the greatest expected return on the investment?

But investors are far from the only people who are using the “return on investment” framework to weigh different options. “This has become a very, very powerful tool for decision making, not only in business, but in our culture as a whole,” said Moses Pava, an ethicist and a dean of the Sy Syms School of Business at Yeshiva University, at the Aspen Ideas Festival, co-hosted by the Aspen Institute and ​The Atlantic. In particular, Pava sees this kind of thinking dominating the world of education, both on the part of students in choosing schools and majors, and on the part of school in how they market themselves to potential enrollees. This, he says, will not end well for liberal arts schools.

Ideas 2016

Undergraduate business schools have a pretty strong case to make for their value—if by value people mean an average starting salary right after graduation. Now, Pava says, a lot of liberal arts schools are trying to make that same case, saying they too provide a high return on investment. “But the bad news for the liberal arts people,” Pava argued, “is that once they’ve entered that conversation with [business schools] and started comparing themselves to us, they’ve lost the game, because they’re using our metaphor and they’re using our way of framing the question and they’ve kind of lost their soul.”

The fundamental problem with return-on-investment thinking is that it reduces the value of an experience to some sort of quantifiable, short-term outcome. Pava says he sees this in “assessments of learning,” which seek to measure what information students are absorbing. But such assessments miss some of the most profound learning, the kind that takes years to sink in. “The reality is,” Pava said, “the most important thing I ever learned—I went to Brandeis—I remember vividly sitting on the grass studying Martin Buber’s I and Thou. I had no idea what I was reading! But the seed was planted, and I’ve gone back to it every five years, and it’s become one of the ways that I look at the world.”

“Most of the best things in life cannot be measured, can’t even really be compared.”

Pava believes that a “rational” model has a place: “If you’re buying potatoes for tonight’s dinner,” he said, “the rational model is fine.” But for the bigger things in life, “it’s really crazy. I ask my students, when you’re thinking about a spouse, do you make decisions in rational terms? Because if so, your marriage probably isn’t going to last very long.”

After all, he said, “Most of the best things in life cannot be measured, can’t even really be compared.”



from The Atlantic - Business http://ift.tt/sTrp1A
via IFTTT

Eggs Don’t Cause Heart Attacks – Sugar Does

http://ift.tt/1gdHEmM

It's over. The debate is settled.

It's sugar, not fat, that causes heart attacks.

Oops. Fifty years of doctors' advice and government eating guidelines have been wrong. We've been told to swap eggs for cereal. But that recommendation is dead wrong. In fact, it's very likely that this bad advice has killed millions of Americans.

A rigorously done new study shows that those with the highest sugar intake had a four-fold increase in their risk of heart attacks compared to those with the lowest intakes. That's 400 percent! Just one 20-ounce soda increases your risk of a heart attack by about 30 percent.

This study of more than 40,000 people, published in JAMA Internal Medicine, accounted for all other potential risk factors including total calories, overall diet quality, smoking, cholesterol, high blood pressure, obesity and alcohol.

This follows on the heels of decades of research that has been mostly ignored by the medical establishment and policy makers. In fact, the Institute of Medicine recommends getting no more than 25 percent of your total calories from added sugar. Really? This study showed that your risk of heart attacks doubles if sugar makes up 20 percent of your calories.

Yet more than 70 percent of Americans consume 10 percent of their daily calories from sugar. And about 10 percent of Americans consume one in every four of their calories from sugar.

Failed Dietary Guidelines

U.S. Dietary Guidelines provide no limit for added sugar, and the U.S. Food and Drug Administration (FDA) still lists sugar as a "generally regarded as safe" (GRAS) substance. That classification lets the food industry add unlimited amounts of sugar to our food. At least the American Heart Association recommends that our daily diet contain no more than 5 percent to 7.5 percent added sugar. Yet most of us are eating a lot more. Most of us don't know that a serving of tomato sauce has more sugar than a serving of Oreo cookies, or that fruit yogurt has more sugar than a Coke, or that most breakfast cereals -- even those made with whole grain -- are 75 percent sugar. That's not breakfast, it's dessert!

This is a major paradigm shift. For years, we've been brainwashed into thinking that fat causes heart attacks and raises cholesterol, and that sugar is harmless except as a source of empty calories. They are not empty calories. As it turns out, sugar calories are deadly calories. Sugar causes heart attacks, obesity, Type 2 diabetes, cancer and dementia, and is the leading cause of liver failure in America.

The biggest culprit is sugar-sweetened beverages, including sodas, juices, sports drinks, teas and coffees. They are by far the single biggest source of sugar calories in our diet. In fact, more than 37 percent of our sugar calories come from soda. The average teenage boy consumes 34 teaspoons of sugar a day, or about 544 calories from sugar. Even more troubling, this isn't just putting kids at risk for heart attacks at some remote later date in their lives. It’s killing them before their 20th birthday.

This new research syncs with decades of data on how sugar causes insulin resistance, high triglycerides, lower HDL (good) cholesterol and dangerous small LDL (bad) cholesterol. It also triggers the inflammation we now know is at the root of heart disease.

And fats, including saturated fats, have been unfairly blamed. With the exception of trans fats, fats are actually protective. This includes omega-3 fats, nuts and olive oil, which was proven to reduce heart attack risk by more than 30 percent in a recent large randomized controlled study.

Here's the simple fact: Sugar calories are worse than other calories. All calories are not created equal. A recent study of more than 175 countries found that increasing overall calories didn't increase the risk of Type 2 diabetes, but increasing sugar calories did -- dramatically.

How to Cure Our Sugar Addiction

America lags far behind the rest of the world in addressing this problem. Mexico, for example, responded after learning that when soda consumption increased to 20 percent of calories for the average citizen, their rates of obesity and Type 2 diabetes skyrocketed. Public health officials there researched effective solutions to combat obesity and diabetes from around the world.

The key interventions they implemented included taxing soda, banning junk food television advertising, and eliminating processed foods, junk food and sugar-sweetened beverages from schools. More than 15 countries have targeted sugar-sweetened beverages by taxing them -- a strategy that’s proven successful.

Another effective strategy is revamping food labeling to make it clear if a food is good, should be consumed with caution, or is bad for you. In the United States, even someone with a Ph.D. in nutrition has trouble deciphering food labels. How can the average person be expected to know?

Recent and mounting scientific evidence clearly proves that sugar -- and flour, which raises blood sugar even more than table sugar -- is biologically addictive. In fact, it's as much as eight times more addictive than cocaine.

The average American consumes about 152 pounds of sugar and 146 pounds of flour a year. It’s imperative that we revamp our outdated and dangerous national dietary guidelines. And we need clear strategies and medical programs to help people understand and address the health risks and addictive nature of sugar and refined carbohydrates.

That's how we can reverse this tsunami of obesity and chronic disease that is robbing us of our health and crippling our economy.

Wishing you health and happiness,

In my new book, The Blood Sugar Solution 10-Day Detox Diet, which will be released on February 25, I provide an easy, step-by-step plan to rid yourself of sugar addiction and reverse your risk of heart attacks. To download a sneak preview of this book, go to www.10daydetox.com and pre-order the book on Amazon

Mark Hyman, MD is a practicing physician, founder of The UltraWellness Center, a six-time New York Times bestselling author, and an international leader in the field of Functional Medicine. You can follow him on Twitter, connect with him on LinkedIn, watch his videos on YouTube, become a fan on Facebook, and subscribe to his newsletter.

This Blogger's Books and Other Items from...



from Hacker News http://ift.tt/YV9WJO
via IFTTT