Saturday 21 December 2019

Are there only two sexes?

A controversy among people these days is whether or not there are two sexes. The existence of transgender people and non-binary people indicate that there are more than two sexes while other more conservative communities claim there are only two. What's the real story?

There are only two sexes, change my mind:

Sure I'll take a crack at it. Lets first take the definition of what a biological sex is:

The biologic character or quality that distinguishes male and female from one another as expressed by analysis of the person's gonadal, morphologic (internal and external), chromosomal, and hormonal characteristics. -Farlex Partner Medical Dictionary

Interesting, lets analyse this definition. First of all on the surface it seems like this definition confirms only two sexes, after all it simply says that sex is the characteristics that distinguish between male and female, it says nothing about a third sex to potentially distinguish with. However when we look closer at the definition we actually notice it is quite vague. Sure it asks us to distinguish between only two sexes but the methods it asks us to distinguish with are many. It's gonadal, morphological, chromosomal and hormonal, why does it ask us to consider so many different features to determine something's sex? Surely if our biology lessons in high school should be believed we only need chromosomes to determine sex or perhaps you believe if they have a penis they must be male. Well, lets see what happens when we consider each metric individually to determine if there are only two sexes or not.

Gonadal Sex: This is the simplest definition of sex. If it has a penis then it must be a male and if it has a vagina than it must be a female so its very simple and easy right? This seems to say that there are only two sexes. Of course, however, we have to consider intersex people including people who are born with both a penis and a vagina. Now is someone who has both genitals a male or a female? Well if we only take gonads into account we actually cannot answer this question so this would have to be some other kind of third sex. The situation gets worse when you consider that even intersex people have variation, for example someone may have an external penis but internal ovaries that are generally not visible, in this case we might determine this person a male but they also have female gonads. The idea of using what gametes someone produces doesn't help us here either because a lot of intersex people are infertile and don't produce gametes, with both gonads and no gametes we cannot determine the individuals sex as male or female, this metric fails for only two sexes.

Morphological Sex: This is the external and internal characteristics of a sex so it's similar in definition to the gonadal sex but has extra components such as generally sexually exclusive features like facial hair and breasts. Even with this extra criteria we still have androgyny which are people who either have no sexually exclusive characteristics or have several different sexually exclusive characteristics in any combination. This is essentially someone who, at a first glance, is difficult to tell between male or female. It can even be difficult to tell in a medical examination room. The situation is further against using morphological sex because many intersex people are also androgynous. So even morphological sex does not sufficiently show there are only two sexes.

Chromosomal Sex: Ah, but we have chromosomes, the real indicator of sex. As we all learned the main thing that determines sex is whether you have an XX chromosome (female) or an XY chromosome (male) and so the case is solved. But of course we have to include all the other combinations such as XXYXYYXXXX, and many others. Clearly just using those definitions indicates more than one sex so again chromosomal sex must not be sufficient to show that there are only two sexes.

Hormonal Sex: Finally we know there is estrogen and progestrogen which are female hormones and testosterone which are male so we can use levels to determine sex and distinguish between only two sexes. But this also doesn't work because these hormone levels are on a spectrum so it is very difficult to cut a line and simply say anything over this line is one sex and under the line is another sex. It's even worse because there are some (traditionally called) females that can have as high testosterone as males and so this too seems like a poor choice.

So have we done it? Have we proved there's more than two sexes?

I'm not convinced...

Because you know better right? You know that if someone has an XYY chromosome we can still call them male because they have a penis! And someone who may look kinda female we can still determine they're male because they have an XY chromosome. So clearly there must only be two sexes right? But wait, what are we actually doing here?

In the examples I gave all I did was pick a metric and showed some ambiguity and the response to determine the persons sex was to pick a DIFFERENT metric to resolve this ambiguity. If the chromosomal metric doesn't work (XYY) we then can switch to the gonadal metric (penis) to determine their "true" sex. What metric we pick doesn't matter as the definition after all asks us to consider everything all at once to determine sex so we just keep picking different metrics until something works.

But wait, isn't this actually a failure of classification? What if two metrics disagree about whether someone should be male and female, a classic example would be XX male syndrome which is someone who has XX chromosomes (and thus the their chromosomal sex is female) but has a penis and general male characteristics (their morphological sex is male). In this case we get a bit stuck because we are used to removing ambiguous metrics but in this case no metric is ambiguous, these metrics conflict. In the case of XX male syndrome we can't conclusively characterise someone as a male or a female and this really indicates that classifying everyone into two sexes doesn't work for everyone. It's not a complete category and there are variations and so are we done here.

No, there are still two sexes and then there are "abnormalities"

Ok sure. Now I could go into the fact these abnormalities account for about 2% of the population (same number as red heads) and thus are too big to be called simple exceptions but I'm not actually gonna go down that path. I'm gonna say that you can remove any set of outliers to classify your data into convenient categories and that is fine most of the time. The question we have to ask now is whether removing these outliers damages the quality of our data, does removing intersex people from the equation make our life easier?

And that is the final crux of the issue. It's why people call others transphobic for asserting that there are only two sexes. It's because at the end of the day this isn't an issue about biology but it's an issue about classification and about what should be considered important and what should be considered simply an outlier. By claiming that all intersex people are simply abnormalities and removing them from our set we are overtly and bluntly stating that these outliers don't matter. That they SHOULD be ignored in our society, that they're unimportant and should be stricken from the record.

You have to decide whether intersex people deserve to be included within society, whether they deserve to be included within our classification and within our rules. This isn't a scientific proposition it is simply a moral one and if you choose to actively exclude intersex people from the very definition of sex, then I'm sorry, you are bigoted towards those people because you made that moral judgement.

At the end of the day...

It actually doesn't matter. The conversation of there only being two sexes is simply a way to invalidate transgender people. And it's true some transgender people probably fit in ALL metrics of being a different sex. We don't understand what makes someone transgender in the same way we don't understand what makes someone homosexual, they just are. We have two roads where we can accept that there exists different genders and that people can change their genders or we don't. When we don't we cause great pain to some people of the population, we allow people to murder them and we murder them indirectly through their suicide rates. At the end of the day I don't think it matters if they really are a different sex or not. I want to increase the overall happiness of society and it seems that acknowledging trans people does this, so I will do this. I hope you will to.

Wednesday 27 November 2019

I fear death.

I think we all do in one sense or another and we come up with many ways to resolve our anxieties, be it making stories in religion or believing anti-ageing drugs, stem cells or science will cure us one day. We all know that these stories are just that... stories. In the realm of possibility but not certainty even if you believe you are certain. It is these stories that we cling to.

But I fear death.

And I shouldn't, I am an atheist so I don't believe in an afterlife but what I believe comes after death is something that everyone has at one stage experienced, the feeling of non-existence, the feeling before birth. It's paradoxical to call it a feeling seeing as it is actually the absence of feeling altogether but death under my belief is simply the end. A state in which you don't know you are dead or were alive, a state where you don't know anything and where the concept of you doesn't even exist. The information stored in your brain has gone the way of the second law of thermodynamics which is to say eroded by the ever increasing entropy within the universe. Like a computer chip that has been burned in a fire the software on that chip no longer exists, it is not hidden away into some meta-dimension and it is not recoverable it is simply gone, what does a program experience as it is melted away?

But I fear death.

It's the certainty of it all, the absolute certainty of it all that one day I am going to die. With such little certainty in this universe and with so many questions with unfulfilling answers why does this question have to be the only one I am certain of? Why in a world where knowledge cannot absolutely exist do I know without a shadow of a doubt that I will die, that it will be soon and not necessarily soon like in the next week or year but in a cosmological sense I will exist for but a blink of the universe. My life and experiences hidden away by an infinite cosmos never to be heard from or spoken of, I might as well have never lived at all.

But I still fear death.

Because my importance is not measured on some rock in some part of space a million light years away, no my importance is known by the only meaningful metric in this universe, others. I am tangled in a web of other people's lives and perceptions that I exist as simply a side character in thousands and thousands of different stories of varying importance. My impact measured by my impact in those people's lives and the ripple in space and time that I have on them. No matter how small given enough time I will change the very nature of their universe but perhaps they will never know and most definitely I will never know, for I will die.

And I will still fear death.

Because the only one I am a true protagonist too, the only reference frame I exist as is in my own world, my own perception. When I die I lose my protagonist status, I lose the only part that makes me truly important. Sure people will say that I am important to them, my family, my loved ones and my friends but in truth I am still their side character, I am still a player in their stage but in my world I am the stage and the single most important thing in this universe. When I die I lose that, but why do I care? Who cares how important you are in your own reference frame when that reference frame no longer exists.

So why do I fear death?

The feeling is unreachable to be dead, it is unknowable even when we have experienced such a feeling before. Before birth, after death, what is it that I felt? It didn't matter what the nature of non-existence was because at the end of it all I suddenly existed and I was whole. But now once I die there will be no moment of existence and there will be no end. All I can interpret from my billions of years of non-existence that I have experienced before is my reflection on it once I existed but I will not have a chance to reflect once I die. That scares me. I can't comprehend it and the certainty of it. That scares me.

So I fear death.

My millions of stories and ideas, my words, my pictures, MY PASSION. It will be lost as well as anything and everything important to me and when all this happens I won't even care. So I fear death. Why were we born to such a cruel universe.

Tuesday 29 October 2019

Internet Lag Concepts

  Lag, we hate it, it is the bane of every video gamer and it causes some really unusual effects. For example during a game of Halo 3 I was riding with my friend on a warthog and the turret, usually connected to the warthog, simply slipped off with me still on it, rolling around the map (followed by a disconnect). Another noticeable example is playing Call of Duty: World at War on a low bandwidth dongle with high latency only to find an enemy running without any legs followed by a crash that simply stated "Error: Model burly_soldier_02 doesn't have enough bones".

  The point is lag causes some weird effects and I was curious why these effects occur and it turns out these are caused by certain counter measures games use to try and hide lag and it was really interesting because it explained all these effects. And so I thought I'd explain how these effects come about (partly to test my own understanding) and propose some different ideas for lag compensation (however these are just crazy ideas). So lets discuss.

  Extrapolation: One of the most common symptoms of lag is randomly teleporting enemies or objects, you see someone walk into a wall for about a second and then suddenly teleport to somewhere else. The reason this can happens is due to a lag counter measure called extrapolation and it's when your computer attempts to predict what the world is doing in the absence of any information. When the computer is waiting for a packet it realises it still has to render the next frame so it will just guess what the next frame should be. It will continue guessing until the packet finally arrives, in which case it will update to the new location.

  The predictions aren't usually that good and are very basic, for example if an enemy is moving in one direction the computer will usually guess that it will move in the same direction even if there are objects in its way. I wonder if lag would become a lot less noticeable if we used better predictive algorithms to judge what a human would reasonable do in a given situation, maybe render a game AI in place of a human. Sure, we would still expect there to be error because humans are fundamentally unpredictable, but maybe we could at least reduce the error.

  Interpolation: This is a little bit more complicated. First we need to introduce the concept of a time-step, when a server talks to a player the server is not always sending information to the player and the player isn't always sending information to the server, if we had to wait for the world to update from the server every time we clicked a button lag would become an even larger issue. Instead, the server and player sends data once every "time-step", which is usually once every 10-100 ms, in this the server tells the player what the world looks like at "time-step 2 (T=2)" and the player sends to the server everything it did since "time-step 1 (T=1)". But what do we do we do in between these time steps?

  We do something called interpolation, interpolation in the usual form basically means given an object at two different points at two different times, create a path for that object so it has a smooth transition between those two points. An example would be suppose a player is at a box at T=1 and then is at a wall at T=2 then instead of showing the player teleport between the box and the wall, we interpolate the players position so that it appears he moves smoothly between the box and the wall. It turns out, if you're willing to make a few assumptions, you can calculate an entire path of an object just with a few points.

  So what does interpolation mean in the server sense? Well because the player only receives updates from the server once every time step it can still render what happens in between each time step by interpolating the data. If at T = 1 an enemy is seen at position 1, and then at T = 2 the enemy is at position 2, we can interpolate those two points to make the enemy look like its walking between position 1 and 2 between T=1 and T=2. But wait, there's a huge problem with this, in order to interpolate between T=1 and T=2 we need the data for T=1 and T=2. If we're at T=1.5 we still don't have the data for T=2 so how can we interpolate where the enemy is? If we guess that's just extrapolation once again, so what can we do?

  The solution is rather genius, what if we render everything a time step behind. So if you see an enemy doing something at T=2, you will actually be at T=3, so you (the player) are always one time step ahead of the server. If the time steps are relatively close together then usually you won't notice the fact that the game you're seeing is actually in the past. Most games use interpolation so it means what you see your enemies do on the server is actually what the enemy has already done in the past, not necessarily at the moment you were playing. It's cool!

  Interpolation is nice but it does give a resolution of lag, lag will be mostly unnoticeable if it is smaller than the distance between two time-steps (and the distance is appropriately chosen). If it becomes larger than the time-step will update an enemies location further back in time than you expect, you will see enemies moving faster than they should be moving as the game frantically attempts to update the game state to a more appropriate level. I expect for a very high lag the game will eventually begin resorting to extrapolation or at least have extrapolation-like effects.

  More time travel: Here is a scenario, you have a server and two players (Player A and Player B), Player A is trying to shoot Player B before Player B runs behind cover. At T=0, Player A shoots at Player B and hits Player B's head, killing him, before he can get into cover. Player A however has a laggy connection and Player A can't tell the server that it shot and killed Player B until T=10. Player B on the other hand has a better connection and tells the server it got behind the box at T=1 and thus did not get shot. What is the server to do?

  Well, from T=1 to T=9 the server only got messages from Player B saying it was behind the box and did not get a message from Player A that it shot at Player B. So the server declares Player B is safe because, in its eyes, no one shot at him. However at T=10 Player A now indicates it shot at Player B, and the server now has to make a decision. One thing it could do is to just find the location that Player A shot at, if Player A shot at a position that Player B is at now, then Player B will die, otherwise Player B is safe. This is unfair on Player A because it took 10 time steps for the bullet to hit its target (on the server side), so despite Player A shooting Player B on his end, Player B will be safe because the server will only see the bullet hit where Player B used to be, not where he is now.

  But the server can (and in modern games often does) use a different approach. Even though we only got the packet at T=10, information in the packet can tell us that Player A actually shot the bullet at T=0, so the server can rewind time and see what the game state was like at T=0. It can then see where the player shot at and see that, indeed, at T=0 Player B was actually in the way of incoming fire. So the server, after looking backwards in time, can declare that Player A actually did shoot Player B and can then declare Player B... dead. This seems more fair because if there was NO lag at all, Player B would have been shot and killed by Player A, so even with lag the same thing happens. The only problem is (and you would have noticed this in game), in player B's perspective they escaped Player A's shooting, hid behind cover for 9 time steps and then suddenly died. That's right, if you've died behind cover before this is what's happening, they are not shooting you through cover or hitting a hit box that's behind you, the server is going back in time and seeing if the player ACTUALLY shot you.

  The situation gets more complicated when both Player A and Player B have lag, also the server can only go back in time so much before it becomes too computationally expensive to do. But its still an interesting and rather effective technique for having more fair games, even if it does frustrate people from time to time.

  The best/worst option: One thing that all these lag compensation techniques have in common is the idea that the server makes decisions on the game state. Players have to tell the server everything they've done and the server decides what the players are actually doing in the game world, then tells the players the effects of their actions. This means lag is very important because the player can't really now what's happening in the game without input from the server. So what if instead of the server telling the player what the game world is like.... the player tells the server what the game world is like.

  You're running around and you see an enemy, you shoot the enemy and it appears the enemy dies. Normally you'd tell the server where you shot, the enemy would tell the server where he was and the server decides whether you actually shot the enemy. But you CLEARLY shot the enemy, so what if you just told the server "I shot this enemy, trust me". Well now, guess what, you have made lag a lot less important because what happens on your screen is what happens in the game. You don't have to wait for everyone to connect, you play your game and events happen as you see them, if someone is lagging and you shoot and kill them then you can still kill them even though they're being laggy. Sometimes the server will need to step in when clients have conflicting ideas on what actually happened in the game, but in general this makes lag a LOT less noticeable. So what's the problem?

  Well I think you should be able to see it, you are now telling the server what happens in the game. Well, you also have full control of the game so what if you just told the server "Oh yeah I just killed everyone", the server would be forced to trust you and so BOOM, everyone would die. The problem is the server can't know which request is real and which is fake so it means you can just goof any command you want (which is trivially easy) and the server has to trust you. This isn't good which is why almost no games running today use this method even though it offers the least intrusive lag.

  Maybe though we can combine the approaches of an authoritative server to detect a malicious client. Basically we have the client send information to the server, the server renders the game state based on the client information and starts re-enacting the events that happened. It might then be able to verify whether some events shouldn't be possible (like killing every person in the game instantly) and be able to flag that as invalid behaviour, ignoring the data the client sends. This has already been investigated with some proposed ideas on how this would work: https://www.cs.unc.edu/~reiter/papers/2011/TISSEC3.pdf

  In terms of lag reduction though I suppose we still have problems. The server has to authorise a players actions, but if the server authorises every player action then it becomes just a normal authoritative server, where the client has to wait for the servers authorisation before updating its own game world. A potential solution for this is to back-peddle authorisation, so if the player does an action it can just assume the action is authorised by the server, then if the server rejects the action the it sends that information to the player after the fact and the player updates its game state as if the action never happened. This would be jarring (Cause in your screen everyone would die then suddenly, some time later, everyone would be alive again) but it would only effect players that are doing something the server deemed cheating (as the other players never received the "you're dead signal").


  Either way lag is really interesting, and maybe some of these things explained why you get some weird effects with lag. Hope you found this an interesting read!