Archive for April, 2024

Korean farmers call for longer grace period

April 8, 2024

green field and trees under cloudy sky
Photo by Q. Hưng Phạm on Pexels.com

South Korean farmers faced with their traditional system of animal agriculture being phased out by 2027 are calling for a longer grace period, in addition to direct financial compensation, as reported by ABC News on January 9.

One farmer was quoted as saying:

..they’re infringing upon freedom of occupational option. We can’t just sit idly.

A former farming association secretary attending a rally was quoted by the ABC as saying:

…industry workers are in their 60s and 70s, which means they are seeking retirement, not new occupations.

Some farmers quoted by ABC News admitted that:

…their businesses will naturally disappear when older people, their main customers, die. 

These are South Korean farmers, such as Ju Yeongbong, a former secretary general of a farmers’ association, and Son Won Hak, a farmer and leader of a farmers’ association.

“We do recognise that far more people do not eat dog meat compared to those who do. We do know the market is decreasing… but still, it’s our right to run a business,” said Joo Yeong-bong, an experienced dog farmer and the president of the Korean Association of Edible Dog.

Joo said: “…but still, it’s our right to run a business…”

Is it really a right to run such a business, though?

South Korea’s parliament has endorsed landmark legislation outlawing the country’s dwindling dog meat industry, as public calls for the ban have grown sharply amid animal rights campaigns and worries about the country’s international image.

Some angry dog farmers said they plan to file a constitutional appeal and launch rallies in protest, suggesting that heated debate would continue.

ABC News, January 9 2024

The ABC News article goes on to say that:

Dog meat consumption, a centuries-old practice on the Korean Peninsula, is neither explicitly banned nor legalised in South Korea.

Recent surveys show more people want its ban and a majority of South Koreans don’t eat dog meat any longer.

But the surveys also indicated one in every three South Koreans still oppose the ban even though they don’t eat dog meat.

On Tuesday, the National Assembly passed the bill by a 208-0 vote.

President Yoon Suk Yeol’s government supports the ban, so the subsequent steps to make it law are considered formality.

The bill would make the slaughtering, breeding, trade and sale of dog meat for human consumption illegal from 2027, and punish such acts with two to three years in prison.

But it doesn’t stipulate penalties for eating dog meat.

So, while this is obviusly positive news for anyone who thinks dogs should not be consumed by humans, can we now expect a growing black market in dog meat to emerge in South Korea, just as there is a Moon Bear bile black market in Vietnam, now that the bear bile industry is being dismantled there, in some cases willingly, by former bear bile farmers?

In 2019, the Humane Society International was quoted as estimating that “…nearly 30 million dogs are killed just across Asia every year for human consumption”. A dog is slaughtered every second, somewhere in Asia, e.g. Vietnam, South Korea, and the Philippines. (SBS News)

Many people in Western countries are likely to be horrified to learn that dogs are consumed for food in South Korea and elsewhere, in addition to being used to create leather goods in some places, such as China, as shown in this undercover investigation.

But can you just imagine what would happen if the Australian government not only decided to phase out the caged hen system in 2036, and live sheep export in a few years’ time (fulfilling an election promise), but in addition (changing only one word from a quote above):

…to make the slaughtering, breeding, trade and sale of pig meat for human consumption illegal from 2027, and punish such acts with two to three years in prison.

Just imagine the public outcry!

As it is, the egg industry wants an additional decade, and given the mood so far, some members of the sheep industry will quite likely start looking like those farmers who have been protesting in South Korea soon enough. This is despite the live export by sea of sheep, cows, goats, and deer having been phased out by our neighbour, New Zealand since April 2023. NZ can still export by air and so will Australian sheep farmers, so it’s still not an end to the trade as a whole!

It’s possible to have sympathy for such opposing voices from the point of view that no-one wants to see anyone’s livelihood threatened or for peoples’ mental health to suffer. But sometimes, change is necessary for there to be progress toward a better world.

It was an argument with an old friend about the annual Chinese Yulin meat festival that accelerated my thinking about the difference between what we in Australia vs other countries, think of as livestock.

But the uncomfortable, fundamental question is simply this…

Is there an important difference between dogs, cows, pigs, sheep, goats, or deer?

They’re all mammals, like us. They care for their young, show fear, feel pain, and each in their own way, express emotion.

That some may be considered smarter than others is immaterial.

That they are sentient, feeling creatures is not immaterial.

I suspect that the majority of people in Australia, if asked: “would you eat a dog?”, would look at you as if you were insane and disgusting, while at the same time considering eating pigs, sheep or cows to be normal.

That we consider some animals to be friends and others to be food or fur is at least in part, an accident of the circumstances of our birth, the culture we have been raised in.

As Peter Singer declares in his book, Animal Liberation:

I am no more outraged by the slaughter of horses or dogs for meat than I am by the slaughter of pigs for this purpose.

In a very mundane sense, stripped of any notions of reverence, culture is the accumulated beliefs, practices and norms of people, doing things over a long enough period of time that they can say to themselves and to others: “this is what we do and it’s what we’ve always done”.

The same is also often true for the religion people are born into.

But are cultural practices and beliefs always moral and worthy of respect? Sometimes, saying things like “we are upholding our cultural practices by doing XYZ”, when laid bare, is not much different to saying “we are doing XYZ, because that’s the way we’ve always done things around here”.

See the Five Monkeys Experiment for a nice illustration of this.

Are all our laws moral?

Slavery was once legal, widespread and socially acceptable.

Homosexuality was once illegal and in some places, it still is.

The fact that the dog meat trade will soon be illegal in South Korea has no bearing on whether it is now or ever was moral.

Do we really need laws or gods to tell us what is right and wrong?

Can it be that something is moral in one place but not in another, or does it seem more likely that it is just considered illegal or culturally acceptable in one place and time but not another?

If you subscribe to rules-based ethics, what you consider to be right and wrong depends upon the rule, e.g.

  • Have dominion over all the creatures of the earth, vs
  • prevent unnecessary suffering and death.

If you take your moral guidance from holy books, you are doing what you think gods are telling you to do, which may or may not be the same as what’s right.

Consequentialist ethics tend to focus more on the concrete than the abstract. Suffering and whether or not to consider others as a means to our ends, are the key variables in the moral calculus here.

I discovered when we suffer, we suffer as equals, and in their capacity to suffer, a dog, is a pig, is a bear, is a boy.

Philip Wollen

Waiting for T Corona Borealis

April 7, 2024

T Corona Borealis — T CrB for short — is one of ten known recurrent novae. At a distance of around 3000 light years, it was first discovered as a nova eruption in 1866 by John Birmingham. Outbursts occur approximately once every 80 years. It may have been observed in 1217 and in 1787 as well.

T CrB is expected to explode again this year reaching naked eye visibility, around magnitude 2 or 3. The last outburst was in 1946. As always when we talk about astronomical objects, these events happened long ago, 3000 years ago in this case, with the evidence only expected to reach us this year due to the speed of light.

This is likely to be the brightest nova of a generation, certainly of the known recurrent novae. It will quickly rise from a visual band magnitude of 9 or 10 within a day or two to become visible to the naked for a few days, remaining a binocular object for a week or thereabouts, then returning to its pre-eruption magnitude within a month or so.

Exactly when it will brighten is uncertain and is discussed by nova expert Brad Schaefer and others in this AAVSO article, but the prediction is 2024.4 +/- 0.3, so May or June, but it could be earlier or later.

There was a pre-eruption dip in the light curve, 1.1 years before the 1946 outburst. A similar dip happened in March 2023 as shown in the last two years of T CrB observations in V and B bands, more prominent in the B band.

T CrB is located low in the north-eastern sky from Adelaide starting in the late evening. This Stellarium screenshot shows the circumstance for Apr 8 at midnight when T CrB is around 15 degrees above the horizon. Waiting an hour or two will help make observing easier with T CrB culminating at around 29 degrees above the horizon, but the region is viewable from around 11:30pm with a clear NE horizon.

This unprocessed, untracked image was taken with my DSLR (Canon 1100D, 100mm lens, f2.0, ISO 100, 10 secs) on Apr 7 at 2am, so it’s a little further rotated anti-clockwise than the Stellarium view above. The red arrow points to where T CrB will become visible and the green arrow points to alpha CrB (Alphecca). This shows the bright stars of the constellation of Corona Borealis.

Here is an AAVSO finder chart, with stars only down to magnitude 5. You’ll need to rotate it slightly clockwise to match the views above.

The comparison star marked 22 is the magnitude 2.2 star Alpheccca (alpha CrB). Izar and Arcturus (epsilon and alpha Bootis) do not appear in this finder chart, and are at upper left of the constellation Corona Borealis in this orientation. T CrB may approach Alpheccca in brightness.

I’ll be looking out for T CrB whenever I can stay up late enough or get up early enough until the outburst happens, using just the unaided eye in the first instance. Once visible in outburst, I’ll make estimates with 7×50 binoculars and time-permitting, DSLR images for subsequent photometry, submitting both to the AAVSO International Database.

Messages will also be posted on the AAVSO nova forum when the T CrB outburst happens.

On the N Days Of Christmas, part 6 (TL;DR)

April 6, 2024

This post summarises the results of earlier posts.

For each method, the following are given:

  • A worked example for n=12 days, the only one that matters in practice for The Twelve Days of Christmas as opposed to the general problem of The N Days of Christmas I’m interested in.
  • The mathematical notation generalising the method, sometimes shown together with the worked example.
  • A function in the Julia programming language showing:
    • how to compute the N Days of Christmas using the method;
    • the time taken for n=100,000 and n=1000,000,000 on my M2 Mac OS X laptop, i.e. the time taken for the function calls daysofxmas(100000) and daysofxmas(1000000000) to complete.

Where multiple functions were presented for a method in earlier posts, the most efficient and representative (closest to the mathematical notation) is given.

Subtle considerations regarding function parameter and variable types that allow larger values of n to yield correct results are omitted from the code here; assume very large (128 bit) integer types.

Headings link back to the post in which the method was first introduced.

Cumulative Row Addition

Worked example for 12 days

  • Day 1: 1
  • Day 2: 1 + 2 = 3
  • Day 3: 1 + 2 + 3 = 6
  • Day 4: 1 + 2 + 3 + 4 = 10
  • Day 5: 1 + 2 + 3 + 4 + 5 = 15
  • Day 6: 1 + 2 + 3 + 4 + 5 + 6 = 21
  • Day 7: 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28
  • Day 8: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36
  • Day 9: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45
  • Day 10: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
  • Day 11: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = 66
  • Day 12: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = 78

Adding all the results in bold gives: 1 + 3 + 6 + 10 + 15 + 21 + 28 + 36 + 45 + 55 + 66 + 78 = 364.

Mathematical notation

Julia function

function daysofxmas(n)
    total = 0
    for day in 1:n
        daysum = sum(1:day)
        total += daysum
    end
    total
end

Run-time for n=100,000: 0.0005 seconds

Run-time for n=1000,000,000: 8.5 seconds

Notes

  • The mathematical notation is given with application to 12 days. 12 can be replaced by n for generality.
  • The run-time for this method can be significantly higher. In particular, if two nested loops are used instead of a single outer loop and the efficient sum() call shown here, the time taken can be closer to 20 seconds instead of a fraction of a second. See the Row Addition post for more details.

Column Addition, i.e. Dot Product

Worked example for 12 days

  • 12 lots of gift 1 = 12
  • 11 lots of gift 2 = 22
  • 10 lots of gift 3 = 30
  • 9 lots of gift 4 = 36
  • 8 lots of gift 5 = 40
  • 7 lots of gift 6 = 42
  • 6 lots of gift 7 = 42
  • 5 lots of gift 8 = 40
  • 4 lots of gift 9 = 36
  • 3 lots of gift 10 = 30
  • 2 lots of gift 11 = 22
  • 1 lot of gift 12 = 12

Mathematical notation

Julia function

function daysofxmas(n)
    days = [1:n;]
    sum(days .* reverse(days))
end

Run-time for n=100,000: 0.0007 seconds

Run-time for n=1000,000,000: 33.7 seconds

Notes

  • The mathematical notation is given with application to 12 days.
  • There’s a lot more going on in the function code than meets the eye. Reversing a large list (of 100,000 elements in this case) takes time, multiplication is time consuming, and so on. There are faster ways to do this, but few quite so concise.
  • The simplification shown in the worked example of doubling half the sequence of additions is not used in the function here, because as noted in the Dot Product post, it does not help the run-time and complicates the code.

Triangular Numbers

Worked example for 12 days and mathematical notation

Julia function

function triangular(n)
    div(n*(n+1), 2)
end

function daysofxmas(n)
    total = 0
    for n in 1:n
        total += triangular(n)
    end
    total
end

Run-time for n=100,000: 0.0003 seconds

Run-time for n=1000,000,000: 6.8 seconds

Notes

  • See the Triangular Numbers post for the background of how we arrive at triangular numbers. Spoiler alert, it involves triangles. 🙂 A clue is that half of the width times the height of a rectangle is the area of a triangle, which if you peer closely at the triangular function above, you’ll see.

Polynomial Model

Worked example for 12 days and mathematical notation

Julia function

function daysofxmas(n)
    div(n^3, 6) + div(n^2, 2) + div(n, 3)
end

Run-time for n=100,000: 0.00001 seconds

Run-time for n=1000,000,000: 0.00001 seconds

Notes

  • See Polynomial Model re: how the polynomial expression is arrived at.
  • This is the fastest of all the approaches, for any value of n.

Summary

Taking the results for n=100,000 and n=1,000,000,000 into account, we have the following ranking:

RankingMethod
1Polynomial Model
2Triangular Numbers
3Row Addition
4Dot Product
Ranking of methods and their functions

As n gets larger, the run-time difference between the methods due to these time complexity variations becomes more obvious, as can be seen from the results.

The polynomial model method computes the N Days of Christmas in constant time vs linear or quadratic time for the other methods.

It satisfies my initial goal of a simple expression with the lowest computational time complexity and shortest run-time, for any value of n. It is more than a million times faster than its nearest competitor for n = 1 billion.

If I was looking for the fastest possible function implementations, I’d use a language like C, but Julia is better than some other scientific computing languages in this regard.

“Simplest” or “most compact” may be in the eye of the beholder when it comes to mathematical notation (they’re all fairly compact) but shortest function run-time is harder to argue with.

The final post, part 7, briefly explores a possible link between triangular numbers and the polynomial model.