Wednesday, 14 March 2018

Prime conjunctions and Dickson's conjecture

Way back in 2013 I blogged about "Prime Conjunctions". If you want to get the most out of this posting you will need to read that article first (use the search box) but I will supply some background here anyway.

This all started when one day I noticed that all my children's ages were prime numbers (and, of course, they remained like that until one of them had a birthday and spoilt everything). Not every set of people are destined to enjoy such a prime conjunction but how lucky do they have to be to have one? Since most prime numbers are odd it is unsurprising that a major thing to investigate is whether there will be a period when all their ages are odd and this was the main focus of my previous posting. But before recounting that story let's briefly consider the case that the prime 2 might occur as part of a prime conjunction. To determine whether that is possible all you need do is note the ages of your other children in the full year of one of your children being two; throughout the year these ages will change slightly as your other children have their birthdays and you see whether they ever become prime together. You have to do this for each child and the period in which they are two.

Having dispensed with the case that a prime conjunction might involve the prime number 2 we shall, from now on, just consider whether a prime conjunction with odd primes only can occur. So we shall begin by considering whether your children can have an odd conjunction: a period when all their ages are odd. It is not difficult to find the condition. If you list their ages at the beginning of the year in the order in which their birthdays occur you can look forward to them all being odd if that list is either a bunch of odds followed by a bunch of evens or a bunch of evens followed by a bunch of odds.

For example if on 1 January the ages in birthday order through the year are 10, 6, 9 then when the 6 year old turns 7 the ages will be 11, 7, 9 (because the 10 year old has already turned 11). On the other hand if their ages on 1 January had been 10, 5, 8 there is never a period when all their ages are odd.

It is also easy to see that even when an odd conjunction is possible there is only one period between birthdays when it occurs (in the example 10, 6, 9 that is the period in the year when the first two birthdays have occurred but the third not yet - and this is in every other year).

Essentially then if we are given a set of people we can tell if an odd conjunction is possible and, if it is possible, we can determine the unique interval in the year when it occurs. I shall mention in passing here that, obviously, if an odd conjunction occurs, then other odd conjunctions occur at two year intervals so once we have one odd conjunction we shall have infinitely many. That suggests a related question: if there is a prime conjunction are there infinitely many? That may seem like a much stronger requirement but we shall see that it really isn't. So, for the moment, let's consider whether there are an infinite number of prime conjunctions. At the end of this article I'll return to the original question.

So let's assume you have carried out the calculation above and found that your children do have an odd conjunction. If there are going to be prime conjunctions then they must occur in the same period of the year when the odd conjunctions occur. The mathematical expression of the question therefore is: given k odd numbers a1, a2, ..., ak can we find some number n (indeed, an infinite collection of numbers n) to add to all of them making them prime? These numbers n will, of course, all be even.

As an easy test case consider divisibility by 3. Is it possible that no matter what value n we add to the set of ages we shall always find one that is a multiple of 3? Yes, indeed! The condition is simply that among the k remainders when the ak are divided by 3 all the possible remainders 0, 1 and 2 occur; if so this condition must persist when a number n is added. For example the ages 7, 9, 11 never become prime if we a positive number n to all of them as their remainders on division by 3 are 1, 0 and 2. But notice also that if only two (or one) possible remainders occurred (as, for example, 7, 9, 13) then there will be an infinite set of values n (1, 4, 7, 10, ... ) where none of a1 + n, a2 + n, ..., ak + n are divisible by 3.

A similar condition must hold for every prime p: if the remainders when a1, a2, ..., ak
are divided by p do not include every possible remainder 0, 1, ..., p-1 then there are infinitely many values of n for which every sum a1 + n, a2 + n, ..., ak + n is not divisible by p. It's convenient to give a name to this phenomenon.We shall say that a1, a2, ..., ak satisfies the p-condition if, among the remainders on dividing a1, a2, ..., aby p, at least one remainder does not occur. The point is that, when the p-condition holds, then there will be infinitely many values of n for which the set al + n, a+ n,...,ak + n contains a number not divisible by p. So if we are looking for an infinite number of prime conjunctions we want the p-condition to hold for all values of p. This seems like a strong condition to require but it isn't: it's easy to see that the p-condition almost always holds. Indeed it holds for all p>k (because then k remainders cannot exhaust the set of all possible remainders).

So here's the $64000 question. Well, actually, it's more like the $64000000000 question. If the p-condition always holds will we necessarily have a prime conjunction? This is where Dickson's conjecture enters the scene. It states: Let a1, a2, ..., ak and b1, b2, ..., bk be positive integers. Suppose that there is no prime p which divides the product (al + nb1)(a+ nb2)...(ak + nbk) for all values of n. Then there are infinitely many values of n for which all of al + nb1, a+ nb2,...,ak + nbk are prime.

Let's restate that conjecture in the special case that all the bi are equal to 1. It then states: suppose there is no prime p that divides at least one of al + n, a+ n, ... , ak + n for all values of n. Then, for infinitely many values of n, all of al + n, a+ n, ...,, ak + n are prime. To put this in the language we have been using the conjecture says: if the p-condition holds for all primes p then al, a,..., ak have infinitely many prime conjunctions.

Thus, assuming Dickson's conjecture, the bottom line on how to find a prime conjunctions (if they exist) given a set of ages a1, ..., ak on 1 January is the following:
  • Determine whether there is an interval in the next two year period when all the ages are odd. If so replace the ages by this new set.
  • For the primes p≤k see if the p-condition holds
Having made these checks there will be an infinite number of prime conjunctions and we find them by searching.

Of course the big downside of all of this is that we don't know whether Dickson's conjecture is indeed true! A proof of it is not likely to be found any time soon. Notice that the case k=2 and with n and n+2 is the twin primes conjecture: whether there are infinitely many primes differing by 2. The twin primes conjecture is a famous unproven conjecture and widely thought to be true. Clearly Dickson's conjecture is an even tougher nut.

Finally, let's return to the original question: does there exist at least one prime conjunction? One case that may arise is when one of the primes occurring in the conjunction is 2: it's easy to check such cases. So let's consider just odd primes again.  We shall need the condition that odd conjunctions exist just as before. Also, we can rely on Dickson's conjecture if the p-condition holds for all odd primes. So the only cases where we might have a prime conjunction not covered by the analysis above is when the p-condition fails for one or more primes. But such a prime p is necessarily no more than k so there are only a finite number of primes to consider. Here, in any prime conjunction, one of the terms must be divisible by p and so must be p itself. So the prime conjunctions in question must have some prime no more than k and these can be inspected on a case by case basis.

For example, 2, 5, 7 is a prime conjunction which never reoccurs. And 3,5,7 is another because the 3-condition fails.

Friday, 6 October 2017

Our Moral Obligations

This post is about an issue in moral philosophy that I don't understand and its main purpose is to help me wrestle with my confusion. Let me begin with some invented scenarios.

Suppose my adult brother who lives far away robs someone and then disappears. Do I have a moral obligation to make any restitution to the victim for the harm they have sustained? So long as I didn't encourage or aid the crime I imagine the answer is No because I myself took no part in the act of harm. If you disagree I'd like to hear from you via a blog comment!

But here's a second scenario. Suppose my father and his brother (my uncle) were in a quarrel that resulted in my father being able to steal very significant assets from his brother. Maybe this happened years before I was even born and both protagonists are dead. Do I have a moral obligation to my uncle's children (my cousins) to make restitution. This seems like the same as the first scenario. But I think it is actually more complicated if my father was able to pass on to me wealth that resulted indirectly from the fraud against my uncle and my cousins are therefore poorer than they would be otherwise. In that case I am profiting inadvertently from an act in the past and my cousins are suffering. So, should I compensate my cousins for their loss?

Here is an issue on which people might disagree. On the one hand I committed no crime so I should suffer no penalty. On the other hand I profited (albeit inadvertently) from a crime and should make redress. Is there some sort of statute of moral limitations at work here? Would the onus to make redress lapse after a generation? A century? A millenium? It seems clear that for personal moral sins the obligation to make amends should remain until redress has occurred. But what about moral sins that you did not commit but just profited by?

So, to restate now in general terms the dilemma I am wrestling with: if you profit from a crime that you did not commit, possibly long in the past, do you have an obligation to make restitution? I'm aware that the answer might be very much more complicated than a simple Yes or No. Indeed possibly neither of these extreme answers would satisfy most people. If you think you know criteria that might resolve particular instances of the question I'd like to hear from you.

I have a feeling that many people will answer with some sort of qualified Yes, hedged with remarks about circumstances to be taken into account, the practical matter of verifying the facts of the crime if committed long ago, and the moral complexity of being accountable for very many actions beyond ones control. Nevertheless a reluctant "Yes, in general" is how most people will answer the question.

And this brings me to some of the greatest conundrums of our time. How should the countries that used to be colonial powers compensate their former colonies? This applies to some very wealthy countries such as Britain and Spain who stripped their colonies of immense material and cultural wealth. Another question: How should countries that, historically, have repressed groups within their borders compensate these groups? Here an obvious example is the USA's behaviour towards its black citizens.

These are questions so large that we run away from them most of the time because we cannot bear the enormous guilt that honest answers would cause. Do wealthy Englishmen whose estates have been purchased or maintained with the plundered wealth of African countries think too much about the suffering of present day Africans whose ancestors were robbed? Do rich white Americans think about how their wealth has been accumulated by enslaving black people? No, because the guilt would be crushing.

So what do the beneficiaries of their plundering ancestors do instead? They either ignore the moral question or they construct complex narratives that absolve their guilt.

What can we do about this? I accept that facing up to their moral guilt is too much for most people. But we have to begin somewhere. We have to change the narrative of entitlement that the rich countries cling to. We have to talk about these moral questions, make people aware that their present comfortable circumstances have been won by actions taken in the past that cause suffering in the present. This will hardly begin to redress the injustices we ignore every day but recognising how we became so rich and fortunate is surely the first step.

Tuesday, 22 August 2017

From Theories to Narratives

When we face a complex issue that requires an action or a strategy on our part we can sometimes feel overwhelmed by the sheer number of components (facts or opinions or possibilities) that comprise it. We often try to make a start by trying to get all this sometimes conflicting data into some sort of more understandable assembly. But this organisational step may need to be carried out in a way that highlights some of the issues at the expense of others, or even disregards some issues entirely. Our hope is that what emerges will be a more manageable version of the original issue.

This process may be a number of things depending on the context but what I’d like to suggest is that while the name of the process may vary there is a commonality that runs through them all.

At the most technical level we can think of fitting a simple function to best approximate a seemingly unrelated set of data points. Least squares fitting of a straight line or another simple curve would be an example. Here we try to display a trend suggested by the data and it is obvious that some points do not obey the trend yet we shrug our shoulders and trade simplicity for accuracy.

A less technical, but still in the domain of science, is the formulation of theories to explain phenomena in the physical world. Newton’s theory of gravitation is such a theory. Actually, when Newton devised the theory he found an amazing fit of theory to data and it wasn’t until much later that inconsistencies were found. Would we have discarded the Newton theory if we had known of these inconsistencies? Almost certainly not but we might have regarded them as anomalies that could be explained away without discarding the theory. There are many examples from science and we are now used to being somewhat humble and being prepared to use a theory until we have a better one.

These scientific theories of the physical world have been amazingly successful in reducing a multitude of observed facts to a small number of basic principles. We like this very much! Unfortunately, when we go beyond phenomena of the physical world we don’t meet with the same success.

In the social, political and personal spheres there seems to be much greater complexity. No Newtonian theory of, say, Economics. Instead we have theories that hold sway for a while, are then discarded, may reappear slightly modified and then fall away again. These theories do not have the same explaining power as Gravitation but they are not useless. They impose a structural framework on an otherwise inchoate dataset, allowing us to make policy with some uncertainty but not entirely as though we relied on magic. They provide us with a way of looking at the economies of the world without being entirely overwhelmed.

And in the same sort of way social and political theories have some limited explanatory power helping us to govern our large complex societies at an international and national level. Their structure, whether it is real and true or not, enables us to act consistently and we make progress forwards or backwards rather than be stationary (which acting randomly might cause).

In these less precise domains the term “ideology” might perhaps be used instead of “theory”. For in these domains it is easy to lose sight of the fact we often really don’t know what is going on - but we pretend we do, and we elevate the ideology to a status that we call “belief”. Obviously this can be very dangerous and some of the cataclysmic events of human history have come about when an ideology has resisted challenge because its adherents believe in its utility for far longer than the evidence warrants.

Theories, ideologies, and beliefs are not the same but they do have much in common. All of them allow us to have an explanatory picture of a complex issue. We arrive at this picture by discarding many details (some of which perhaps should not be discarded). We adhere to our position by sometimes forgetting that we only have a partial picture. And we are often reluctant to abandon our position because we invest it with greater value than it should have.

There is another domain that almost everyone is familiar with where these ideas apply: the personal world of our interactions with family, friends and acquaintances. Why do people fall out with one another at a personal level? Sometimes an observer will remark that is all over nothing but not being party to the feelings of the protagonists means that they really cannot understand what is going on. Or why do we sometimes have very firm feelings about an issue of child-rearing? Most importantly, why do we find it so hard to relinquish a deeply-held personal position?

The answer to that question has very little to do with evidence and logic. Most often our sincerely held position has been strengthened because we have built narratives in our minds that enable our opinions to be consistent with those cherry-picked issues that support our own ideas. We believe we are right and we can argue our case passionately. The narrative is our “theory” but we do not subject it to the same scrutiny that Newton’s theory of gravitation suffered. On the contrary, we seek out more and more supporting tidbits that validate our narrative.

Obviously there’s a lesson here. We should question our personal narratives with the same zeal that Bishop Berkeley attacked the differential calculus. But that’s hard to do and it’s a habit best learnt young. If we succeed we may find that our own personal relations are less fraught. We will certainly be less opinionated, more compassionate and more pragmatic. To put it another way. we will not be dangerous men and women of principle.

Friday, 21 July 2017

The Righteous Mind

When I retired a few years ago I began to take a lot more interest in global politics and global society. By the time that 2016 rolled around I considered myself to be very well-informed about the Western World in particular and I took pleasure in discussions with my friends about what I had read. My occasional posts on this blog reflected my new knowledge and, for a short time, I felt I was verging on elder statesman wisdom.

2016 punctured my hubris. The Brexit vote and the Trump presidential victory showed me how little I really understood despite my extensive reading. It was obvious that I hadn't understood very much at all and it was only small comfort that many others had fallen into the same traps that had snared me.

Where had I gone wrong? Why had the UK and US electorates made such different choices to the ones that my careful analysis had predicted?

I was aware that I tended to read left-wing political and economical analyses but I felt these were giving me an accurate factual appraisal of what was best for these two electorates. In any case it was clear that many people with access to the same facts had come to different conclusions and I wanted to understand how this could happen. I had been a member of various Skeptic movements over the years and was aware of how pernicious motivated reasoning could be and I thought I was aware of the many fallacies that could skew reasoning into incorrect conclusions. But that didn't really explain to me how intelligent people with access to the same facts could disagree so profoundly.

Over the last month I have read one of the most illuminating books of my life. The Righteous Mind by Jonathan Haidt has helped me to understand how this diversity of opinions arises. Haidt is social psychologist who works on the interaction between conscious reasoning, intuition and emotions. He gathers data by presenting subjects with questions that tease out where their moral reactions are the strongest and his book is partly the conclusions about he has arrived at by analysing a large body of such data.

The first part of the book traces the large body of evidence whose conclusion he summarises in the single phrase "Intuitions come first, strategic reasoning second". This is far removed from what I had supposed: that, when faced with a moral or social question, people deploy reason to arrive at an answer. Far from it. Haidt convincingly explains that reason is used to justify ones immediate intuitive response.

The second part of the book seems to be targeted at people from WEIRD cultures. The acronym stands for Western, educated, industrialized, rich, democratic. That is my own culture. Indeed, as Haidt admits, it is the culture that provides the easiest access to subjects for psychological study (graduate students in American universities). Haidt maintains that early studies accidentally reflected a culture that is much rarer in other parts of the world and therefore that these studies came to unsound conclusions.

WEIRD people tend to reach moral judgements based on fairness and the avoidance of harm. Haidt however has discovered (through very many interviews and questionnaires) that these two Moral Foundations (Care v. Harm and Fairness v. Cheating) are just two out of six Moral Foundations. The other 4 are Loyalty v. Betrayal, Authority v. subversion, Sanctity v. Degradation, and Liberty v. Oppression. On the basis of his fieldwork Haidt believes that non-WEIRD cultures find the latter 4 foundations more natural moral compasses than WEIRD cultures.  He also thinks that, in the US political context, Republicans respond to all 6 Foundations whereas Democrats focus much more on the first two. This, he believes, give Republicans a natural advantage in political wrangling since they have more ways that they can be won round to a point of view.

If you are curious which Moral Foundations you yourself respond to you can take some of the psychological tests to be found at

The third part of the book is about the human tendency to coalesce into groups and, within groups, to feel more secure and more loyal. He talks about this in the context of an evolutionary idea of group selection that postulates that, through time, groups evolve because of selective pressures that make some groups more likely to survive than others. Now group selection is currently not thought (by biologists and anthopologists) to be an important influence on how our species has evolved. However, Haidt is not put off by this orthodoxy and presents arguments for its rehabilitation at least in certain cases. Whether or not he is right to elevate the idea of group selection I will leave it to the reader to judge; but he certainly makes an interesting case and presents some historical evidence to defend his thesis.

He also identifies what he calls "hive behaviour" which a sort of super groupishness that can fall on a society that finds itself under extraordinary stresses. One of his slogans is that human beings are 90% chimp and 10% bee. An example of hivish behaviour is the remarkable solidarity that can descend upon a group of military men who first interminably train on parade grounds and then go off to fight as a tightly coordinated force. Such men describe their feeling that the sacrifices they make are not for King and Country (or any ideology) but for their fellow soldier comrades. Again, whether you accept that human beings have a "hive switch" is perhaps not conclusively demonstrated but it is certainly a compelling hypothesis.

The writing style is laudably lucid. He discusses a large number of complex ideas with great skill and clarity. At the end of a major section he will summarise the main points he has developed so that you are in no doubt what they are.

So, how successful was this book in helping me understand why I come to different conclusions than some other people? On moral questions I certainly have more sympathy for other opinions. I find myself applying what I have read in the book when I listen to arguments from my own quarter or an opposing quarter. And I am now more likely to seek out other points of view than those that fill my own WEIRD culture. For me this book was a tremendous success.

Monday, 10 April 2017

Lurching to war

A few days ago there was wide agreement that President Trump was dangerously unhinged, incompetent in the manner he has led the USA so far, an inveterate liar, a racist, a misogynist, a man with no empathy for people suffering. And the evidence for these beliefs was abundant.

Now he has seen some footage of children who were killed in a sickening gas attack apparently by forces loyal to Assad of Syria and has bombed the airfield from which the attack was launched. And we should applaud?

Really? The man whose policy has been to ban refugees from war-torn countries has suddenly become a man of statesman-like vision?

This most recent lurch, satisfying though it might be to deliver a rap on the Assad knuckles, means nothing. We know there is no plan. We know that Trump has the attention span of a 5 year old. We also know that rushing to military solutions, for all their short-term attraction, is a resort either never to be embarked on or, at least, only with the most meticulous long term planning. This President is simply incapable of such considered policy.

Now we have a man who should not be trusted with a water pistol beginning to muster the might of the US military. It will be chaotic, disastrous, and impossible to disengage from.

And the majority of the American media are cheering him on. What the fuck?

Friday, 24 June 2016

A post-Brexit world

The vote by the British to leave the European Union was remarkable on many levels. It was unexpected in the sense that an overwhelming majority of financial experts believed Britain was better in the EU than outside it. The rejection of their opinion speaks volumes for the disenchantment of voters with economics. In many ways this is understandable because the majority of Britons have seen little improvement (and often a decline) in their economic circumstances for many years - and the feeling must be "stuff the experts".

I certainly have some sympathy with this reaction. For many years the rich have become richer while the incomes of working and middle class voters have at best stagnated. There is a perception (in my view justifiable) that this is the direct result of fiscal policies promoted by the Conservative government (and a very weak opposition during this time).

However when the quality of their lives deteriorates the people become vulnerable to pernicious manipulation and I have certainly no sympathy whatsoever with the way that the immigrant issue has been presented by the Brexit campaigners. A particularly egregious example was the UKIP poster of migrants crossing the Slovenia-Croatia border that was nakedly racist. The immigration issue became the emotive central issue of the referendum and I am very sad that many Britons were sucked in to believing that their troubles could be alleviated by putting up immigration barriers.

A second respect in which the referendum result was remarkable was the different ways in which the four countries of the UK voted. The majority of English and Welsh votes were cast for Brexit but in Scotland and Northern Ireland the picture was very different. In Scotland the vote was 62% against Brexit. This raises once again the prospect of Scotland's destiny being held hostage to the opinions of their English neighbour and I am certain that there will now be strong calls for another referendum on Scottish independence.

Yet another remarkable consequence of the vote was the sudden way in which David Cameron's premiership ended. After 6 confident years he was one of the longest serving Conservative leaders of recent times and now he has gone. Despite some calls to the contrary it was his only honourable course of action - and how unappealing would it be for him to spearhead the details of the British withdrawal?  The bookies are predicting that he will be succeeded by Boris Johnson, another Etonian, a man without any semblance of a moral compass (see this evisceration) and one of the leading campaigners of the Brexit movement.

All in all it is easy to conclude that there is disaster in all directions. But there may be light at the end of the tunnel. The UK certainly is in a poor place at present but it is at least crystal clear that the policies of the Tory government have utterly failed and, in the short to medium term, things will only get worse. So in time a new government will come to power possibly after a short period of Johnson at the helm. I think that Jeremy Corbyn will also not last very long - his heart is in the right place but he has completely failed to inspire his party or the country. The people have rejected the status quo and the policies of the establishment and I do not expect it to regain its grip on the political landscape. An inspirational leader will be able to work from a clean slate and possibly lead us to a fairer society.

I shall end with a question that is almost certainly to arise. The dire economic situation the UK will soon find itself in is going to make public opinion very volatile indeed. What is going to happen if, during the protracted process in leaving the EU, the pendulum of opinion swings back towards Europe? This seems a fairly likely scenario when it becomes clear that any trade agreement reached with the EU is necessarily going to be conditional on an agreement to have (like Norway) open borders. I think it is going to be hard to carry through to the end an exit from the EU if the UK people become more aware of what they will be losing. And, surely, before the door shuts it will be necessary to consult the people once again if they are happy with whatever trade agreements have been agreed to replace full EU membership.

Tuesday, 26 April 2016

Cultural influences

This post was prompted by the excellent BBC Drama "The Last Kingdom" which is a fictionalised account of the struggle between Alfred (The Great) and Danish invaders of England in the late 9th Century. The TV series is based on the books of Bernard Cornwell who, apart from many historical novels, has also written some non-fiction history books. So far as I can tell he makes a careful effort to portray the times he writes about -- in which case England in the late 800's AD was a violent age where life was cheap, the people used to brutality, and everyone lived in the hope of eternal life and the fear of damnation.

Of course some parts of the world could also be described in those terms but England and much of the Western World is a very different place. As someone who grew up in England I began to speculate how my life would be if I had instead lived there 1100 years earlier. In some ways I would not have been very different since human biology has hardly changed in that time span; so, presumably, my cognitive power would be much the same and my physical strength would have been about the same (until accident or disease brought me to an earlier end). But in almost every other way my life would have been completely different.

Now that may seem so obvious as to be hardly worth saying but I state it anyway because I think I am prone (and perhaps others too are prone) to an arrogance that needs to be reined in from time to time. In this arrogance I survey the world believing myself to be a thoughtful person, well read, capable of reaching conclusions stemming from an unbiased interpretation of what I assiduously try to find out about the world. I have opinions that I can defend and a naturalistic world-view which hangs together in a coherent framework. In other words, even though I am a card-carrying Skeptic, I believe that I have a good handle on what is real, what is important, and what can be dismissed as nonsense.  Most of all I think of this unified personal experience of the world as being of my own construction.

So, for example, I have a certain view about freedom of speech. I'm extremely liberal to the point that I would not ban anti-semitic opinions no matter how poisonous. And I hold these views because I have carefully considered as many implications of them as I can. To me they seem robust and defensible and they stem from some intrinsic part of me. My freedom of speech views are also coherent with many other views I hold - enlightened, informed and intelligent views.

But now comes the point. If I had been born, physically and mentally the same as I was born in 1946, but 1100 years previously I would certainly not  have grown up to be anything like the person I am today. Even if Dark Ages me had been educated as well as those times would allow, my intellect would more likely be engaged in the subtler aspects of Christian theology. I would accept without question that men should have greater societal privilege and power than women. If I ever thought about it all I would most likely share the then prevailing condemnatory views of homosexuals. And in many other ways I would have a totally different outlook on the world than 21st Century me. But one thing might not be different: I would still have an underlying certainty that my views were coherent, defensible and right.

I find this thought experiment somewhat alarming. It indicates that so many opinions that I thought were really my own are actually the product of the times and society in which I live. Should I conclude that these opinions are completely untrustworthy because, rather than having been reasoned through by me, they are as ephemeral as the current times and society?

Luckily I think that the answer to that pessimistic question is "No" (but I had better be much more humble about where my opinions come from). The first thing to say is that the times one lives in do not completely determine ones set of opinions; one only has to look around to see a great variety of different world views in the same society. Therefore if one has been careful and honest in working through all the facts available one may perhaps be in possession of a set of views that are pretty good compared to other world views around. Maybe that has happened in my case; I hope so but cannot be certain.

The second thing to say is that, despite many setbacks along the way, cultures do tend to evolve in the direction of most of the things I value: liberalism, secularism, skepticism, and scientific understandings. So even though there is no God to tell us that those values are absolute values, we might hope that humanity is selecting them in Darwinian fashion as conducive to the flourishing of our species.