text:
# Making beautiful boxplots using plotnine in Python

written in

For the past year and a half, I have been switching gradually from using matplotlib to create graphs in Python to Hassan Kibirige’s wonderful port of R’s ggplot2, plotnine. When I was first starting to use this package, I found it was quite tricky to find clear instructions on how to make customisations or build some of the more specialised charts. As such, Mauricio and I decided to create a series of tutorials on how to build and customise a range of charts in plotnine, going step-by-step from a basic plot to a highly customised graph.

This week I am sharing our tutorial on how to create and customise boxplots in plotnine. If you enjoyed this blog post and found it useful, please consider buying our book! It contains chapters detailing how to build and customise 11 other chart types, including bar charts, line charts, scatterplots, histograms, density plots and regression plots (including all of the regression diagnostic plots available in R). Every purchase really helps us out with maintaining the content.

With that out of the way, let’s get on with creating our boxplot in plotnine! In this tutorial, we will work towards creating the line plot below. We will take you from a basic line plot and explain all the customisations we add to the code step-by-step.

The first step is to import all of the required packages. For this we needpandas and its DataFrame class to read in and manipulate our data, plotnine to get our data and create our graphs, and numpy to do some basic numeric calculations in our graphing.

import numpy as np
import pandas as pd

import plotnine

from plotnine import *
from plotnine import data
from pandas import DataFrame

We then need to load in the data, as below.

diamonds = data.diamonds

## Basic ggplot structure

In order to initialise a boxplot we tell ggplot that diamonds is our data, and specify that our x-axis plots the cut variable and our y-axis plots the price variable. You may have noticed that we put our variables inside a method called aes. This is short for aesthetic mappings, and determines how the different variables you want to use will be mapped to parts of the graph. As you can see below, ggplot has mapped cut to the x-axis and price to the y-axis.

You might have also noticed that there is nothing in the plot. In order to render our data, we need to tell ggplot how we want to visually represent it.

p10 = ggplot(diamonds, aes("cut", "price"))
p10

## Basic boxplot

We can do this using geoms. In the case of a boxplot, we use the geom_boxplot() geom.

p10 = ggplot(diamonds, aes("cut", "price")) + geom_boxplot()
p10

## Customising axis labels

In order to change the axis labels, we have used the xlab and ylab options. In each, we add the desired name as an argument.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot()
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
)
p10

ggplot also allows for the use of multiline names (in both axes and titles). Here, we’ve changed the y-axis label so that it goes over two lines using the \n character to break the line.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot()
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
)
p10

## Changing axis ticks

To change the x-axis tick marks, we can use the scale_x_continuous option. Similarly, to change the y-axis we can use the scale_y_continuous option. Here we will change the y-axis to every $2500 rather than the default of$5000. We can change the breaks using the breaks option, which takes a list of values as an argument. You can shortcut having to type in the whole list manually using numpy’s arange function which generates a sequence from your selected start, stop and step values respectively. Note that because of Python’s indexing, you need to set the stop argument to be one number more than your desired maximum.

Similarly, you can use the limits argument to define the minimum and maximum values of your axis. We’ve also included this in our scale_y_continuous option, increasing the maximum value to \$20000.

p10 = (
ggplot(diamonds, aes("cut", "price")) + geom_boxplot()
+ xlab("Diamond cut") + ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500), limits=[0, 20000])
)
p10

To add a title, we include the option ggtitle and include the name of the graph as a string argument.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot()
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
)
p10

## Changing the colour of the boxes

To change the line and fill colours of the box plot, we add a valid colour to the colour and fill arguments in geom_boxplot(). plotnine uses the colour palette utilised by matplotlib, and the full set of named colours recognised by ggplot is here. Let’s try changing our box lines and fills to rebeccapurple and lightskyblue respectively.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="rebeccapurple", fill="lightskyblue")
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
)
p10

If you want to go beyond the options in the list above, you can also specify exact HEX colours by including them as a string preceded by a hash, e.g., "#FFFFFF". Below, we have called two shades of blue for the fill and lines using their HEX codes.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE")
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
)
p10

You can also specify the degree of transparency in the box fill area using the argument alpha in geom_boxplot(). This ranges from 0 to 1.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE",
alpha=0.7)
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
)
p10

Finally, you can change the appearance of the outliers as well, using the arguments outlier.colour and outlier.shape in geom_boxplot to change the colour and shape respectively. The shape arguments for plotnine are the same as those available in matplotlib, and are therefore a little more limited than those in R’s implementation of ggplot2. Nonetheless, there is a good range of options. The allowed arguments are here. Here we will make the outliers small solid circles (using outlier.shape=".") and make them coloured steelblue (using outlier.colour="steelblue").

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(
colour="#1F3552",
fill="#4271AE",
alpha=0.7,
outlier_shape=".",
outlier_colour="steelblue",
)
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
)
p10

## Using the white theme

As explained in the previous chapters, we can also change the overall look of the plot using themes. We’ll start using a simple theme customisation by adding theme_bw().

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(
colour="#1F3552",
fill="#4271AE",
alpha=0.7,
outlier_shape=".",
outlier_colour="steelblue",
)
+ xlab("Diamond cut")
+ ylab("Price of diamond\n(USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme_bw()
)
p10

## Creating an XKCD style chart

Of course, you may want to create your own themes as well. ggplot allows for a very high degree of customisation, including allowing you to use imported fonts. plotnine already has a theme_xkcd() implementation, but we’ve instead created one from scratch to demonstrate how to use imported fonts and some of the other options in theme to tweak the overall look of the graph.

In order to create this chart, you first need to download the XKCD font, which Randall Munroe has kindly provided here. Once you have it, you can load it into Python using the matplotlib.font_manager class.

import matplotlib.font_manager as fm

fpath = "path/to/file/xkcd-Regular.otf"

As this is an imported font, we can’t change its size directly within the graph. Instead, we need to alter our imported font objects to change the size. As we want a different font size for the title and the body, we will create 2 different font objects, title_text and body_set.

We can then call methods on these objects (the list of available methods is here). For the title, we’ll change the font to size 18 and make it bold using the set_size() and set_weight methods. Similarly, we’ll change the body text to size 12.

# Create font objects
title_text = fm.FontProperties(fname=fpath)
body_text = fm.FontProperties(fname=fpath)

# Alter size and weight of font objects
title_text.set_size(18)
title_text.set_weight("bold")

body_text.set_size(12)

In order to get the plot to look more like the XKCD artstyle, we’ll make a few more changes. We can alter the values of axis_line_x and axis_line_y to change the thickness of the axis lines. We can also get rid of the boxes around the legend by setting the argument of legend_key to element_blank(). We can remove the grid line by changing the value of four parameters: panel_grid_major, panel_grid_minor, panel_border and panel_background. To use the XKCD font that we just imported, we need to change the values of both plot_title and text. Finally, to change the colour of the text to black (from its default grey), we change the values of axis_text_x and axis_text_y.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="black", fill="#56B4E9")
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
axis_line_x=element_line(size=2, colour="black"),
axis_line_y=element_line(size=2, colour="black"),
panel_grid_major=element_blank(),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(fontproperties=title_text),
text=element_text(fontproperties=body_text),
axis_text_x=element_text(colour="black"),
axis_text_y=element_text(colour="black"),
)
)
p10

## Using the ‘Five Thirty Eight’ theme

There are a wider range of pre-built themes available as part of the ggplot package (more information on these here). Below we’ve applied theme_538(), which approximates graphs in the nice FiveThirtyEight website. As you can see, we’ve used the commercially available fonts ‘Atlas Grotesk’ and ‘Decima Mono Pro’ in axis_title, plot_title and text. This is just to make the plots exactly like those on the site, and is entirely optional.

agm = "path/to/file/AtlasGrotesk-Medium.otf"
agr = "path/to/file/AtlasGrotesk-Regular.otf"
dp = "path/to/file/DecimaMonoPro.otf"

# Create font objects
title_text = fm.FontProperties(fname=agm)
axis_text = fm.FontProperties(fname=agr)
body_text = fm.FontProperties(fname=dp)

# Alter size and weight of font objects
title_text.set_size(16)
axis_text.set_size(12)
body_text.set_size(10)

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE")
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme_538()
+ theme(
axis_title=element_text(fontproperties=axis_text),
plot_title=element_text(fontproperties=title_text),
text=element_text(fontproperties=body_text),
)
)
p10

Now that we’ve explored some of the options available in plot customisation, we can now build our own completely customised graph. Changing the size and colour arguments of axis_line allows us to thicken the lines and change their colour to black. Similarly, changing the colour argument passed to panel_grid_major means that all of our major grid lines are now light grey. We removed the minor grid lines and background by changing the arguments of panel_grid_minor, panel_border and panel_background, and finally, we’ve changed the font using the standard font Tahoma.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE")
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=10),
axis_text_y=element_text(colour="black", size=10),
)
)
p10

## Boxplot extras

An extra feature you can add to boxplots is to overlay all of the points for that group on each boxplot in order to get an idea of the sample size of the group. This can be achieved using by adding the geom_jitter() option. As diamonds is a large dataset, we’ll first take a small sample to illustrate this.

diamonds_sample = diamonds.sample(1000)

p10 = (
ggplot(diamonds_sample, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE")
+ geom_jitter()
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=10),
axis_text_y=element_text(colour="black", size=10),
)
)
p10

We can see that the Fair group has a smaller sample than the other categories, indicating that it may not give as reliable information as the other cut types.

Another thing you can do with your boxplot is add a notch to the box where the median sits to give a clearer visual indication of how the data are distributed within the IQR. You achieve this by adding the argument notch=True to the geom_boxplot() geom.

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE",
notch=True)
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=10),
axis_text_y=element_text(colour="black", size=10),
)
)
p10

## Grouping by another variable

You can also easily group boxplots by the levels of another variable. There are two options, in separate (panel) plots, or in the same plot.

We first need to do a little data wrangling. To create our grouping variable, we’ll median-split carat so that this is categorical, and made it into a new labelled factor variable called carat_c.

In order to produce a panel plot by this categorical carat variable, we add the facet_grid(".~carat_c") option to the plot. Note that unlike in R’s ggplot, you need to include the arguments in facet_grid in quote marks.

diamonds["carat_c"] = pd.qcut(
diamonds["carat"], 2, labels=["Lower carat", "Higher carat"]
)

p10 = (
ggplot(diamonds, aes("cut", "price"))
+ geom_boxplot(colour="#1F3552", fill="#4271AE")
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=8),
axis_text_y=element_text(colour="black", size=10),
)
+ facet_grid(". ~ carat_c")
)
p10

In order to plot the two carat levels in the same plot, we need to add a couple of things. Firstly, in the ggplot function, we add a fill=carat_c argument to aes. Secondly, we change the manual colours using the schemes from ColorBrewer. Here we have used the scale_fill_brewer option with the quantitative scale Accent. More information on using scale_colour_brewer is here.

p10 = (
ggplot(diamonds, aes("cut", "price", fill="carat_c"))
+ geom_boxplot()
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
legend_direction="horizontal",
legend_box_spacing=0.4,
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=10),
axis_text_y=element_text(colour="black", size=10),
)
+ scale_fill_brewer(type="qual", palette="Accent")
)
p10

## Formatting the legend

Finally, we can format the legend. Firstly, we can change the position by adding the legend_position="bottom" argument to the theme option, which moves the legend under the plot. We can change the orientation of the legend to horizontal by then adding legend_direction="horizontal" to theme. We can also centre the legend by adding legend_title_align="center". We can adjust the legend position using legend_box_spacing=0.4. We can get rid of the grey background behind the legend keys using legend_key=element_blank(). Lastly, we can fix the title by adding the name="Diamond carat" argument to the scale_fill_brewer option.

p10 = (
ggplot(diamonds, aes("cut", "price", fill="carat_c"))
+ geom_boxplot()
+ xlab("Diamond cut")
+ ylab("Price of diamond (USD)")
+ scale_y_continuous(breaks=np.arange(0, 20001, 2500),
limits=[0, 20000])
+ ggtitle("Price of diamonds by cut")
+ theme(
legend_position="bottom",
legend_direction="horizontal",
legend_title_align="center",
legend_box_spacing=0.4,
legend_key=element_blank(),
axis_line=element_line(size=1, colour="black"),
panel_grid_major=element_line(colour="#d3d3d3"),
panel_grid_minor=element_blank(),
panel_border=element_blank(),
panel_background=element_blank(),
plot_title=element_text(size=15, family="Tahoma",
face="bold"),
text=element_text(family="Tahoma", size=11),
axis_text_x=element_text(colour="black", size=10),
axis_text_y=element_text(colour="black", size=10),
)
+ scale_fill_brewer(type="qual", palette="Accent",
name="Diamond carat")
)
p10

And with that, we have recreated the plot at the beginning of this blog post! I hope you found this helped you get your feet wet with plotnine and see the potential you have to create plots as beautiful as those from ggplot.


text:
# Locklin on science

## On beating roulette: part 3

Posted in econo-blasphemy, Gambling systems by Scott Locklin on March 14, 2016

This is third in a four part series. Part 1 here, part 2 here.

To my mind, the most mathematically interesting thing about roulette is the betting system you should use to maximize your wins. Bet sizing systems are important in all probabilistic games, and the types of lessons learned from a winning game of roulette are the same types of lessons you need to learn in betting on other things, like success in trading, or having an edge on the wiener dog races. The nice thing about a game of roulette is it is relatively easy to characterize your edge. Most people’s edge over the roulette wheel is negative, so you should not bet. If you built one of the computer gizmos I went over in part 2, you have a positive edge over the roulette wheel.

We know from results in information theory, that sequential bets in the presence of an edge should be sized according to the Kelly Criterion to maximize bankroll growth rate.

$betsize = \frac{bankroll * edge}{house odds}$

or, in more probabilistic terms;

$betsize = \frac{p * odds + p -1}{odds}$

where $p$ is probability of success.

It’s probably not immediately obvious why this is so, but consider a biased coin toss at even odds ($1 payoff for$1 bet). If your coin’s edge is 100%, you gain money fastest by betting your whole bankroll. If you have 0% edge, you shouldn’t bet anything. If you have a 1% edge, you should bet 1% of your bankroll.

Daniel Bernoulli came up with the same fraction a long time before by maximizing the geometric mean.

Kelly’s original paper figured this out by modeling how a better would place bets assuming he had insider information transmitted over a noisy wire transmitting a binary code; a beautiful way of thinking about predictions in the presence of noise. Kelly is a guy I wish had lived longer. He dropped dead at the young age of 41; in his short life he was a Naval aviator in WW-2, invented computer speech synthesis, made huge contributions to information theory, mentored important mathematicians (Elwyn Berlekamp, who went on to found Axcom/Rentech, based in part on Kelly’s insights) and had the kind of life that would be considered hyperbole if he was in a science fiction novel.  They make big men in Texas. Kelly was a giant.

I’m pretty sure his testicles smoked unfiltered camels

I’ve been known to take sadistic glee in making fun of economists. One of the most mockable economists in American history is (Nobelist -the Swedes have dry humor) Paul Samuelson.  One could write entire books on the ways in which Samuelson was a scoundrel and a numskull who set back human knowledge by decades. One fact will suffice for this essay: Samuelson didn’t believe in Kelly betting. Explaining why he thought this, and why he’s wrong would be pointless; debugging an economist’s faulty thought processes is as pointless as explaining why a crazy lady is breaking dishes in the kitchen. If you’re interested, Ed Thorp is your man here also.

Ed Thorp is the man, period

Following Ed Thorp’s original essay in the Gambling Times, as good little experimental physicists, we need to build up an error budget to figure out our edge.  Thorp breaks down the errors in his and Shannon’s Roulette system into several kinds.

1. E1 Rotor speed measurement error
2. E2 Ball speed measurement error
3. E3 Ball rotor path randomness
4. E4 Ball stator path randomness
5. E5 Fret scatter
6. E6 Rotor tilt (discovered by Shannon and Thorp)

Uncorrelated errors add up as the sum of squares, so the total error budget is

$Error = \sqrt{\sum_{n=1}^{n=6}{E_n^2} }$

The Thorp/Shannon roulette system had a 44% edge on the most favored number; single number payouts in Vegas are 35:1, making the correct bet on one number 0.44/ 35 = 0.01256. Since nobody in 1960s Vegas suspected the mathematical machinators of having a physics edge on the wheel, they were able to place larger bets on parts of the quadrant. While Thorp describes it as “diversification” in his exposition. Another way of thinking about it: he’s just playing more games at once. A friend and former customer explained his trend following method as working in much the same way. The more bets you place, the more likely you’ll hit a winning trend.

Kelly betting isn’t a perfect solution in all cases; fixed fraction betting has certain disadvantages when you can’t exactly characterize your edge, or the payout odds, or you have a limited number of bets before you have to cash in your chips. However, in the case of a machine to beat Roulette, it’s difficult to think of a better technique.

Of course, Kelly betting and things like it figure in other sorts of betting; people do use it in Markets where it is appropriate. Supposedly it was part of Axcom/Rentech’s early secret sauce, and certainly folks who have thought about trading need a bet sizing and risk management strategy that makes sense. Kelly is often a good place to start, depending on your situation. But that’s a topic for another blog post. One more coming on modern techniques to beat Roulette, including the one I came up with in 2010 (which, in case you were holding your breath, didn’t really work, which is why I have to work, and am willing to talk about such things in blogs).

Kelly criterion resources

Kelly’s original paper:

http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6771227

Thorp’s explanation:

http://edwardothorp.com/sitebuildercontent/sitebuilderfiles/TheKellyMoneyManagementSystem.pdf

Thorp’s website:

http://edwardothorp.com/id10.html

## Bad models and the end of the world

Posted in econo-blasphemy, stats jackass of the month by Scott Locklin on March 23, 2014

I loathe journalism as a profession: a claque of careerist whores, half-educated back-slappers and propagandists for the oligarchical lizard people who are ruining civilization. I loathe “science journalism” particularly, as they’re generally talking about something I know about, and so their numerous impostures are more obvious.

Journalists: they’re mostly like this

Today’s exhibit, the “NASA study predicting the end of Western Civilization.” The actual study can be found in PDF format here. If you read the “journalism” about this in the guardian, cnet, or wherever else, it’s all about our impending doom. Not only do scientists tell us we are doomed, fookin’ NASA scientists tell us we are doomed.

The authors of the study are not NASA scientists. The NASA subcontractor  associated with this paper would like you to know this; probably because NASA was annoyed their name was associated with this paper. The only contribution NASA made was in partially supporting an institution which partially supported one of the three authors for one semester. The author in question,  Safa Motesharrei is a grad student in “public policy” and “mathematics” at U Maryland. The other two authors are also not NASA scientists. One is allegedly a professor of … political science in Minnesota -and more recently some cranky looking outfit called “Institute of Global Environment and Society.” The other one is a professor of the U Maryland department of Oceanic and Atmospheric sciences. Unless you consider the partial ramen noodle stipend one grad student received for one semester to be “funding,” or you consider NASA’s subcontractor to be liars, NASA did not fund or endorse this study in any meaningful way. Journalism 101, failed before even getting to the content of the article.

The three authors of this study

For what it is worth, had I published anything my sophomore year of grad school instead of trying to build a crazy vacuum chamber and catch a venereal disease, I’d have had some words in my paper thanking NASA for their support as well. This is despite the fact that most of my money came from the NSF and the University I was attending. I wasn’t in any way a NASA scientist. My institution wasn’t NASA affiliated. But we did get a NASA grant that paid for at least a month’s salary for me over the course of a year. When you get those grants, you say “thank you.”

Nafeez Ahmed, the imbecile at the Guardian who broke the story, continues to insist that NASA funded this study, despite the fact that they didn’t. I guess when someone Discovers you are a shoddy journalist, the accepted thing to do these days is doltishly double down on your error. Ahmed, of course, works for some preposterous save-the-world outfit, which apparently means he can pretend he is a journalist and doesn’t have to tell the truth about anything.

Journalistic failure is to be expected these days, and NASA scientists say stupid things all the goddamned time. Still, reading the paper itself was informative. Had anybody bothered to do so, the story would have been murdered in infancy. It’s one of the godawful silliest things I have ever read.

There is a fairly standard model from ecology called the “predator prey” model. Predator/prey models were  mostly developed to model exactly what it sounds like: things like wolf and moose populations in a National Park. The model makes assumptions (that predators are always hungry,  the prey will never die of old age, and  there are no other predators or prey available, for just a few examples of the limitations of the model), but if you set these equations up right, and the parameters and conditions are non-degenerate, it can model reality reasonably well. It’s really no good for predicting things, but it’s OK for modeling things and understanding how nature works.  The equations look like this, where $x(t)$ is the predator population, $y(t)$ is the prey population and $a$ is predator birth rate, $b$ is the predator death rate, $c$ is the prey’s birth rate, and $k$ is the predation rate; all rates are constant.

$\frac{dy}{dt} = ay(t)x(t) -bx(t)$

$\frac{dx}{dt} = cy(t) -kx(t)y(t)$

The predator/prey model is elegant, concise, and in some limited circumstances, occasionally maps onto reality. It is, of course, a model; there is no real reason to model things using this set of differential equations, and a lot of reasons not to. But sometimes it is useful. Like most good models, it is simple and doesn’t have too many parameters. Everything can be measured, and interesting dynamics result; dynamics that we can observe in nature.

The authors of this doom-mongering paper  have  transformed that relatively simple set of equations; a set of equations which, mind you, produces some fairly complicated nonlinear dynamics, into this rather un-handy mess, known as HANDY (for “Human And Nature DYnamics”):

$\frac{dx_c}{dt} = \beta_c x_c(t) - \alpha_c x_c(t)$

$\frac{dx_e}{dt} = \beta_e x_e(t) - \alpha_e x_e(t)$

$\frac{dy}{dt} = \gamma (\lambda -y(t)) y(t) - \delta x_c(t) y(t)$

$\frac{d \omega}{dt} = \delta y(t) x_c(t) - C_c(t) - C_e(t)$

In this set of equations, $x_c(t)$ is the productive peasant population, $x_e(t)$ are the population of parasitic elites, $y(t)$ is “natural resources” and $w(t)$ is “wealth.” $\lambda$ is a “saturation of regrowth of nature rate.” $\gamma$ is an “exponential growth of nature rate.” $\delta$ is a “depletion of nature” rate term. $C_c(t), C_e(t)$ are wealth consumption rates.

to make it even more complex: $\alpha_c(t), \alpha_e(t), C_c(t), C_e(t)$ are all functions of $\omega(t), x_c(t), x_e(t)$

$C_c(t) = min(1,\frac{\omega(t)}{poor(t)}) s x_c(t)$

$C_e(t) = min(1,\frac{\omega(t)}{poor(t)}) \kappa x_e(t)$

$poor(t) = \rho x_c(t) + \kappa \rho x_e(t)$

$poor(t)$ is some threshhold wealth function, below which you starve, and allegedly $\rho$ is supposed to be a minimum consumption per capita, but it really makes no sense based on the equations. $s$ is some kind of subsistence level of wealth and $\kappa$ is the multiple of subsistence that elites take.

Instead of contenting themselves with constant predation or death rates, this train-wreck insists on making them the following:

$\alpha_c(t) = \alpha_m + max(0,1-\frac{C_c(t)}{s x_c(t)}) (\alpha_M - \alpha_m)$

$\alpha_e(t) = \alpha_m + max(0,1-\frac{C_e(t)}{s x_e(t)}) (\alpha_M - \alpha_m)$

Where $\alpha_m, \alpha_M$ are constants for a normal death rate and a death rate where you have a high death rate, where, and I quote the paper directly: “when the accumulated wealth has been used up and the population starves.”

It’s worth a look at what they’re implicitly modeling here by adding all this obfuscatory complexity. All of the following assumptions are made by this model. Very few of them are true in reality. Most of these assumptions are designed to get the answer they did.

1. The natural resources of the earth is well modeled by the prey equation
2. The natural resources of the earth regenerate themselves via a logistic function
3. There are two classes of humans
4. There is a thing called “wealth” that is consumed by the two classes of humans at different rates
5. The elite class of humans preys on the peasants and produces nothing
6. The peasant class is all equally productive
7. Wealth comes from peasants exploiting nature
8. Elites all have $\kappa$ times a subsistence income, rather than a smooth distribution of incomes
9. Peasants all have $s$, a subsistence income, rather than a smooth distribution of incomes
10. An extra variable called “wealth” is needed to make sense of these dynamics, and this variable maps onto the thing known in common parlance as “wealth.”
11. The wealth factor could sustain a human society for centuries after ecological collapse (page 18)
12. Death rates increase as natural resources are consumed at a faster rate (everything about modern civilization indicates the exact opposite is true)
13. The peasants get nothing from the elites except population control
14. Technological change is irrelevant (yes, they argue this; page 7)
15. This ridiculous spaghetti of differential equations actually models something corresponding to Human Civilization

There are more assumptions than this, but you get the idea: this model is ridiculous, over parameterized, and designed to get the answers that they did. If you assume parasitic non-productive elites, you get the situation where social stratification can help “cause” collapse. Of course, if you assume parasitic non-productive elites, you’re assuming all kinds of ideological nonsense that doesn’t map well onto reality.

If you assume natural resources also act like prey, you can get situations where the natural resources collapse, then the society collapses. This is no big surprise, and you don’t need these obfuscatory complications to say this: it’s in the predator-prey equations already. Why didn’t they just model humanity and nature as simple “predator/prey” above? I am guessing, because nobody would buy it if you say things that simply, and it wouldn’t be an original paper. It also doesn’t allow them to pontificate on egalitarian societies.

As for the additional “wealth” factor these clowns use to distinguish themselves from an earlier bad model; as far as I can tell, the only purpose served by this degree of freedom is making it easier to mine way more natural resources than we actually need to support a population (something that wouldn’t happen in a standard predator-prey model). It also doesn’t make any sense, modeled in this way, unless you believe grain silos contain centuries worth of corn, or that people can eat skyscrapers. That’s how their wealth equations work; they actually assume you can eat wealth.

Dr. Nafeez Ahmed: Guardian columnist who broke this story

I actually feel a bit sorry for these guys, even though they are unashamed quacks. They didn’t ask to become this famous. Somehow the zeitgeist and some imbecile activist newspaper reporter decided to make them famous as people who are really bad at modeling anything. God help these people if they attempt to model something real, like chemical reaction dynamics, or, say, the earth’s atmosphere.

Returning to the mendacious loon, Ahmed, who brought this paper to world fame and attention. He asserts that the paper actually compares historical civilizations using this model. It does nothing of the sort. The paper mentions historical civilizations, but they don’t even make legalistic arguments that, say, the ancient Egyptians, whose civilization lasted for thousands of years, somehow follow these equations.  All they say is, ancient cultures were cyclical; they rise and fall; something everyone has known from the time of Heraclitus. Cyclical behavior does not imply this complex pastiche of differential equations; there are cyclical behaviors in nature which can’t be modeled by any differential equations. Finally, Ahmed asserts that the model predicts things. It doesn’t; nor does it claim to. It claims to model things. Modeling things and predicting things are very different.

The model itself was bad enough. What the activist-reporter said about it is inexcusable. The fact that everyone credulously picked up on this nonsense without questioning how Nafeez Ahmed made his living is even worse. Science by activist press release. Yeah, thanks a lot, “science journalists.” Nobody even noticed the clown who broke this story is a goddamned 911 truther.

A more reliable narrator than the Ahmed bozo who broke this story

I find all this intensely sad. I’m sad for the boobs who wasted their lives cranking out a model this useless. I’m sad for our civilization that it is possible to make a living publishing rubbish, and that talented people can’t make a living doing interesting and correct research which will benefit humanity. I’m also sad that journalists aren’t fired over their credulity regarding this fraud. I’m sad that ideological hogwash is published in all the papers as some kind of scientific truth, while nobody notices simple things, like the fact that the world fisheries are presently undergoing collapse, or the fact that there are no more rhinos because Chinese people haven’t discovered viagra yet.

I’m also sad that people are so obsessed with the end of the world. Maybe some day we’ll experience some kind of ecological apocalypse, or the imbeciles in the White House will nuke the slightly less stupid cavemen in the Kremlin. Chances are pretty good though, that before these things happen, we will all be dead. Wiser men than me have pointed out that anxiety about the end of the world is a sort of transference for anxiety about their own impending demise. As Spengler put it, “perhaps it is not the end of the world, but just the end of you.”

## In which I have a laugh at economists: whistling at the abyss

Posted in econo-blasphemy, history, philosophy by Scott Locklin on July 31, 2011

I never studied economics. Don’t pretend to understand it. Don’t want to understand it any more than I want to understand Voodoo theology or radical feminism: it seems to me a pernicious form of anti-knowledge. Some of it makes a little bit of sense (maybe voodoo theology does too: dunno), but looking at it like a visitor from another planet (MFM Osborne or Joe McCauley are reasonable approximations, being from planet Physics), it doesn’t look much different from schools of medieval medicine, punctuated by occasional linear regression models. There aren’t generally falsifiable models, and when there are, people seem awfully reluctant to test them. Economic schools seem to grow up around charismatic prophet types, and the arguments for their validity seemed to be along the lines of “Rabbi X said Y, and lo, he was correct.” I think everyone on the internet has seen the Hayek vs Keynes rap, which is about as good an introduction as one could hope for to this sort of thing. I think the intellectual content of a posing rap battle is about as much as one can hope for in this sort of argument as well; ultimately, it’s just a dong wagging contest.

Hayek’s views on economics are, I think (and someone please correct me if this is a misapprehension) closer to the conventional thinking in the 1920s. Keynes views seem to be something approaching the conventional wisdom in the 21st century. Austrian views are “conservative” and Keynes is “liberal” (in the American sense anyhow). This is a broad generalization; most modern Keynesians have some Austrian ideas, and vice-versa, but ultimately, the debate between these guys boils down conflict between these two ideas:

1. Expansion of debt is inevitably followed by economic recession (Austrian Business Cycle Theory).
2. Economic recession is ameliorated by deficit spending (Keynesian idea).

The historical battleground they fight their idea on is the Great Depression and WW-2; the events which formed the modern world. The modern Keynesian view is that “Austrian” ideas made the great depression worse. The government, according to them, should have engaged in lots of deficit spending, and that would have magically made things all better. After all, things only got better after WW-2, when we engaged in lots of deficit spending, right? I’m certain the Keynesians have all manner of regression models with which to “prove” this idea, but ultimately, they’re only using one set of data points, and only a couple of variables. This school of thought seems to have won the modern day; we’re at WW-2 levels of deficit spending now. Of course, we’re not spending the money on the same things at all. It’s not clear to me how the Austrians account for the financial success of the United States (and Japan and Germany and the Soviet Union) in the post WW-2 era, but it seems likely to be an equally specious shaggy dog story.

I don’t know if any school of thought argues that the war itself had something to do with things, but I’m going to argue exactly that; call it the Heraclitus school of economics. Seems like an obvious thing to me. I can’t “prove” it using regression models, or by being a college professor or whatever nebulous vril economists use to “prove” their points, but it seems as ultimately convincing as anything else. My toy model does something few economic ideas since Pareto has done: it takes into account the fact that we’re talking about large groups of actual human beings, rather than utility optimizing economic robots.

To reiterate: in Krugmanistan, the prevailing idea seems to be that printing a lot more money will magically make things all better, because dropping lots of bombs on Germany and Japan seemed to be good for the American economy in WW-2. To a Keynesian economist, it was the magic of the printing press. Not the fact that the US developed new technologies, invested in vast new industrial infrastructure, mobilized its entire population, brainwashed its civilians into working double shifts for small amounts of money (and buying lots of government debt), brainwashed its military aged men into fighting a war in distant countries, displaced vast segments of the population to work in factories; hell, we even put women to work in factories. All those other countries did the same thing. Car makers and other manufacturers built giant ships, aircraft which couldn’t have been built before, new kinds of vehicles, tanks, atomic bombs, jets; radio makers made huge strides in electronics, computers and other electronic techologies: and all these companies retained the ability to produce these new technologies after the war was over. Entirely new forms of economic output were possible after the war which weren’t possible before. To name five obvious ones: Airlines, Computers, Atomic power, Highway travel, Rocketry. These new technologies and manufacturing capabilities became new industries which provided people with jobs and further economic output creating things which were figments of people’s imaginations a decade previous. The United States (and all those other countries) made a hail Mary investment in their infrastructure, and transformed their people into fanatical worker bees. The amateur businessman could look at this as an investment in the country; an investment in the employees and the infrastructure. By accident, it was a reasonably intelligent investment for future growth. And after that, the economy did a lot better. Economists want you to believe it had something to do with printing money or business cycles.

I don’t buy the arguments of economists. I think the reason things changed for the better after WW-2 is people were transformed into something they weren’t before, and the national infrastructure was transformed into something a lot more capable than it was before. I do think availability of money is important (duh), and deflation is generally worse than inflation, but if you asked me why WW-2 was followed by a period of prosperity in the US, the above is my reason: nothing to do the magical printing of money or lack therof. Single factor regression models rarely work on systems more complicated than a couple of diodes: why should I be impressed by spurious regression on ancient data?

Another thing economists don’t seem to notice much: the nature of the population. Taking only one variable: mean age seems important to me. Old people don’t work or innovate as much as young people. Old people also have more money than young people, and they do things like invest this money in hopes of making rent on it. Basically, finance is the loaning of old people money to young people, so young people can do useful things with the money, like start businesses. Populations in all industrialized countries are getting older. This means there is a surplus of old people money seeking young people to invest in. This is why interest rates are low, despite all the printing of money going on everywhere. If there were more young people, we’d be in a completely different pickle. This single fact pretty much makes rubbish of any statistical model based on historical data: we’ve reached a fundamental change point which is unprecedented in economic history. There are no historical regimes in which there were lots of old people money chasing young people to invest in. The idea of fitting an economic model to something in the 1930s and expect it to be relevant today …. I might as well trade a model based on 1930s IBM stock prices.

Me? I’m not an economist, or a prophet. I work for a living. I don’t have any answers, and I don’t have any bright ideas as to how to fix the mess we’re in. I’m pretty sure nobody else does either; certainly no politicians alive today are saying anything remotely sensible -it’s all magical thinking, and genuflections before long dead sacred idols. Since I’m of a scientific bent, I wouldn’t mind running some experiments. It seems to me the country is large enough this sort of thing is possible. Hopefully we don’t have one forced on us.

format: plain


text:
# A problem about the limit of an integral

Let $g(x)$ be a continuous periodic function of period 1 on $\mathbb{R}$. Prove that for any integrable function $f(x)$ on $[0,1]$,
$$\lim_{n \to \infty}\int_0^{1}f(x)g(nx)dx= \int_0^{1}f(x)dx \int_0^{1}g(x)dx.$$

Any help is appreciated.

-

Begin with a transformation $u=nx.$

$$\int_{0}^1 f(x)g(nx)dx = \frac{1}{n} \int_{0}^n f(u/n)g(u)du.$$

Break the integrand up into a sum of intervals.

$$\frac{1}{n} \int_{0}^n f(u/n)g(u)du=\frac{1}{n}\sum_{j=1}^n\int_{j-1}^{j} f(u/n)g(u)du.$$

Make another variable transformation: $v=u-(j-1).$ Because $g(u)$ is 1 periodic $g(u)=g(u+1)=g(u+j-1).$

$$\frac{1}{n}\sum_{j=1}^n\int_{j-1}^{j} f(u/n)g(u)du = \frac{1}{n}\sum_{j=1}^n\int_{0}^{1} f \left(\frac{u-(j-1)}{n} \right)g(u-(j-1))du$$

Rearrange the terms. $$\frac{1}{n}\sum_{j=1}^n\int_{0}^{1} f\left(\frac{u-(j-1)}{n} \right)g(u-(j-1))du =\int_{0}^1 \left(\frac{1}{n} \sum_{j=1}^n f \left(\frac{u-(j-1)}{n} \right)\right)g(u)du .$$

We have now produced a Riemann sum which converges to an integral in the limit. We are now allowed, by dominated convergence theorem, to say

\begin{align*} \lim_{n\to \infty} \int_{0}^1 f(x)g(nx)dx &= \int_{0}^1 \left(\int_{0}^1 f(z)dz\right) g(u)du \\ &=\int_{0}^1 f(z)dz\int_{0}^1 g(u)du=\int_{0}^1 f(x)dx\int_{0}^1 g(x)dx . \end{align*}

-
Thank you so much. – Sume Aug 10 '11 at 3:28

this is not a good proof, just an idea. First consider f to be simple function, we can calculate that this identity holds. Then by the definition of Lebesgue integration, we can approximate f by simple functions. Because g is continuous(bounded), so there's no problem for the left hand side to converge.

-

Ok. I have seen this problem in the book: Principles of Real Analysis by C.D.Aliprantis and O.Burkinshaw, and since I knew that this book has a solution manual, I went and searched over there and got the solution. The problem given in the book is as follows:

$\textbf{Problem.}$ Let $f:(0,\infty) \to \mathbb{R}$ be a real-valued continuous function such that $f(x+1)=f(x)$ for all $x \geq 0$. If $g:[0,1] \to \mathbb{R}$ is an arbitrary continuous function, then show that $$\lim_{n \to \infty} \ \int\limits_{0}^{1} g(x) \cdot f(nx) \ dx = \Biggl( \ \ \int\limits_{0}^{1} g(x) \ dx \Biggr) \cdot \Biggl( \ \ \int\limits_{0}^{1} f(x) \ dx\Biggr)$$

$\textbf{Solution.}$ Please see the book: Problems in real analysis a workbook with solutions Problem 23.14 Page $\textbf{205}$ for a complete solution.

-


text:
mersenneforum.org A new conjecture concerning perfect powers
 Register FAQ Search Today's Posts Mark Forums Read

 2022-05-12, 01:07 #1 marcokrt   May 2022 11 Posts A new conjecture concerning perfect powers In the second half of April 2022, I submitted to the OEIS a new sequence of integers concerning perfect powers (see https://oeis.org/A353025), listing the smallest perfect powers written as the concatenation of any permutation of the integers from $1$ to $n$ (for any given $n$). Now, there are $94$ perfect squares that are smaller than $10^17$ and many others between $10^22$ and $10^29$, but no perfect power above 2 has been detected after several hours of computations on a standard CPU (moreover, the friend of mine who performed the mentioned search is still running his code hoping to find a cube consisting of $35 digits$, but no counterexample to the following conjecture has been found yet): Conjecture: All the terms of the OEIS sequence A353025 which are greater than $1$ are perfect squares and nothing else (no cube, no square of square, and so forth). The smallest counterexample (if any) should necessarily be greater than $1.01*10^34$ and it must be congruent modulo $9$ to $0$ or $1$ (for details, see DOI:10.13140/RG.2.2.30313.77921/1). Thanks in advance to everyone and good luck!
2022-05-12, 10:37   #2
LaurV
Romulan Interpreter

"name field"
Jun 2011
Thailand

22·23·109 Posts

Anything wrong with those 94 numbers, or my brain is farting now?

How do you generate those permutations, if there are more than 10 digits? Can you split 10 and 11, and 12, etc, and change the order of the digits, treating them as individuals, or you must always keep them together?

In the first case, I believe there should be more numbers in the list, and in the last, I believe there are some typos in the list. For example, I can not comprehend how the 94th (the first I was looking at, you know, I wanted to see the biggest one! ) does represent a permutation of the numbers 1 to 13, if you don't mess with each digit individually, and even so...

Quote:
 94 95641012181133721
Taking our all the digits between 4 and 9 inclusive (as they must be individual digits, i.e. single digits numbers, because the max used is 13), you are left with either too many 3s or too many 1s... As there is no 37 or 33 or 81, you can't have 11-3-3, and if you have 1-13-3, than what about the 1 at the end and the 1 before 8? (there is no 21 either, in both cases, the max is 13).

Last fiddled with by LaurV on 2022-05-12 at 10:44

 2022-05-12, 10:54 #3 charybdis     Apr 2020 81910 Posts Your conjecture is almost certainly false, but we don't have enough computing power to find a counterexample. Consider permutations of the numbers from 1 to 43. The digit sum is 1 mod 9, so such a number could theoretically be a cube. Such numbers have 77 digits. The probability that a randomly chosen 77-digit number is a cube is (number of cubes with 77 digits)/(number of numbers with 77 digits) = (10^(77/3) - 10^(76/3))/(9*10^76) = 1/(3.62*10^51). But the number of permutations is 43! = 6.04*10^52. In other words, there should be roughly (6.04*10^52)/(3.62*10^51) ≈ 17 cubes which are permutations of the numbers from 1 to 43, and it's overwhelmingly likely that at least one such counterexample exists. Edit: silly me, of course we aren't picking randomly, we're picking numbers that are 1 mod 9, and these are 6 times more likely to be cubes than randomly chosen numbers... so multiply that 17 by 6 to get about 100 counterexamples. You can run the same calculation to see that the first counterexample probably occurs for permutations from 1 up to one of 34, 35, 36 or 37. This is far too large for finding one to be feasible. Eventually you'll get fourth powers, and fifth powers, and so on. But those are even further out of reach. Last fiddled with by charybdis on 2022-05-12 at 11:06
2022-05-12, 19:32   #4
marcokrt

May 2022

11 Posts

Quote:
 Originally Posted by LaurV Anything wrong with those 94 numbers, or my brain is farting now? How do you generate those permutations, if there are more than 10 digits? Can you split 10 and 11, and 12, etc, and change the order of the digits, treating them as individuals, or you must always keep them together?

No, you cannot... otherwise we can easily find many "small" counterexamples, such as 2326^3, 308344^3, 416308^3, 22330489^3, 23584549^3, 25262887^3, and so forth.

Quote:
 Originally Posted by LaurV In the first case, I believe there should be more numbers in the list, and in the last, I believe there are some typos in the list. For example, I can not comprehend how the 94th (the first I was looking at, you know, I wanted to see the biggest one! ) does represent a permutation of the numbers 1 to 13, if you don't mess with each digit individually, and even so... Taking our all the digits between 4 and 9 inclusive (as they must be individual digits, i.e. single digits numbers, because the max used is 13), you are left with either too many 3s or too many 1s... As there is no 37 or 33 or 81, you can't have 11-3-3, and if you have 1-13-3, than what about the 1 at the end and the 1 before 8? (there is no 21 either, in both cases, the max is 13).

Good call, I've recently pointed out the "false positive" issue to the code creator, but I noted this for the cubes search permutating the string 123...2122. The conjecture is published on the OEIS together with the sequence A353025, so we would check also the b-file and the terms one by one. On the other hand, the provided code cannot skip any perfect power candidate, so we are 100% sure that ther isn't any perfect power above 2 among the terms of A353025 which are smaller than 10^34.
Any volunteers here to improve the given code and/or check which candidates among the given 94 squares really belong to A353025?

2022-05-12, 19:41   #5
marcokrt

May 2022

138 Posts

Quote:
 Originally Posted by charybdis Your conjecture is almost certainly false, but we don't have enough computing power to find a counterexample. Consider permutations of the numbers from 1 to 43. The digit sum is 1 mod 9, so such a number could theoretically be a cube. Such numbers have 77 digits. The probability that a randomly chosen 77-digit number is a cube is (number of cubes with 77 digits)/(number of numbers with 77 digits) = (10^(77/3) - 10^(76/3))/(9*10^76) = 1/(3.62*10^51). But the number of permutations is 43! = 6.04*10^52. In other words, there should be roughly (6.04*10^52)/(3.62*10^51) ≈ 17 cubes which are permutations of the numbers from 1 to 43, and it's overwhelmingly likely that at least one such counterexample exists. Edit: silly me, of course we aren't picking randomly, we're picking numbers that are 1 mod 9, and these are 6 times more likely to be cubes than randomly chosen numbers... so multiply that 17 by 6 to get about 100 counterexamples. You can run the same calculation to see that the first counterexample probably occurs for permutations from 1 up to one of 34, 35, 36 or 37. This is far too large for finding one to be feasible. Eventually you'll get fourth powers, and fifth powers, and so on. But those are even further out of reach.
This would be true if we assume that the probability to find a cube is equally distributed among the set of such candidates... yeah, a counterexample could theoretically exist, but it would be awesome to prove this (or to constructively find a perfect power above 2 by performing a random search there, hoping to find one of such unicorns).

In the end, I think that this could be an interesting comment to post on the OEIS too... and also a valid test to streach our computational power in the future, in order to see who will be able to find the first counterexample (if any). Moreover, the smallest perfect power >2 belonging to A353025 would be a good OEIS sequence by itself, giving it as "decimal expansion" of that number (keywords nonn, fini, full).

Last fiddled with by marcokrt on 2022-05-12 at 19:42

 2022-05-12, 21:01 #6 VBCurtis     "Curtis" Feb 2005 Riverside, CA 2·5·72·11 Posts You really ought to consider how many [expected] trials it would take to find one counterexample. I mean, Charybdis spelled it out for you, but you seem to have ignored him. A one in 10^50 chance per trial... c'mon.
2022-05-12, 21:11   #7
marcokrt

May 2022

11 Posts

Quote:
 Originally Posted by VBCurtis You really ought to consider how many [expected] trials it would take to find one counterexample. I mean, Charybdis spelled it out for you, but you seem to have ignored him. A one in 10^50 chance per trial... c'mon.

I know, by brute force actually it is very unlikely to find anything in a dozen years, using the current CPUs available. For this reason it would be interesting to work on the conjecture using mathematics or waiting quantum computers, maybe? Who knows... in the meantime the conjecture has not been disproved, as far as we know.

Finally, have someboby of you taken a look at Kashihara's conjecture (since 1996)? It states that (according to its author) there isn't any term belonging to the OEIS sequence A001292 which is a perfect power (disregarding A001292(1) = 1). We have checked it up to 10^1235 and we have not found any counteraxample.

Last fiddled with by marcokrt on 2022-05-12 at 21:13

 2022-05-12, 21:33 #8 marcokrt   May 2022 11 Posts P.S. The code writer (Aldo) has manually checked all the old b-file outputs and we have exactly 72 perfect squares belonging to A353025 which are smaller than 10191583652124141311716. Candidates 1-43 are ok. Then, we have 10-13-5-6-8-1-7-4-2-3-11-12-9 --> 44 - XX 45 10145718212113936 46 10-2-7-3-4-11-12-13-1-8-5-6-9 --> 45 47 10-3-9-1-4-12-11-3-8-5-2-1-7-6 --> 46 48 10-6-9-4-8-7-13-3-11-5-2-12-1 --> 47 49 10-7-13-2-9-3-5-12-4-11-6-8-1 --> 48 50 10-9-4-7-2-8-12-11-1-13-5-3-6 --> 49 - XX 51 11013125389146721 - XX 52 11038121341751296 - XX 53 11053681319247121 - XX 54 11213173481106529 - XX 55 11213472311091856 56 11-2-13-7-4-8-6-9-5-3-10-12-1 --> 50 - XX 57 11214101328395716 - XX 58 11291351028471361 59 11-3-1-8-9-12-10-5-4-2-13-7-6 --> 51 - XX 60 11328110357491216 - XX 61 11361038197125241 62 11-6-13-10-5-12-8-3-1-7-9-2-4 --> 52 63 11-8-3-13-7-5-6-1-2-10-4-12-9 --> 53 64 11-8-6-7-2-13-10-3-9-5-4-12-1 --> 54 65 12-13-10-4-7-8-11-1-5-3-2-9-6 --> 55 66 12-2-10-5-3-11-13-6-1-7-9-8-4 --> 56 67 12-2-9-13-3-11-5-4-10-8-1-7-6 --> 57 - XX 68 12311021567131849 69 1-2-3-7-13-6-8-11-5-12-9-10-4 --> 58 - XX 70 12511389126371041 71 12-5-9-8-4-11-13-2-1-10-7-3-6 --> 59 - XX 72 12741133825910161 - XX 73 12859110713124361 74 12-8-6-11-13-1-7-3-2-9-5-10-4 --> 60 75 13-10-11-1-8-6-12-5-7-3-9-2-4 --> 61 - XX 76 13318759261211041 - XX 77 13751214611018329 - XX 78 15113103721812496 - XX 79 16213112510379841 - XX 80 16798112351131024 - XX 81 18132127110314569 - XX 82 18351311069274121 83 3-13-2-9-11-6-1-12-10-7-5-8-4 --> 62 - XX 84 32121784510113169 85 3-9-8-1-13-6-2-12-7-5-11-10-4 --> 63 - XX 86 43139171611081225 - XX 87 51371123211048169 - XX 88 51611037284113129 89 5-8-9-11-12-4-13-10-6-7-3-2-1 --> 64 90 7-11-2-12-5-13-8-3-6-9-10-4-1 --> 65 91 7-12-8-9-6-11-4-3-13-1-10-2-5 --> 66 - XX 92 72511393110124816 93 8-3-7-6-11-13-4-2-1-10-5-12-9 --> 67 94 9-13-8-4-7-1-3-2-12-5-10-11-6 --> 68 - XX 95 95641012181133721 96 10-11-13-8-2-4-14-5-1-9-16-15-7-12-3-6 --> 69 - XX 97 10112141913836245151716 - XX 98 10113161253891156147241 - XX 99 10143413198521612115716 100 10-15-2-12-11-9-1-7-5-14-8-3-6-4-13-16 --> 70 - XX 101 10154811423137561916121 102 10-16-2-11-15-8-6-3-12-9-5-7-13-14-4-1 --> 71 - XX 103 10191516146128311354721 104 10-1-9-15-8-3-6-5-2-12-4-14-13-11-7-16 --> 72 For my conjecture, we should disregard A353025(1) = 1, thus we have 71 perfect squares in the range (2, 10191583652124141311716], while the search for cubes among all the permutations of 123...2122 is almost ended (with no counterexample found and a couple of hours left). No perfect powers above 2 up to 10^34 (no cube, no square of square, etc.). Last fiddled with by marcokrt on 2022-05-12 at 21:40
2022-05-12, 22:05   #9
marcokrt

May 2022

11 Posts

Quote:
 Originally Posted by charybdis Your conjecture is almost certainly false, but we don't have enough computing power to find a counterexample. Consider permutations of the numbers from 1 to 43. The digit sum is 1 mod 9, so such a number could theoretically be a cube. Such numbers have 77 digits. The probability that a randomly chosen 77-digit number is a cube is (number of cubes with 77 digits)/(number of numbers with 77 digits) = (10^(77/3) - 10^(76/3))/(9*10^76) = 1/(3.62*10^51). But the number of permutations is 43! = 6.04*10^52. In other words, there should be roughly (6.04*10^52)/(3.62*10^51) ≈ 17 cubes which are permutations of the numbers from 1 to 43, and it's overwhelmingly likely that at least one such counterexample exists. Edit: silly me, of course we aren't picking randomly, we're picking numbers that are 1 mod 9, and these are 6 times more likely to be cubes than randomly chosen numbers... so multiply that 17 by 6 to get about 100 counterexamples. You can run the same calculation to see that the first counterexample probably occurs for permutations from 1 up to one of 34, 35, 36 or 37. This is far too large for finding one to be feasible. Eventually you'll get fourth powers, and fifth powers, and so on. But those are even further out of reach.

Interesting argument, but there are additional constraints that we are missing by assuming an uniform distribution of cubes among numbers that are not consecutive integers (I am not saying that a counterexample wouldn't be absolutely resonable in this range)... (e.g., let us take any subset of the following set of numbers in the range (1-99) {2, 5, 6, 10, 14, 15, 18, 20, 22, 26, 30, 34, 35, 38, 40, 42, 45, 46,50, 54, 55, 58, 60, 62, 65, 66, 70, 74, 78, 80, 82, 85, 86, 90, 94, 95, 98} and then let us concatenate every permutation of the selected subset... how many perfect cubes (from 1 to 70+ digits) will we find? None, since no cube can belong to any of the above mentioned congruence classes modulo 100.

It is just an example to show that an interesting probabilistic argument cannot disprove this conjecture by itself, but it remains a good point to working on (IMHO).

Last fiddled with by marcokrt on 2022-05-12 at 22:14

2022-05-12, 22:48   #10
charybdis

Apr 2020

32·7·13 Posts

Quote:
 Originally Posted by marcokrt Interesting argument, but there are additional constraints that we are missing by assuming an uniform distribution of cubes among numbers that are not consecutive integers (I am not saying that a counterexample wouldn't be absolutely resonable in this range)... (e.g., let us take any subset of the following set of numbers in the range (1-99) {2, 5, 6, 10, 14, 15, 18, 20, 22, 26, 30, 34, 35, 38, 40, 42, 45, 46,50, 54, 55, 58, 60, 62, 65, 66, 70, 74, 78, 80, 82, 85, 86, 90, 94, 95, 98} and then let us concatenate them... how many perfect cubes (from 1 to 70+ digits) will we found? None, since no cube can belong to any of the above mentioned congruence classes modulo 100. It is just an example to show that an interesting probabilistic argument cannot disprove this conjecture by itself, but it remains a good point to working on (IMHO).
I never intended my argument to be a proof, and there isn't any way to turn it into one.

Anyway, you ask about whether it's safe to assume that our permutations have the same chance of being cubes as randomly chosen numbers do. There are two things that can throw this off:

(a) Cubes get gradually rarer as we go up through N-digit numbers. Permutations beginning with a 9 will also usually be rarer than those beginning with a 1, but the distribution isn't the same; there will be a sharp cutoff in the frequency of permutations.
How much does this affect our calculations? Not much. It will change the probabilities somewhat, but won't change the fact that by the time we get to permutations of 1-43 we are basically guaranteed a cube.

(b) Modular considerations. You already noted one, namely that permutations and cubes are both unevenly distributed mod 9. I already took this into account in my calculations. The uneven distributions of both permutations and cubes mod powers of 10 may also change the expectations by some constant factor. But there's nothing about our 1-n permutations that could make cubes wildly less likely or impossible, except for the mod 9 condition which we can easily take care of.
Your example above is totally contrived and I think you understand that.

Changing the expectations by a constant factor may change where we expect the counterexample to occur, but there are expected to be infinitely many counterexamples, so if you're trying to prove the conjecture true then a constant won't be enough.

[note: there are of course other ways that we might be able to tell that a number can't be a cube, e.g. if it has an algebraic factorization then maybe the factors have to be coprime and can't all be cubes, but they aren't relevant here]

This is one of many, many problems where "the heuristic suggests that X happens infinitely often, so we should expect X to happen infinitely often, unless there's some obvious reason why it can't".
Simple (proved) example: Dirichlet's theorem. There are infinitely many primes of the form a mod n, unless a isn't coprime to n.
Unproved examples: basically any unsolved conjecture pertaining to primes (twin prime conjecture, infinitely many Mersennes, Sierpinski conjecture and its generalizations...)

2022-05-12, 23:09   #11
marcokrt

May 2022

138 Posts

Quote:
 Originally Posted by charybdis I never intended my argument to be a proof, and there isn't any way to turn it into one. Anyway, you ask about whether it's safe to assume that our permutations have the same chance of being cubes as randomly chosen numbers do. There are two things that can throw this off: (a) Cubes get gradually rarer as we go up through N-digit numbers. Permutations beginning with a 9 will also usually be rarer than those beginning with a 1, but the distribution isn't the same; there will be a sharp cutoff in the frequency of permutations. How much does this affect our calculations? Not much. It will change the probabilities somewhat, but won't change the fact that by the time we get to permutations of 1-43 we are basically guaranteed a cube. (b) Modular considerations. You already noted one, namely that permutations and cubes are both unevenly distributed mod 9. I already took this into account in my calculations. The uneven distributions of both permutations and cubes mod powers of 10 may also change the expectations by some constant factor. But there's nothing about our 1-n permutations that could make cubes wildly less likely or impossible, except for the mod 9 condition which we can easily take care of. Your example above is totally contrived and I think you understand that. Changing the expectations by a constant factor may change where we expect the counterexample to occur, but there are expected to be infinitely many counterexamples, so if you're trying to prove the conjecture true then a constant won't be enough. [note: there are of course other ways that we might be able to tell that a number can't be a cube, e.g. if it has an algebraic factorization then maybe the factors have to be coprime and can't all be cubes, but they aren't relevant here] This is one of many, many problems where "the heuristic suggests that X happens infinitely often, so we should expect X to happen infinitely often, unless there's some obvious reason why it can't". Simple (proved) example: Dirichlet's theorem. There are infinitely many primes of the form a mod n, unless a isn't coprime to n. Unproved examples: basically any unsolved conjecture pertaining to primes (twin prime conjecture, infinitely many Mersennes, Sierpinski conjecture and its generalizations...)
Your probabilistic argument is good, as I've already said. My point is that we do not know whether or not there are additional constraints (unknown by us right now) which could drop the distribution of cubes or prevent a perfect power above two to be a term of A353025, but (since we don't know any of these hypotetical unknown constraints) we have only two solid arguments: several perfect squares up to 10^34 or 10^36 (in a few hours) and no cube, and a probabilistic argument that give us 100% chances to get one (infinitely many) perfect power(s) above 2 under the additional condition to assume that there are no fundamental unknown constraints which are able to substantially modify the internal probability distribution or prevent collisions to happen at all.
Thus, the conjecture could also been reverted and say: "You conjecture that there are infinitely many cubes belonging to A353025" and it is absolutely reasonable, even if we are not able to find any of those unicorns... a Schrödinger cat which you assume 100% dead (which does not mean that it cannot be alive) and I conjectured to be alive until we are able to look inside the box.

(e.g., we could say that the probability that a random triangle has a 108° degree interior angle is 0%, but we could easily provide infinitely many triangles of this kind).

Moreover, there are not sum(j=1, n)j! terms up to the biggest permutation of 1_2_3_..._(n-1)_n (but less than that), since the same number can occur from different permutations (just to point out it, but this is a minor argument).

Last fiddled with by marcokrt on 2022-05-12 at 23:16

 Similar Threads Thread Thread Starter Forum Replies Last Post Hugo1177 Miscellaneous Math 1 2021-01-13 22:15 didgogns Miscellaneous Math 1 2020-08-05 06:51 nibble4bits Math 31 2007-12-11 12:56 Numbers Puzzles 3 2005-07-13 04:42

All times are UTC. The time now is 20:05.

Fri Aug 19 20:05:22 UTC 2022 up 1 day, 17:33, 0 users, load averages: 0.62, 1.08, 1.32


text:
# Multiplication table of 16 | Shuffled, random, practice, copy, print

### Multiplication table generator - Shuffled in random order and interactive

I want to generate a multiplication table of

Containing lines.

Using this tool, you can basically generate not only the multiplication table of the 16 with 15 lines, but you can also practice them by clicking on the option "Practice with the generated table". Although simple, we hope this calculator is useful in some way.

You may have come here looking for answers to questions like:

• Multiplication table of 16 for printing.
• Multiplication table of 16 interactive.
• Multiplication table generator for 16 - Randomly shuffled.
• Multiplication table practice for 16. Or maybe:
• Multiplication table of 16 to copy and complete. Etc.


text:
# IEEE Journal on Emerging and Selected Topics in Circuits and Systems

## Filter Results

Displaying Results 1 - 25 of 26

Publication Year: 2013, Page(s):C1 - C4
| PDF (161 KB)
• ### IEEE Journal on Emerging and Selected Topics in Circuits and Systems publication information

Publication Year: 2013, Page(s): C2
| PDF (132 KB)
• ### Guest Editorial Fractional-Order Circuits and Systems

Publication Year: 2013, Page(s):297 - 300
Cited by:  Papers (4)
| PDF (1003 KB) | HTML
• ### A Systematic Approach for Implementing Fractional-Order Operators and Systems

Publication Year: 2013, Page(s):301 - 312
Cited by:  Papers (7)
| | PDF (1577 KB) | HTML

In this paper a generalized class of fractional-order systems is realized in digital hardware using a low-cost field programmable gate array (FPGA) device. First, fractional-order derivatives and integrals are realized in fixed-point hardware, wherein each coefficient and signal is represented with a custom number of bits. Both shift-form and delta-form structures are used for discretization, and ... View full abstract»

• ### Minimal Realizations for Some Classes of Fractional Order Transfer Functions

Publication Year: 2013, Page(s):313 - 321
Cited by:  Papers (7)
| | PDF (2002 KB) | HTML

It has been known that finding a minimal pseudo state space realization for a fractional order transfer function is helpful in circuitry implementation of such a transfer function with the minimum number of fractional capacitors. Considering this importance, the present paper deals with finding minimal realizations for some classes of fractional order transfer functions. To this end, at first some... View full abstract»

• ### Closed-Form Rational Approximations of Fractional, Analog and Digital Differentiators/Integrators

Publication Year: 2013, Page(s):322 - 329
Cited by:  Papers (13)
| | PDF (2469 KB) | HTML

This paper provides closed-form formulas for coefficients of convergents of some popular continued fraction expansions (CFEs) approximating sν, with , and (2/T)ν((z-1)/(z+1))ν. The expressions of the coefficients are given in terms of ν and of the degree n of the polynomials defining the convergents. The formulas greatly reduce the effor... View full abstract»

• ### Caputo-Based Fractional Derivative in Fractional Fourier Transform Domain

Publication Year: 2013, Page(s):330 - 337
Cited by:  Papers (14)
| | PDF (1696 KB) | HTML

This paper proposes a novel closed-form analytical expression of the fractional derivative of a signal in the Fourier transform (FT) and the fractional Fourier transform (FrFT) domain by utilizing the fundamental principles of the fractional order calculus. The generalization of the differentiation property in the FT and the FrFT domain to the fractional orders has been presented based on the Capu... View full abstract»

• ### Approximate Realization of Fractional-Order 2-D IIR Frequency-Planar Filters

Publication Year: 2013, Page(s):338 - 345
Cited by:  Papers (1)
| | PDF (2429 KB) | HTML

Starting with the established concepts of multi-dimensional network resonance, practical-bounded-input-bounded-output (BIBO) stability of multi-dimensional discrete systems, and the integer order approximation of fractional order filters, a new method for the realization of integer-order approximations of 2-D fractional-order systems having frequency-planar beam shaped passbands is proposed. The m... View full abstract»

• ### Fractional Order Butterworth Filter: Active and Passive Realizations

Publication Year: 2013, Page(s):346 - 354
Cited by:  Papers (57)
| | PDF (1940 KB) | HTML

This paper presents a general procedure to obtain Butterworth filter specifications in the fractional-order domain where an infinite number of relationships could be obtained due to the extra independent fractional-order parameters which increase the filter degrees-of-freedom. The necessary and sufficient condition for achieving fractional-order Butterworth filter with a specific cutoff frequency ... View full abstract»

• ### Design and Analysis of CMOS-Based Terahertz Integrated Circuits by Causal Fractional-Order RLGC Transmission Line Model

Publication Year: 2013, Page(s):355 - 366
Cited by:  Papers (12)
| | PDF (2184 KB) | HTML

A causal and compact fractional-order model is developed for complementary metal-oxide-semiconductor (CMOS) on-chip transmission line (T-line) at Terahertz (THz) frequencies. With consideration of the loss from frequency-dependent dispersion and nonquasi-static effects at THz, good agreement of characteristic impedance is observed between the proposed fractional-order model and the measurement up ... View full abstract»

• ### Measurement of Supercapacitor Fractional-Order Model Parameters From Voltage-Excited Step Response

Publication Year: 2013, Page(s):367 - 376
Cited by:  Papers (41)
| | PDF (1936 KB) | HTML

In this paper, we propose using a numerically solved least squares fitting process to estimate the impedance parameters of a fractional order model of supercapacitors from their voltage excited step response, without requiring direct measurement of the impedance or frequency response. Experimentally estimated parameters from low capacity supercapacitors of 0.33, 1, and 1.5 F in the time range 0.2-... View full abstract»

• ### Resonance and Quality Factor of the $RL_{alpha} C_{alpha}$ Fractional Circuit

Publication Year: 2013, Page(s):377 - 385
Cited by:  Papers (29)
| | PDF (2878 KB) | HTML

This paper introduces the general fundamentals of the fractional order RLαCα circuit, where α is the order of the elements. The generalized complex impedance of the RLαCα circuit can be purely real, imaginary, or short circuit. The stability analyses where two regions have been classified are introduced with many numeri... View full abstract»

• ### Analog Circuit Implementation of Fractional Order Damped Sine and Cosine Functions

Publication Year: 2013, Page(s):386 - 393
Cited by:  Papers (3)
| | PDF (2004 KB) | HTML

This paper introduces for the first time analog circuit implementations of two fundamental linear fractional order systems whose impulse responses called fractional order damped sine and cosine functions are the inverse Laplace transform of their irrational transfer functions. These analog circuit implementations are derived through rational function approximations of their irrational transfer fun... View full abstract»

• ### Analog Modeling of Fractional Switched Order Derivative Using Different Switching Schemes

Publication Year: 2013, Page(s):394 - 403
Cited by:  Papers (10)
| | PDF (2082 KB) | HTML

The paper presents comparison of two different switching schemes of variable order derivatives. The first one is additive-switching scheme, when change of order is caused by adding a derivative at the beginning of the system. The second one, introduced in this paper, is reductive-switching scheme, when change of order is caused by removing a derivative at the beginning of the system. For both meth... View full abstract»

• ### On FIR Filter Approximation of Fractional-Order Differentiators and Integrators

Publication Year: 2013, Page(s):404 - 415
Cited by:  Papers (6)
| | PDF (1860 KB) | HTML

This paper considers finite-length impulse response (FIR) filter approximation of differentiators and integrators, collectively called differintegrators. The paper introduces and compares three different FIR filter structures for this purpose, all of which are optimized in the minimax sense using iterative reweighted l1-norm minimization. One of the structures is the direct-form structu... View full abstract»

• ### A Survey of Fractional-Order Circuit Models for Biology and Biomedicine

Publication Year: 2013, Page(s):416 - 424
Cited by:  Papers (77)
| | PDF (1087 KB) | HTML

In this survey, we present many of the fractional- order circuit models used in biomedicine and biology to fit experimentally collected impedance data. An overview of the different methods used to extract the impedance parameters from collected datasets are also presented. Applications of fractional order circuit models for modelling human tissue, plant physiology, respiratory systems, and tissue-... View full abstract»

• ### Emerging Tools in Engineering: Fractional Order Ladder Impedance Models for Respiratory and Neural Systems

Publication Year: 2013, Page(s):425 - 431
Cited by:  Papers (7)
| | PDF (1326 KB) | HTML

This paper introduces the emerging tool from mathematics in engineering: fractional calculus. Consequently, it enables a novel concept of modelling biological systems by means of preserving the natural rules governing the system's dynamics, i.e., their intrinsic fractal (recurrent) structure. A generally valid ladder network model allows to preserve the anatomy of the system, thereby merging betwe... View full abstract»

• ### Fractional Order Generalization of Anomalous Diffusion as a Multidimensional Extension of the Transmission Line Equation

Publication Year: 2013, Page(s):432 - 441
Cited by:  Papers (10)
| | PDF (2652 KB) | HTML

In this paper, a new fractional order generalization of the diffusion equation is developed to describe the anisotropy of anomalous diffusion that is often observed in brain tissues using magnetic resonance imaging (MRI). The new model embeds three different fractional order exponents-corresponding to the principal directions of water diffusion-into the governing Bloch-Torrey equation. The model w... View full abstract»

• ### Observer-Based Approach for Fractional-Order Chaotic Synchronization and Secure Communication

Publication Year: 2013, Page(s):442 - 450
Cited by:  Papers (27)
| | PDF (1886 KB) | HTML

This paper presents a method based on the state observer design for constructing a chaotically synchronized systems. Fractional-order direct Lyapunov theorem is used to derive the closed-loop asymptotic stability. The gains of the observer and observer-based controller are obtained in terms of linear matrix inequalities (LMIs) formulation. The proposed approach is then applied to secure communicat... View full abstract»

• ### Reduced Order Approximation of MIMO Fractional Order Systems

Publication Year: 2013, Page(s):451 - 458
Cited by:  Papers (3)
| | PDF (2865 KB) | HTML

A new two-stage method for reduced integer order approximation of fractional multiple-input, multiple-output (MIMO) systems is proposed. In the first stage, the transfer function matrix (TFM) Gf(s) of the given fractional order MIMO system is obtained and an integer order approximate TFM R(s) is formed by applying an existing approximation method to each fractional order transfer functi... View full abstract»

• ### Using Self-Synchronization Error Dynamics Formulation Based Controller for Maximum Photovoltaic Power Tracking in Micro-Grid Systems

Publication Year: 2013, Page(s):459 - 467
Cited by:  Papers (16)
| | PDF (1861 KB) | HTML

This paper proposes a self-synchronization error dynamics formulation based controller for maximum photovoltaic power tracking (MPPT) of a photovoltaic (PV) array. The output power conversion of a PV array depends on atmospheric conditions, such as the solar radiation and ambient temperature, and its conversion efficiency is low. Therefore, a MPPT controller is necessary for a PV conversion system... View full abstract»

• ### Symbolic Fractional Dynamics

Publication Year: 2013, Page(s):468 - 474
Cited by:  Papers (2)
| | PDF (1093 KB) | HTML

Fractional dynamics reveals long range memory properties of systems described by means of signals represented by real numbers. Alternatively, dynamical systems and signals can adopt a representation where states are quantified using a set of symbols. Such signals occur both in nature and in man made processes and have the potential of a aftermath as relevant as the classical counterpart. This pape... View full abstract»

• ### Study on Control Input Energy Efficiency of Fractional Order Control Systems

Publication Year: 2013, Page(s):475 - 482
Cited by:  Papers (10)
| | PDF (1854 KB) | HTML

Control input energy efficiency is an important issue which should be considered in designing any control system. Due to the importance of this subject, in the present paper fractional order control systems are studied in the viewpoint of control input energy efficiency. In this study, the divergent terms of the control input energy function of fractional order control systems are obtained. It is ... View full abstract»

• ### IEEE Journal on Emerging and Selected Topics in Circuits and Systems information for authors

Publication Year: 2013, Page(s): 483
| PDF (112 KB)
• ### myIEEE

Publication Year: 2013, Page(s): 484
| PDF (772 KB)

## Aims & Scope

The IEEE Journal on Emerging and Selected Topics in Circuits and Systems publishes special issues covering the entire Field of Interest of the IEEE Circuits and Systems Society and with particular focus on emerging areas.

Full Aims & Scope

## Meet Our Editors

Editor-in-Chief
Eduard Alarcon

UPC BarcelonaTech

Barcelona, Spain

eduard.alarcon@upc.edu


text:
# Notes 002

## Koke_Cacao-LookingOutwards03

(LookingOutwards-03)

The Current Team made a strange and unpleasant video using 3D reconstructions. It uses badly made 3D models to address the issue of consumerism which is clever.

Other Great Artworks:

## Koke_Cacao-Pix2Pix

(05-Pix2Pix)

I have played this model years ago. The model tries very hard to fit both low-level pattern and border structure to the input data, which creates funny-looking images. But the model is only good at interpreting thin lines, with equal stroke weight and without color.

## Koke_Cacao-ArtBreeder

(05-ArtBreeder) ArtBreeder ProsePainter

The art breeder model is very cool. It magically preserves the lower-level pattern of oil paintings with relatively high resolution. This quality is often, at least to me, hard to achieve and requires a lot of hyperparameter tuning and GPU power. The fact that it can run on the browser this fast is amazing (is it running on a browser though? Or does it use backend GPU with querying?). Also, it is very rare to have a user interface that allows both breeding and gene-editing. I wonder if "breeding" means parameter breeding rather than pixel-wise breeding.

## Koke_Cacao-TextSynthesis

(05-TextSynthesis)

Using: Narrative Device Themes: coding, homework Result: The teacher looked up from his computer screen and saw that his student had not yet arrived. "I'm going to have to start grading your homework," he said, "but I want to make sure you are doing it right." Comment: This has nothing to do with coding homework. The model interpret coding as teacher's computer screen. The result might by highly "plagiarized" from a story book.

Using: inferkit Result:

The teacher looked up from his computer screen and saw that his student had not yet arrived. "I'm going to have to start grading your homework," he said, "but I want to make sure you are doing it right."

The student sighed, rolled his eyes, and said, "There's no point.

This is the ninth grade.

You'll do whatever I say and there's nothing I can do about it. "He sat down, and opened his book.

His teacher put his name in the "Now On and shook his head.

"I get to do this each and every night. Why can't you do it during the day?"

"Well," the teacher said, "when I set my alarm clock for noon, my friend buys me coffee.

I set it back to 5: 30 and I'm still awake.

It's got to be midnight by the time you go to bed.

There's no point in going to sleep."

The student sighed and closed his book.

Comment: The model only seem to pay attention to previous 2 sentences and major characters. Although attention (to characters) is all you need, but it is hard for the model to generate a global level theme of the text that is consistent and relevent.

## Koke_Cacao-VQGAN+CLIP

(05-VQGAN+CLIP)

Using: wikiart_16384 + ViT-B/32 + default paremeter Prompt: A student suffering from his coding homework

The image quality is not very good as other synthesizers based on image inputs (compared to models related to style transfer) since the natural language processing pipeline restricted the latent space or because they are not trained end-to-end. The style of the images generated can get very cliche very soon and the tool doesn't give the artists very much control over the generated image.

Table of Content


text:
# How do I get the square root of a complex number?

If I'm given a complex number (say $9 + 4i$), how do I calculate its square root?

-
The answers of using de Moivre's formula are correct but it may also be instructive to try and find the square roots directly using $(a+bi)^2 = 9 + 4i$ (say) and solve for $a$ and $b$ or even just use the quadratic formula directly, which will give you an appreciation for why we use de Moivre's formula. – Jason Polak Jun 9 '11 at 19:38
@automorphism: we use De Moivre's formula... Do we? For what purposes? (These are real questions.) – Did Jun 10 '11 at 6:53

The square root is not a well defined function on complex numbers. Because of the fundamental theorem of algebra, you will always have two different square roots for a given number. If you want to find out the possible values, the easiest way is probably to go with De Moivre's formula, that is, converting your number into the form $r(\cos(\theta) + i \sin(\theta))$, and then you will get $(r(\cos(\theta)+ i \sin(\theta)))^{1/2} = ±\sqrt{r}(\cos(\theta/2) + i \sin(\theta/2))$.

-
The "two different square roots" issue applies to real numbers as well; it's just that in that case there's a consensus on which one is the "principal" square root. – Dan Jun 9 '11 at 23:49
@user1374 There is also a consensus about which square root of a complex number is the principal square root--at least for almost every complex number... See my answer. – Did Jun 10 '11 at 5:55
Oh, and I am afraid I must object to the assertion that going with De Moivre's formula would be the easiest way. – Did Jun 10 '11 at 6:35
@Did What's the rational basis for having positive square roots as the principal square roots instead of negative square roots? – Doug Spoonwood May 22 '13 at 13:47
@DougSpoonwood You might want to explain what you have in mind when you call some complex numbers positive and some others negative. – Did May 22 '13 at 15:13

This is a three parts post. The first part was written by user Did, it provides a formula and some brief comments on it. The second part was written by user Hans Lundmark, it provides a geometric way to understand the formula. The third part was written by user t.b., it provides some explanatory pictures and some brief comments on them.

(Did) If one is able to compute the square root of every positive real number and the modulus of every complex number, a nice formula for the principal square root $\sqrt{z}$ of $z$ is $$\sqrt{z}=\sqrt{r}\frac{z+r}{|z+r|},\quad r=|z|.$$ Try to prove it and you will see, it works...

The principal square root is the one with a positive real part. The only case when the formula fails is when there is no principal square root, that is, when $z$ is a negative real number.

No sine or cosine is involved, one does not even need to solve second degree polynomials, one just uses squares and square roots. For example, for $z=9+4\mathrm{i}$, $$\sqrt{z}=\frac{9+\sqrt{97}+4\mathrm{i}}{\sqrt{2(9+\sqrt{97})}}.$$

(HL) There's a geometric way of understanding the formula in Did's answer. To find a square root of a given complex number $z$, you first want to find a complex number $w$ which has half the argument of $z$ (since squaring doubles the argument). Compute $r=|z|$ and let $w = z+r$; thus $w$ lies $r$ steps to the right of $z$ in the complex plane. Draw a picture of this, and it should be clear that the points $0$, $z$ and $w$ form an isosceles triangle, from which one sees that the line from $0$ to $w$ bisects the angle between the real axis and the line from $0$ to $z$. In other words, $w$ has half the argument of $z$, as desired. Now it only remains to multiply $w$ by some suitable real constant $c$ so that $|cw|^2 = |z|$; then we will have $(cw)^2=z$ and hence $cw$ is a square root of $z$. Obviously, $c=\pm\sqrt{|z|}/|w|$ will do the trick, so this method only fails when $w$ happens to be zero, i.e., if $z$ is a negative real number.

(t.b.) Following a suggestion of Did, I take the liberty of adding two pictures I originally posted as a separate answer, but it seemed better to have them here:

Here's the picture for $z = 9 + 4i$:

Remark: The construction of the square roots is geometrically exact. That is to say, they were constructed using straightedge and compass only. I decided to hide the construction, as it seems rather obfuscating the intended illustration than adding to it. Nevertheless, I suggest taking a moment and thinking about how you would achieve the geometric construction.

Here's the construction I used: Intersect the circle around $z/2$ through $z$ with the tangent to the unit circle orthogonal to $z$. Then $h^2 = (|z|-1)\cdot 1$ and thus the red circle has radius $\sqrt{|z|}$. It remains to intersect the red circle with the angular bisector of the $x$-axis and $z$ which I constructed using the process Hans described in his part of the post.

The pictures were created using GeoGebra.

-
@Hans: Yes. This is a question where a picture would be useful (if only I knew how to draw pictures on MSE (and if I had more time on my hands)). Thanks. – Did Jun 10 '11 at 6:14
Hans: Following a suggestion of @Didier I added two pictures I originally posted as a separate answer. It seemed more reasonable to have them in one answer. I hope you don't mind. – t.b. Jun 10 '11 at 11:44
Since you can't see it on my deleted post, here's @Didier's original comment: "Theo and @Hans: What do you think about the idea of making one single post from our three complementary answers? (Re reputation, if that matters, either one of you may sign the resulting post, I really do not care.)" I refrain from adding Didier's answer in since it seems a bit too aggressive an edit to me, but I'd be strongly in favor of doing it. – t.b. Jun 10 '11 at 11:53
@Hans: very true. To reduce confusion, I deleted my comment :) – t.b. Jun 11 '11 at 14:49
@legends2k Right, the formula gets even simpler... Thanks for noticing this. Since you checked the formula, I cancelled the mention "unless I am mistaken". – Did Jan 6 '14 at 14:53

Here is a direct algebraic answer:

Suppose that $z=c+di$, and we want to find $\sqrt{z}=a+bi$ lying in the first two quadrants. So what are $a$ and $b$?

Precisely we have: $$a=\sqrt{\frac{c+\sqrt{c^{2}+d^{2}}}{2}}$$ and $$b=\frac{d}{|d|}\sqrt{\frac{-c+\sqrt{c^{2}+d^{2}}}{2}}.$$ (The factor of $\frac{d}{|d|}$ is used so that $b$ has the same sign as $d$) To find this, we can use brute force and the quadratic formula. Squaring, we would need to solve $$a^2-b^2 +2abi=c+di.$$ This gives two equations and two unknowns (seperate into real and imaginary parts) which can then be solved by substitutions and the quadratic formula.

Hope that helps,

-

One way is to convert the complex number into polar form. For $z = re^{i\theta}$, $z^2 = r^2 e^{i(2\theta)}$. So to take the square root, you'll find $z^{1/2} = \pm \sqrt{r} e^{i\theta/2}$.

Added: Just as with the nonnegative real numbers, there are two complex numbers whose square will be $z$. So there are two square roots (except when $z = 0$).

-

You can also do following (technique often advised at school) :

• Let's write $z² = 9 + 4i$ with $z = a + bi$. The goal is to find $z$

Thus we have $(a + bi)² = 9 + 4i$ and if you expend we get $a²+ 2abi - b² = 9 + 4i$

If you identify the real and imaginary parts, you obtain :

$a²-b² = 9$ (1)

and

$2ab= 4$ (2)

• Now, as $z² = 9 + 4i$, the modulus of $z²$ and $9 + 4i$ are equal so we can write :

$a²+b² = \sqrt{9²+4²}$

$a²+b² = \sqrt{97}$ (3)

• Now find $a$ and $b$ with the the equations (1) , (2) and (3) :

(1) + (3) $\Leftrightarrow 2a² = 9+\sqrt{97}$

so $a = \sqrt{\frac{1}{2}(9+\sqrt{97})}$ or $a = - \sqrt{\frac{1}{2}(9+\sqrt{97})}$

With equation (2) and the previous result you can now find $b$ :

$2ab= 4$

$b= 2/a$

so $b = 2\sqrt{\frac{2}{9+\sqrt{97}}}$ or $b = - 2\sqrt{\frac{2}{9+\sqrt{97}}}$

The answer is : $z = \sqrt{\frac{1}{2}(9+\sqrt{97})} + 2i\sqrt{\frac{2}{9+\sqrt{97}}}$ or $z = - \sqrt{\frac{1}{2}(9+\sqrt{97})} - 2i\sqrt{\frac{2}{9+\sqrt{97}}}$

-

$x^2 - y^2 +2ixy$ = write the complex no.

$x^2 - y^2$ = write the real value---------(1)

$2xy$ = write the imaginary value------(2)

from equation (1) and (2)

$x^2 + y^2 = \sqrt{(x^2 - y^2)^2 + 4x^2y^2}$

you will get $x^2 + y^2 = ?$ -------(3)

from equation (1) and (3)

you will get the value of $x$ and $y$

-

Here's a useful picture from Wikipedia (ref). This helps visualise some comments above about having two square roots of most complex numbers.

The horizontal plane is the original complex number $z$.

The vertical axis is the real part of the square root(s) of $z$. (Note how there are two solutions for most numbers, i.e. all except zero.)

The colour is the angle of a square root of $z$, where red is 0° i.e. the real axis, cyan is $\pm$180° and so on.

The principal square root is the top half of the surface.

The see how the imaginary part behaves, rotate the surface 180° about the vertical axis. (Of course, the colours don't rotate, they stay where they are. More precisely, the magenta part will go to the bottom, and the green to the top, while the yellow and blue will stay as they are.)

-

The two roots to the equation $x^2 = a +bi$ are

$$x = \pm\frac{\sqrt{2}}{2}\left(\sqrt{\sqrt{a^{2}+b^{2}}+a}+i\sqrt{\sqrt{a^{2}+b^{2}}-a}\right).$$

To prove this, simply plug in and verify:

Proof. $$\left[\pm\frac{\sqrt{2}}{2}\left(\sqrt{\sqrt{a^{2}+b^{2}}+a}+i\sqrt{\sqrt{a^{2}+b^{2}}-a}\right)\right]^{2} =\frac{1}{2}\left[\sqrt{a^{2}+b^{2}}+a-\left(\sqrt{a^{2}+b^{2}}+a\right)+2i\sqrt{\left(\sqrt{a^{2}+b^{2}}+a\right)\left(\sqrt{a^{2}+b^{2}}-a\right)}\right] =\frac{1}{2}\left[2a+2i\sqrt{a^{2}+b^{2}-a^{2}}\right] =a+i\sqrt{b^{2}}=a+ib.$$

-