my nice new brother WP1 word processor. I could connect the Raspberry Pi up to the UART. I am actually going to take the time to write a whole new terminal emulator. So I think that is actually ready to test. So I'm gonna stop on a cliffhanger and get on to the testing next time. Okay, moment of truth time. Let's try it and see if it works. Now I am also trying a new technique for recording the video from the brother device. This is using a webcam, which does at least have manual focus. The picture quality is still not brilliant. And as I mentioned before, a lot of that is the fault of this cable, which is screwing up the video somewhat. I should really have used a more shielded one. Anyway, let's try this and see what happens. And the answer is nothing, which means my boot loader is broken. The Z180 MMU is an absolute pain to configure. Okay. Well, better. Okay, so I'm apparently clearing the screen to the wrong value, which is zero rather than the space. And I am not configuring the attribute memory, which is why some of it's shown up in reverse. And while it's printed, the boot message, it hasn't actually, you know, started booting. So after not overwriting the current program, let's try this. Well, we're clearing the screen. It's not loading anything off disk. That's probably because, because, because the memory map it currently in use is not the same as the original boot sector and the temporary buffer used to load stuff off disks is in the wrong place. Okay, let's try this one. Interesting. It's not really what I expected, but at least you can see on the screen here. I actually am not sure it's coming out. I didn't set this thing up to record inverse video, but I am at least getting superscript. Yeah, I think this is wrong. Fun though. So boot it and nothing happens. We are at least clearing the screen, which is nice. Well, I managed to fix the bugs in the bootloader, mainly by throwing it away and starting again with the CPM-ish bootloader. And as a result, our application runs sort of. So that's interesting. The snow is clearly due to video memory refresh. So I think the application's actually running and is completely failing to update the screen properly. I'm not quite sure where the changing characters are, which you see if just stopped. So I suspect that some workspace is in video memory somehow. That means register corruption. The fact that it hasn't removed the boot go message, which is produced by the bootloader, I'll fire it up again, is interesting because that means we failed to clear the screen. So I think the first place to look is the screen refresh code. Here's the routine to clear the screen. And I do notice this. CPA comma D is a regrettable typo, which is going to compare A against D. The A is implicit because in CPA the A is implicit because you can only compare A with things. So this is going to be comparing whatever happens to be an A, which is whatever garbage this has left behind with what's in D. This should be an LD. So I think that this has been, this is spinning forever, writing to the screen. Now where those garbage values were coming from? Well, if you pass in a line number out of range then the display code is going to look that up against back buffer address table. So now actually that doesn't make any sense because it will be clearing random bits of garbage. It'll be reading the address of a non-existent line and then trying to clear it. Where's our clear routine here? Also it's trying to write zeros, the character zero to the screen rather than a literal constant zero. That's not going to work. Okay, well those are at least two bugs. So let's give this a try and it boots. And that's interesting, we get exactly the same thing. So I wonder the garbage on the screen not the snow but the strange characters. This is clearly counting down. You see it just stops there and the snow changes. I wonder if we've never actually got to the display flush code at all. And in fact it's hung somewhere else or rather it's clearly not hung because the snow indicates it's writing to the video memory. So if it's spinning doing something really stupid and not reach the flush code, then that explains why the screen hasn't cleared because the first thing the program does is try to clear the screen. Maybe it's the clear screen code that's gone wrong. It is after all, it does look like it's counting. So we've got something going on here, some garbage and then this looks like two bytes counting down and there's a flashing quotation mark just to the right of it. Yes, the easiest way to debug this kind of thing is to simply insert calls to jump to yourself that is infinite loop throughout the startup code. It becomes very easy to tell how far things have gotten. Well, the problem actually turns out to be really straightforward. So in our flush code we are copying from the back buffer to the video RAM starting a video RAM base. However, the video RAM actually consists of two 4K chunks, one for the attributes and one for the character data. What I didn't cover in the previous video is changing everything to update the character RAM rather than the video RAM and it looks like I forgot to change this. So we just need to do that and hopefully it should now be writing to the right place. So let's write this back. Something should have changed. So after inserting one of these right at the very beginning of our program we still get garbage. This means that none of the program is actually running. So this suggests it's a bootloader issue. Well, we can see the go message and then what we do is we do some memory fiddling and jump to the beginning of the program. So there shouldn't really be anything out of the ordinary there. I do need to check to make sure that all the places where the program starts, which are coded in, agree. So there's one here and there's also the one in the make file, which is here. This tells the linker where things go and then there's this LD80 in this mode returns a 64K memory image. And so we need to remove the bit we're not using. Well, that does actually seem to be the right value. So what could be happening? Well, the first thing to do is to make sure everything is assembling to the code we think it is. So let's do that. That causes listings to be produced by when compiling SIM files, which is a command images. The same as a com file as far as LD80 is concerned. And that gives us a listing for the bootloader. So this shows the op codes that the assembler is actually generating. So there are we. Here is the go code. So here are the five instructions to rework the, to reconfigure the video, but to reconfigure the memory manager. Yeah, I'll just talk about the memory manager a bit. So there's this big long comment up here that describes it, but basically the Z180 memory manager gives you three banks of memory. The first one is called base and always starts at logical address zero and is always mapped to physical address zero. The second one is called bank and you can change both the mapping and the division point. And the third one is called common. And again, you can change the mapping and the division point. So they always have to appear in this order. Common is always above bank, which is always above base. And we need base to be that's wrong. Base always points at the brother OS kernel. It allows us to do system calls. Bank is the code the application actually lives in and it is always mapped to this physical address and this logical address. Common starts at EOOO and it either points at the video memory which lives at the dis-address range in physical RAM or the disc buffers which we use when loading the program which are dis-addressed in physical RAM. So when we load the program we actually have to keep switching between having the disc buffers available so that we can call the system call to read sectors and having the video RAM available so that we can write stuff to the screen. Well, once the program is loaded we no longer need the disc buffers. So we switch permanently into video RAM mode before calling the application start point. Now, are we loading the program to the wrong place? Because the configuration we've got here is actually slightly different from the one that CPM uses. The way the load works is we read sectors we always put them into a temporary buffer. This is why we need a disc buffers block. We then use the DMA engine to copy out of the temporary buffer and into user RAM. We use the DMA engine both because it's fast and because the DMA engine always works with physical memory which makes life easier when loading CPM-ish. However, copying 12 sectors is not exactly time-intensive and for our particular use case we always have the target memory mapped. So I think we should actually be able to get rid of this. We can replace this with a simple LDIR which would simplify things. So I'm finally beginning to remember which way round LDIR goes. So HL is the source address and this is always the disc buffer. LD is the destination address and we keep the destination page here in D. So E is always correct. We just have to, D is always correct. We just have to put a zero into the bottom byte. BC is always 100 because it's one sector. Okay, it's possible that this configuration is wrong, you see. So advance the next sector, next address, reduce the sector count by one and loop. Yes, let's leave that. And then we turn the motor off and go. So that is now a simpler bootstrap code which is here. I see reasonable looking values. So we'll try that and see if there makes any difference. Boot, no, no it doesn't. Well, this isn't helping. This is setting the stack pointer for our program. Putting it here means that we're using the system stack in the common workspace with the disc buffer. And of course, every time you switch to the video memory, the stack becomes inaccessible. So if we leave it in video memory mode, then the stack goes into video memory. So possibly that is what's writing to the screen. Now the obvious thing is to just move the stack somewhere else but we can't make system calls unless the stack is here. But of course, there's no reason why we can't simply switch for different stack down here. So let's try this. So that means our program lives at app start and goes up and our stack starts app start and goes down. That will, program goes here. So that means the stack starts at the high part of, actually let's put that somewhere else. Because of course, we don't know how much of that memory block is being used. Let's put that here. So the program goes from 7000 up. We know this is ordinary RAM. So that should be fine at this point. The odd thing is I still don't know where all the noise is coming from. So I think that I am going to just try and write out what byte is at app start before we do anything else. This will mean copying the hex print code which I got rid of but we can steal a copy from CPM-ish. That's, now hang on. We can see it's in our common utils print.lib. This, so let's just copy this, stick that here. And this wants to be put byte. So we're just gonna do load whatever's app start into A and print it. Okay, just check to make sure that our boot loader is not too big. This is our program. Here is our boot loader. And we're close. We have about 23 bytes remaining but that will fit. So what I would expect to get a zero, zero because that is the first byte of the program. That's, hang on, that's not right. Zero, zero, that is a knob. I never told it to put a knob there. That's our JR. His value was wrong. Off by one. That's better. Well, that won't help but it shouldn't have caused that mess. So where is the noise coming from? Well, normally the memory that lives at, lives in this block is the kernel workspace. It's the brother operating system but we've just swapped it out in favor of the video memory. This is safe because we've turned interrupts off. So I wonder whether one of these system calls we're making has turned interrupts back on. Now the difference between this and CPM-ish is this routine here that's on the motor off. So let's do this because it's possible that this is in fact working and this is executing our infinite loop but there's an interrupt routine which is updating variables in kernel memory. Of course, now the kernel memory is being replaced by the video memory therefore it's updating the video memory. CPM-ish has this call in it. So the problem can only be this one. Just check to make sure. No, we're not calling EI anywhere. So let's try this. And it works. We have a clean screen. So yes, that was clearly the problem. This means that we can now go and turn back on bits of our program and see what comes out. So how does it look? Boot. Good, good. The eyes are wrong but the cursor is flashing which means it's initialized video display. It's trying to clear the screen. So, well the only thing to do now is hit the return key and see if anything comes out. No, of course it doesn't. Okay, I will see if I can... Let me just... I have the Raspberry Pi keyboard here too. So let me just poke something to the serial terminals to see if it works in that direction. Cat2dev-dtby-ama0. No. Okay, so we can fix the screen clearing and you'll notice that it's nice and crisp. So it's either hung or our video refresh code is working. Well, this is weird. Sometimes when I boot it, I get this keyboard error message. This is coming from the brother operating system and I don't know where that could be coming from. My entire program is running with interrupts disabled and I'm never calling into the brother operating system. I'm doing everything myself and talking to the hardware myself. So this suggests that something is being corrupted somewhere probably on the stack resulting in a hyperspace jump when things go wrong. And I'm now wondering about that stack position. Is there actually memory there? Well, I know there is because CPM-ish uses it. I will try relocating it and seeing what happens. Well, look what I found. Current state used to be a byte. Now it's a pointer and it's a pointer to the state routine that we're calling. So by initializing this to, well, a zero in the low byte, it's going to cause all kinds of weird things. So yes, we're getting our hyperspace jump when the first time we go through TTYput to see it's calling whatever address is in there. So there's a zero in the low byte. There's probably a zero in the high byte so it's probably gonna try and reset the system. But we're not doing it right because we're just calling zero with all the wrong memory. So bad things happen. So we initialize the state instead of state waiting and hopefully that will work better. So I now have some code in place that will attempt to write lots of dots to the screen. Of course, we have a handy TTYput to see routine for writing text, which is useful for tracing. Let me show you what happens when I try it. That was the machine crashing and rebooting. So we are printing some stuff onto the screen. It's kind of not working. The fact that it seems to work for a bit even though it's printing the wrong characters before rebooting suggests that it's the terminal state is going wrong. For example, scrolling off the bottom of the screen, if the cursor Y position goes out of bounds then we've got this lookup table to look up each line and the back buffer so we may pick up an invalid address from there and just start writing gibberish all over memory. But that's definitely progress. Well, here's some stuff that's wrong. When we call print A to print the character on entry A is whatever's left over after we've subtracted lots of values here and C contains the real value. However, we seem to have defined it to take the char in A. So A is garbage. So we change that to that and copy C into A. Then we should at least get correct output text. So there's more stuff going on. So we get the address of cursor X. We increment HL. If it is not screen width, we go straight to update cursor. If it is the screen width, we reset X to zero and go to TTY line feed, which is here. If A is on, if we are on the last line of the screen, scroll up, otherwise move the cursor down one. So scroll up is straightforward. All we're going to do is delete line zero on the screen and leave the cursor where it is. We have, though I do think we have print printable, we have actually moved the cursor and TTY line feed may not actually call. Wow, unexpected phone call. I've forgotten that people actually called people on phones. It's been a while. Yes, I was looking at the cursor motion. I was wondering if there was a code path where the cursor would be moved, but update cursor wasn't being called. But to be honest, it's sounding like a crash is happening when we hit scroll up, which is course calls delete line, which is in the display routine, which of course is doing this stuff. And this is very likely to be wrong. If we're doing a LDR with the wrong parameters, then we're gonna just like copy garbage around in memory and be very likely to corrupt things. If we mangle the stack, then return parameters will be incorrect. And the system's gonna crash. So let's just disable this. And yeah, let's just see if it crashes still. Well, it's not crashing, but we're still getting the eyes. I'm not sure if it's coming through on the camera, but those are actually double barred eyes for some reason. It seems to be the character the thing prints if you give it a invalid screen code. The snow is interesting because we don't seem to get that when we're not printing to the screen. And it should take the same amount of work whenever you flush the screen. So, oh, I know what's going on.  Yeah, I'll come back to that later, I think. But we are definitely making progress. So let's try and fix delete line then. Well, this ain't gonna help. Yeah, the back buffer address table was all wrong. I have also added a new file. This print.z80, let's put that down here where it belongs. This again is stolen from CPM-ish. It contains all the number printing and string printing routines. So we're gonna go to Dell here, but instead of actually doing the copy, we are going to not do anything because there's a non-zero chance that now I fix the back buffer table, this should work. Do you think it worked? Of course it didn't work, but it did fail an interesting way. So the, you can see the row of dots down the middle of the screen. It should have filled up the entire screen. So this suggests that the cursor is not being placed correctly. There's snow, we expect to see snow. The cursor itself is flickering around. I would only expect to see the cursor on the last row of the screen. And the right hand border has got our barred eye in it. So that's not being cleared properly. Are we printing the characters in the wrong place? Well, on entry to DPUI-pronay, we have DE is Y comma X. Y is in D, it's the high byte. X is in E, the low byte. So we call a calc back buffer address. D has not been touched anywhere. So D is the Y byte. And yeah, that's not gonna work. Each address is two bytes. So in fact, here we want to do a shift logical left by shift logical left A, or just do an add A. So that will double A, so we're now properly indexing into the back buffer table. And yeah, we're doing exactly the same thing here. Luckily, we're calling calc back buffer address everywhere. So we're not actually directly referring to the tables anywhere. Okay, with luck that has placed our text in the right place. Right, del L, the thing that blanks the, you see, if we're on the last line, yeah, then just go to blank last line. Otherwise, do the scroll. I think the scroll is at least doing something. So blanking the last line looks like it's not working. Honestly, this looks fairly straightforward. HL is source, D is destination. So the destination is, the source is the beginning of the last line. The destination is one byte further on. Count is width minus one because the extra byte is done by the priming byte here. That looks okay actually. So calculate the address of the line in DE. That puts the, excuse me, that puts the address in HL. Copy that to DE, increment DE, prime, set the size, fill. And we know this works. It's possible that I've got this subtraction wrong. Different CPUs have, well, what SBC here is a subtract with carry. So it will subtract DE from HL but also take into account the carry being passed in. This allows you to chain together multiple subtractions for arbitrary width stuff. The problem is different CPUs interpret the carry flag differently. And I do not recall whether the Z80 is a borrow flag or a carry flag system because if you don't want a carry passed in, you have to either set or reset the bit appropriately. It is indeed CCF. So the subtract is DE minus HL minus the carry which because we've cleared it is zero. Okay, well, with luck, we should now be drawing text in the right place but I'm not sure about the recipe. I'm gonna just try this and see what happens. So boot and it works. We are printing dots correctly. So it was just the back buffer table that was wrong. Good. So we should now be able to, well, we seem to be able to print stuff or at least print dots. So let's try and get more of the terminal working. I also got myself some tea as I'm yawning a lot. So let's call keyboard push to try and get a value out of the ring buffer and then called keyboard pull to pull a value out of the ring buffer and then TTY put C to print it to the screen. So we should now have a system where we type and keys show up on the screen. Assuming everything works, which almost certainly won't. Let's just have a quick skim through the code. So keyboard push. Read to keyboard scan code. We copied all this from CPMH so it should be relatively reliable. So convert scan code is doing the conversion. Keyboard type is our ring buffer. Adds to the ring buffer keyboard pull, pulls it out again. This is the state machine that runs the keyboard, keeping track of whether it's seen like shift key down and up, caps lock, et cetera. All right, boot. Okay, now we press a key. Oh, it may not be showing up on the camera, but that was a Y. We're getting text. We are getting text. The cursor is entirely the wrong place. Let's get the cursor down to where things are a bit more stable. There we go. Interesting that everything has suddenly gone just up a case. What happens if I press the shift key to try and toggle it back to lower? No, it doesn't work. Caps lock. Okay, maybe I bumped the caps lock key. Space doesn't work. If I remember correctly, space is a scan code of zeros. So maybe we're getting that wrong. The cursor position could be more correct or, you know, at all correct. How about the code which you can't see me to press because it's off the screen? Code A, B, C, D, yep. And this is generating garbage. Oh, code J, of course, has a line feed. Excellent. Yeah, the code plus letters produce garbage because we don't support printing characters below 32. But code J a few times, scrolls. This looks like at least this bit of our terminal emulator works. Now, can I remember any, oh yeah, I haven't tried shift. Yep, that works, number keys. Yep, about the cursor keys. They should actually do nothing because they will have extended values but I haven't edited the key map yet. So they are still producing ADM3 cursor control codes. Let's try, trying to remember any of the, let's try escape shift A, no, escape shift E. That's cursor down. Does at least seem to be putting the cursor in the right place. It's a square bracket. So escape square bracket. Was J clear screen? Well, it cleared something, but I don't think that was right. Escape square bracket J, no, escape square bracket J. I can't remember what that actually did. But yes, this does actually seem to be relatively, that one was delete, relatively decent looking. So let's take a look at space and cursor key, cursor position. Okay, well, here's our conversion. Let's take a look at the key map generator, look key tab, let's see. So the scan codes are here on the left. Right hand side contains the ASCII codes. So where is space here? That should have worked. Scan code 0x20. So I wonder if, right, this is wrong. Instead of ret z, we want ret c. Ret z was doing, is the key a space? If so, return now and do nothing. What we wanted was, is the key a lower code than a space? So that should be a c. Good. What was the other issue? Cursor position. Well, the cursor is set with this. So we have, no, wait, I thought we'd miss the doubling. D is the Y position. So we take, we get the address of our table, multiplied by two, add on to get the address of a position in the table, right, we need to, you've done this in the wrong order. We need to load the value out of the table before we add on the X position. So that should do that bit. So it looks like we have lots of stuff working. Well, the next thing to do is to let's start pulling stuff out of the interface. In fact, let's just turn it all on because I don't think it will do any harm. Okay, let's boot it. Has not cleared the screen. Okay, well, let's press the return key. No, I think that's wedged. Let's try doing the thing in the Raspberry Pi to admit text. Yeah, that's doing nothing. Cursors. You see here where we compare the state against RS readable and then return if the state is RS readable when we should be returning if the state is not RS readable. Yeah, I think that's probably going to make a bit of a difference. I have, for the time being, disabled all the keyboard stuff. What was that doing there? That shouldn't be there because it did seem to cause things to lock up and I'm not sure why. So let's just see whether this side of things works. We should be able to cat stuff from the Raspberry Pi to our terminal and see things appear. So let's use the Raspberry Pi to dump some text and what do you know? It works. Cool. And now let's press the return key and it works. So I will just move that keyboard out of the way, move this one off camera and log in. Yikes, why did that happen? You're not supposed to get text out at this point. Oh, it timed out. All right, I typed my password into the login prompt. Newbie mistake there, I think. Okay, let's do this properly. Brilliant. Okay. So our terminal type is VT220. Let's set that to VT102. We're going to use, we have 14 rows and 91 columns. Okay. Let's start VI, cross fingers, touch whatever superstitious material you like. Wow. Okay, well that's not worked. At least something's not working. I'd be... Hang on, how do I work this? Yeah, something's wrong. Yeah, okay, cursors got confused about the screen layout. Something is not right, but we got into uppercase, which is a little surprising, but a lot of that is working. So let's try a man page. We don't get any trailing Ms. Something's not right in the bottom row. Okay, that's bad. Let's just restart the terminal. States got confused. What was the next thing we've got to try? Oh yeah, word grinder. So this is a chunky cursors program that has also got the terminal state confused. So the terminals crashed. And we actually want to... Can we exit word grinder? Escape? No, I'm gonna have to kill this from the Raspberry Pi. Yep, there we go. Okay, well that wasn't great. But a lot of things work. Now there's a... I'm pressing the tab key and it's not doing the right thing. I'm pressing the delete key and it's not doing the right thing. Well, there is a program called VT test, not spelled like that, which is supposed to test VT100 terminals. So let's just run the first test. That's not supposed to happen. Back to the other keyboard. Kill all VT test. And I think I'm gonna have to restart terminal. So this is a fair chunk of work to do. What's going on here? Oh, it's still running the program. What does modified test parameters do? Don't think there's anything useful there. But yeah, a lot of stuff works. I'll try terminal reports. That should... Okay, device status report. This is the testing the type back feature. Yep, it says report okay. Wait a minute. Test of device status, what six report curse position? Report ism. Really, ism? Square brackets 005, semicolon 001R. Unknown response, it doesn't like that. I suspect it doesn't like the leading zeros. I'll try that one again. I think it doesn't like the leading zeros. Let's try testing screen features. That's two. There should be three identical lines of stars completely filling the top of the screen. Test of wrap around mode setting. Yeah, these aren't gonna work. We're not setting 132 column mode because this thing is limited to 91. So this one's irrelevant. We don't have a scroll up region. Yeah, none of this stuff is relevant to our program. Origin mode we haven't done. Attributes we haven't done. Save restore cursor feature. We have implemented and it does look like it works. Although a lot of this is garbage. Let's try nano. That has not displayed properly. I don't know where the eights come from. We can type. Right, scrolling down is del line. Inserting, a scrolling up is ints line. But I do not know why that's not done anything useful. Ah, I know why it keeps switching to capital letters. I normally use this as a control key. So I have to press a different key on this. No, I don't want to save the modified buffer. Okay, so I'm just trying to get a handle on what might be broken. Does do we, are we still in the right? We see argument two, then it hangs. Really? Reboot the terminal. Interesting. And now it's doing the very slow text thing. Okay, so, so you run script to log output. STTY rows, missing argument two, and it hangs. Reboot the terminal exit to exit the script. We now have a log in TypeScript, which we can look at using, yeah, that I need to fix that delete key that's maddening. You can edit, we can look at with TypeScript. So down here, I think my finger is showing up on the camera, you can see me typing STTY. I don't think I can scroll down without working cursor keys. I can go to a position, so let's go to CO, go to 80, is that gonna force it to, nope, go to DO, should force it to scroll. Only a little. So, yes, that's not luckily, there we go. Here at DO, you can see STTY, missing argument two, and then E28098 rows, that's a Unicode carrier. That's what it is. E28098, so that should be a, ha. That's gonna be an open smart quote, and that's why it's just hung there, because you can see from the context, it's probably just about to print a smart quote. So, that gives us a place to look. So we need to fix delete, because otherwise I will go insane, cursor keys, and UTF-8.


Hello and welcome to the session. Let us understand the following question today. A sum of Rs 700 is to be used to give 7 cash prizes to students of a school for their overall academic performance. If each prize is 20 less than its preceding prize, find the value of each of the prizes. Now let us write the solution. The value of 7 prizes forms an AP with common difference here. Common difference is equal to 20. Since it is given that each prize is 20 less than its preceding prize and it is given to us that sum of the prizes is equal to Rs 700. Now let the value of first prize be Rs A. Then D is equal to minus 20, S7 is equal to 700. Now we know Sn is equal to n by 2 multiplied by 2A plus n minus 1D. And we have to find the value of A and we have S7 is equal to 7 by 2 multiplied by 2A plus 7 minus 1 multiplied by minus 20. S7 is given to us as 700 so it implies 700 is equal to 7 by 2 multiplied by 2A plus 6 into minus 20. Which implies 700 is equal to 7 by 2. Now taking 2 common from this we get into 2 multiplied by A plus 3 into minus 20. Now here we see that this 2 and 2 gets cancelled so it implies 700 is equal to 7 multiplied by 8 minus 60. Which implies 700 is equal to 7A minus 420. Which implies 7A is equal to 700 plus 420. Which implies 7A is equal to 1120. Which implies A is equal to 1120 divided by 7. Now here we see that it gets cancelled by 160. Which implies A is equal to 160. So we have got the first term as 160. Now since it is given that each prize is 20 less than its preceding prize. So first term is equal to 160 which is equal to A1. So now A2 is equal to 160 plus D which is equal to 160 minus 20 which is equal to 140. Now similarly finding A3 is equal to 140 plus D which is equal to 140 minus 20 which is equal to 120. Now A4 is equal to 120 plus D which is equal to 120 minus 20 which is equal to 100. Now A5 is equal to 100 plus D which is equal to 100 minus 20 which is equal to 80. A6 is equal to 80 plus D which is equal to 80 minus 20 which is equal to 60. Now A7 is equal to 60 plus D which is equal to 60 minus 20 which is equal to 40. to 40. Hence, value of prizes in rupees are 160, 140, 120, 180, 60, and 40. And this is our required answer. I hope you understood the question. Bye and have a nice day.


Hi and welcome to the session, today we will learn about types of functions. So first of all let us see what is a function let A and B be two non-empty sets then a relation from A to B is called a function if every element has a unique image in B and this is denoted by f is a function from A to B. Now let us move on to types of functions first one we have one one or injective function a function f from x to y is defined to be one one or injective if the images of distinct elements under the function f are distinct that is x one x two belonging to x f of x one equal to f of x two implies that x one is equal to x two otherwise one that is for many elements they can be one image now next we have onto or surjective function a function from x to y is said to be onto or surjective every element is the image some element that is for every y belonging to y there exists an element f of x is equal to y and now third we have bijective function a function x to y is said to be bijective if it is both one one let us take one example now here we are given the function f from r to r such that f of x is equal to three minus four x and we need to show that f is bijective now to show that f is bijective we need to show that f is one one and onto so first of all it is show that f is one one for this we will show that for every x one x two f of x one equal to f of x two implies that x one is equal to x two so here let us take f of x one equal to f of x two so this implies now f of x is three minus four x so f of x one will be three minus four x one equal to three minus four x two so this implies minus four x one is equal to minus four x two which gives us x one is equal to x two so from here we get therefore f is one one now we need to show that f is onto and for that we will show that for every y belonging to r there exists some x belonging to r such that f of x is equal to y so let y is equal to three minus four x so from here we get x is equal to three minus y upon four thus for each y belonging to r there exists x equal to three minus y upon four belonging to r such that f of x is equal to f of three minus y upon four which is equal to three minus four into three minus y upon four which is equal to y so for y belonging to r we have x belonging to r such that f of x is equal to y therefore we get f is onto now we have f is one one and f is onto so from here we can say that f is bijective so in this session we have learned types of functions and with this we finished this session hope you must have understood all the concepts goodbye take care and have a nice day


I've been Dixie a lot, I'll kind of show you the way, I've never, I don't think Nolf, has anybody ever seen a video of Nolf actually teaching it? I think you don't teach it on purpose. Like, I got kind of my version that I think, you know, we got a couple kids that are pretty good with it and I'll talk about it a little bit. I'm big on not showing technique that I haven't seen my guys prove at a high level because I don't want to just show you campy moves. I want to show you moves that actually work at a high level. Obviously, it works at a high level for him because he puts a lot of good people on his back. I'm going to show you the leg pass from here first. Get on my right leg. I'm going to show you the leg pass here first. And again, I got to get the heel outside his hip. All right? So now he's going to split me again, so I'm going to rate stuff and cover. Okay, and he's going to post and split. Now, stay right here. When he gets ready to split, I want you to think about if I was throwing my leg up over the back of a horse to get in a saddle. Now, I'm not getting on the saddle on his back, but if I was throwing my leg up over a saddle to get on a horse, that's what I want you to think about. Now, when I throw this free leg up over the top, I'm trying to get my knee down to his hip. Remember on that single leg spin out when we used our knee to push away his hip to straighten the leg out? That's all we're doing in this position. Now, my free hand is going to come inside the toe right here before he gets weight on it. My outside arm is going to be on my elbow, kind of like a kickstand, right? So as he lifts, I'm going to go off to the side he's attacking, post on my elbow, dig in between his toes, and take my free knee and put it on the inside of the hip. So as he goes to split, I'm going to go out to my elbow, knee is going to come to the hip, hand is going to split his feet. Okay? And in this position, I'm just going to push the knee away, with my push his hip away with my knee, pull the foot to the bend of my elbow, and we know what to do from here, right? Punch away from the body, all that good stuff. If he follows, I sit back, right? If he doesn't, I knee slide out. Okay? So up on my feet, he shoots a single leg, breaks up, cover. I'm trying to sprawl, trying to beat him up right here, don't want to scramble. Okay? He posts and splits. I start getting taken up over the top. I go post to my elbow, not my hand. My elbow, knee swings over the top, hand splits the toes, push the hip away, pull the foot out, okay? Bend to the elbow, right there on the sock, post, slide up. So we've gotten that timing to where we see the mat and slap the mat when we were splitting them. That's a real good time to use that same skill when we're turning here, changing knees back into his body to finish on this scramble. All right? But again, when I split, when he splits me, I got to swing that knee over the top and get off to the side. Notice I'm not going to my hip initially, okay? Over here. So he's in on this single. All right? Great stuff, cover, square. I'm setting my anchor every time. He posts and splits. When he posts and splits, I'm out. I'm not going to the side. He's taking me over the top. I post out, slide off, catch the toe right here. All at one time. Knee comes over, pushes the hip out. Once you wiper that foot, bring it to the bend of my elbow. All right? If he does stay with... Are you pushing out with that left foot or are you pushing out with your right foot? Both. I'm always trying to get my feet in the mat. Does everybody see where my right foot's at right now? I'm always trying to get my feet in the mat. Even if I just get a little bit of the mat, it's better than nothing. I'm not here passing the leg. Okay? I'm just passing it with my arms. My right toe's in the mat. My knee's pushing away. And as soon as I get this leg straight, feet are back in the mat. If he does follow me, scoop that knee, push back, work up the leg, get back to the same position we've been getting to this whole camp. Now you guys are starting to realize there's actually fundamentals in places we get to in all these scrambles. All right? Make sure we're in between the toes. We're windshield wipering the foot out. We're pushing the knee away. And we're getting to our leg pass. Questions? What's up? One more time? Sure. Okay? So single leg. Great stuff to cover. All right? He might be trying to run the corner here.  Then he goes to split. Circle a little bit more. Then he goes to split. He posts and split. I get to elbow. I almost shoot off the side. Okay? Hand drops in between the toes. Right here. I might have to wrestle here a little bit. And attack this foot. But once I get it, bend to the elbow. Don't try to pass it like this. I'm super weak. Not very controlled here. Make it part of your body. Get your feet back in the mat. Okay? I've even seen some guys diving out and ducking ankles right here. Just drilling. Nothing wrong with this. Okay? You get your timing down right. This is way better than passing away. All right? Now you can start seeing where you can take certain positions that you feel good in and start mixing in some of this other technique we've been doing. Questions? Play in there. Go. Let's get it.


So we're really, really pleased to have Professor Nilsen here. So thank you very much for coming and developing. Thanks so much. I'm very much not an archaeologist. And I'm not trained in anthropology. My background is in evolutionary biology. It's in teanics. It's also in statistics. I do a lot of machine learning and so on. But I'm going to be completely honest about the fact that I really don't know anything about archaeology. But it talks a lot about an archaeologist. Because what I do is trying to interpret the pronounces of genetic data. And then to understand what that means, we need to talk to the archaeologists that have the experience and understand the context of the data. And unfortunately, I have to speak to people at Berkeley. And I speak to people all over the world. But never to anybody at Berkeley. I'm very eager to get to know people at Berkeley better than I do archaeologists interested in archaeology in general and might actually be able to help me understand the principle of the diagram of this data. So I'm going to tell you a little bit about how I come in to the whole analysis of ancient DNA. This is the main topic of this talk. And my background, as I say, is really statistics and genetics, not the human genetics. And my life is done in rocks and lizards and other things as well. But we've also been doing human techniques. And mostly because what we do is we develop statistical methods, computational methods for analysis of the genetic data. So we get to also have the privilege to be involved in many, many different projects because of that. And one of the projects I got involved in very early on in terms of genomics was the sequencing of the first ancient, of the first sequence in the first ancient genome. And raised the question. So now it is the third human genome that was in our sequence, the first representative from anybody from Asia, collaborated with some Chinese collaborators on this project. And it raised the question, what can we learn from sequencing the genome of an individual? That was basically the question that goes to me. We have sequences genome. What can you tell us now that we're sequences genome? And of course, many instances is a lot of functional stuff. So what's the chance of getting Alzheimer's disease and diabetes and hypertension and so on? And one kind of what we're going to do is how can we best predict that? So how can you help improve health care by analyzing these genomes? How can you help predict disease, race, and so on? So that's one thing that we did. But what we realized when we do that, that despite our successes in genomics, our ability to predict phenotypes are still pretty core, particularly complex phenotypes that we learn a lot about. I work a lot in China to that fetus. And our ability to use DNA to predict who will get type 2 diabetes is still pretty core. The much better of just the blood sample and measuring tractors around levels and so on, you told much more than my sequence in the genome. So there are lots of, so in terms of being a genomicist and having been part of the whole process of take my pain steam to follow sequence in the genome, go and improve the genome sequence until after we have the genome. One of the disappointments happening is how little we can actually save from genomics and perhaps the promises of genomics were exaggerated. But one thing that we learned is that even though our ability to predict phenotypes are core, we can actually learn a lot about the history of the privileged and individual come from just one genome. Why is that, why is one genome, it's just one individual? Why does that result in that option? It's because that individual had two parents. They each had two parents. So if you go back in time, the one genome ribs in a whole lot of individuals, it's just two bangers. So there's lots and lots of rich information about the genetic history of the population, where a bang in time ribs sent by just a single genome. And that's something that we take events of in a number of projects. Now I think it's very important when you do this type of genetics to be aware, what can you say something about the genetics and what can you not say something about? So the things that we can say something about and that you will know from forensic genetics from the O.J. Simpson trial and so on, we can say something about individuals' genetic related, right? So like paternity test results. We can also ask, you know, what's the chance that it's a grandparent offspring all they are separated by four or five generations or three or five generations. We can say something about the degree of significance. And then we can say something about the crazy uncertainty out of the time it took to share the common ancestor. If we take two of us in the room, we can make some estimates of how long time since we had a common ancestor, the two of us, that we shared an ancestor. And that's basically what the DNA exposure is about. And everything else is interpretation that goes on top of it. So what we've not learned in the standard of the protein analysis is, you know, what are the cultures associated with remains we're looking at of course? Transmission and order of cultures. The DNAs in the cell doesn't say anything about that. Transition and order of languages. And also the physical of each of our ancestors. So I think some of the first ones should be pretty obvious. The last one, people who make lots of mistakes in my opinion because of that, because you make sort of these maps of how people move around the world. And there's some implicit assumptions about where these ancestors were located. But of course the DNA cell does not come with a stack of geographical location, except for the one individual or few individuals who are also analyzed. The ancestors are not announced. It doesn't come with any kind of dual location. So the physical location of ancestors also intervenes. Of course, in large countries we also present ordinal languages. So how much can we say that we can show that some individuals are related to each other and some, you know, and further spoke some type of language. But the cell today tells you about the translation of the languages. There are not a lot of cultures on that. And I will not go into that because I feel that I think much of these countries really are on interpretation rather than on the genetics. I'd rather stay with the genetics. I'm going to talk about a couple of different projects. So I'm going to start talking about the anaphylgenome project. So how do you rule that in Swine and Pablo's group he sequenced the first anaphylgenase. So this is from an early anaphyl bone. What they do is they drill in the bone, get a little bit of seizure on them and try to escape the anaphylgenome. And when Swine and Pablo sequenced the first anaphylgenome genome, I had been working on methods to try to detect if there had been integration in a population with a lot of known individuals. So when it's integration, it's a trans-war genetic material from species or subspecies of different populations to and by interpreting. And at this point we're doing this. A lot of countries have had to be interpreting between the anaphyls and modern humans. And there were various opinions about that most common people is that there had been no interpreting. But there are also people that had to be interpreting a lot of controversy about that. So what are these methods? And then our contact is from the Pablo's project group and what they agreed is that they would send me, I would send predictions of what the human genome had coming from the anaphylgenome. And then they would compare that to any anaphylgenome to see if my predictions were right. And there's one of several value approaches they used to see if that in fact had been the anaphylgenome integration. So a little bit about the methods that we used for doing that. So we're looking for genetic regions that had the fundamental property that if you take Europeans or the Asian, that the lineage falls way outside the genetic diversity of ICM on humans. So we're looking for segments of the genomes that you find in people outside Africa by outside Africa because they're supposed not to have been the anaphyls in Africa. We expect that it's based only outside Africa. So we're looking for particular segments of the genome that had these very, very large convergence times between that segment and all human segments that fell generally outside the whole human genetic variability. And then it would be our candidate regions for integration, the DNA that has been transferred by interpreting between some other hominid and then into humans and then the anaphylgenome. Now if we do that, we can look at where the mutations have happened on that gene tree that we're looking at, a little local gene tree that's reflecting the genetic history just of that little part of the genome. And then we put on all these mutations and then we can identify these mutations as diagnostic mutations that should tell us about the anaphylgenome. So during that, we came up with a prediction of a number of regions, these are regions that looked like there was evidence of hominid, integration from another hominid into modern humans outside Africa. And then what some powers could do, they could then look at the diagnostic SNPs that we had predicted would find in the anaphylgenome, other in fact in the anaphylgenome. And in almost all the cases, except the last two cases here, we found there was almost a complete match. So for example, there's 21 mutations that are really rare in humans that we predicted you should then find in the anaphyls that they had all of those in that particular practice, for example. And then we do various statistics on top of that and show the least degree of similarity. You couldn't get that without some kind of integration. The way we've done it, there was many other arguments going into showing in fact that had been integration between from the anaphyls into modern humans outside Africa. I think that's why they accepted an outfit that is in fact the case. Now the question that then arises from this is, well, when did that happen? When did humans and the anaphyls integrate? And there've been lots of discussions about that and there were various ways that we tried to estimate that. I really like to use what I think is the most precise way of estimating it, just to look at what's called the length of a mixture of fragments. I'm just gonna spend a couple of minutes trying to explain what I mean by an anaphylgenome. So imagine that you have an F1 hybrid, so to speak. So you have the first generation descendant of an offspring between the anaphyls and humans. You might have a particular part of the genome, you might have one genome in there, or one DNA spring for one of your parents, say the red one here, that is human, and another one, the blue one, that is the anaphylgenome. Okay, so what happens is if then that individual then meets with other humans, is that the fragment would become long, or shorter, sorry, because of the process of recombination. Let me just explain that for a second. So there are one piece of DNA from your model, another piece of DNA from your father. As you produce germ cells, and you produce egg cells and sperm cells, they send off to the next generation. Those chromosomes get aligned with each other during the process of celibation, goliosis. And when that happens, DNA is switched between the two chromosomes. So the trinocromosome act gets on.  That's a process called recombination, okay? That happens. So in the next generation, there might not be a recombination event.  And I should say, when I say the word human here, in contrast to the anaphylgenome, I'll just use it as a way to describe modern humans versus an anaphylgenome. I'm not playing statements about what our species is. So that's hard to avoid that discussion. So I hope you'll allow me to use those words. Humanly, I hope I'm having to defend myself in terms of how I defy species and things like that. So as time goes on, you will see that, you know, you can have all recombination events, and these fragments segregates in the human population as they're passed on from generation to generation, then they become shorter and shorter. And the kind of thing that we do in my lab is that we then bring models of this. We're saying, okay, how long, if at mixture time, it's 30,000 years ago, 70,000 years ago, how long should the distribution of these fragments be? How can we base it further on these fragments and then from that infer when the integration event is? So what we do is our work on that. And we think now that the integration time is about 55,000 minutes. So these fragments are so short that it corresponds to about 50,000 minutes. It's not important, but there is important not just for the context of when this happened. It's important also for another reason that is they will not go back to the time of the most recent common ancestor of humans and the endophones. That's way further back in time must be because it's been breathing, it's been breathing through humans and the endophones since they spin off from each other. So that's why the recent data is also important in that. It's also to say that this is an average. So there could have been, in fact, multiple acts of integration. It could have been in multiple periods. But if you're making a model where you say that it only happens one period in time, we saw these two populations emerge, that's the estimate you get. And there's some debate on how many endophobe integrations that actually happen to humans and when they happen. This is, if you only assume one, that is the date that you get. So we're getting now a model of human evolution where we have this endophobe integration. Of course, we don't know they're all hominids present, particularly denizens, but it does work a bit on that. I'm not going to say more of that, but I think we're getting more and more and a view of human evolution that is more of a merger of the traditional African motor retail models, where there's more of a view of human evolution in some way and between that. But there have been multiple different populations that have to interact with each other and that human evolution is not really sort of a tree. It's more formed by different populations moving around and then in some sense evolving to certainly a re-together. So if you ask me, 15 years ago, what did I think about human evolution? Or you ask, any geneticists, the geneticists would very much have a view of a sort of a tree, you know, people who move out of Africa and sort of there, that out of Africa events have completely replaced everybody that were out there. Previously, of no inside Africa on integration, which we now also see evidence for and so on. And I think we get a different view now of what human evolution has been about. Now, another interesting question that is, okay, so has there been any, as these two genomes mix, you know, form a new organism with genomes that have been separated for hundreds of thousands of years, is there a natural selection active in that process? That's something we've been very interested on. We're going to natural selection a lot. It's sort of one of the whole research areas working on many different organisms and trying to find natural selection. And there's been playbabe that's not published by us, but published by other people that are arguing that there's, in fact, been a lot of natural selection in humans against natural DNAs. So then, natural DNA has been perched out of the human genome. One of the arguments came from a plus like this, where you take the difference individuals who try to estimate the amount on the end of DNA, you can see there's this decreasing proportion of the end of DNA. This particular study has recently been criticized, given the argument that there's a fact that is the nation by eye. So there's some controversy in the field about, well, this is actually real, that there's this decrease of the end of DNA because of perjury. But we have much better evidence that shows that, in fact, there has been selection against the end of DNA. And it comes from some different papers that all show the same thing, that if you look at the human genome, where there are functional genes, where there's some genes that are supposed to be important for fitness, they have important functions, there's less than any end of DNA in those regions than part of the genome that doesn't, isn't associated with any function. So the neutral parts of the genome, the ones that we think are not constrained by natural selection, have more end of DNA than the parts of the genome that are under selection to stay the same, okay? And there's really no process that will generate this pattern without natural selection acting to purge the end of DNA. That's the only explanation we really have of that. So the question is, okay, why is that happening? And there's basically two competing theories. One theory is that genetic incompatibilites is involved between the end of DNA. We basically have evolved to become partially separate species that now have the genetics that were incompatible with each other. Now, better hypothesis requires that there are thousands of positions in the human genome and the end of the genome that have these kind of incompatibilites. Incompatibilites like that are hard to evolve. Why are they hard to evolve? Because if you have a new mutation of humans that creates incompatibility with the previous version, that would just be eliminated, right? Because that will, selection will act against that. So the only way you can get these incompatibilites is that you have a mutation in humans that in itself is not bad for you. And then in the end of the world, they get a separate mutation that also not bad for you. But then there's somehow there's an interaction between the two mutations, new, two new mutations. So that if you bring the genes together, then there's an incompatibility. So there's not a theory of this. This is something that we haven't practiced though. So there's another possibility for what could have happened. Why there has been selection against DNA and the full DNA. That possibility is that the Neanderthals has a much lower effect to population size in humans. We know that they have very small population that leads to a higher inbreeding and that leads to an accumulation of deleterious mutations, okay? So, you know, in brain organisms, they tend to not be well off. And in data species, they're in danger because of population size.  And then in the actual selection, kind of get rid of it. And we think, and there's lots of evidence, that was for a moment in the Neanderthals. So we're months of that. So we can model very simple models of human evolution with that bottleneck at some point in time in that expansion. These values here are effective population sizes which also are vastly smaller than the actual number of individuals in the population. We can estimate this that Neanderthal population size is about the tenth of human population size. And what's that for quite a long time? And that would lead to accumulation in deleterious mutations to a higher inbreeding than humans. Now what we also have are estimates of, what is called here, the distribution of fitness effects. What is that? We can take from monitoring data, we can estimate how many mutations are there of different fitness effects. That means that they affect reduction or survivability in a certain way. And then it's very hard to estimate for material mutation, but we can estimate the whole distribution. So if we take a model like this, which is not from us, but from other people, put together with a model like that also from other people of the distribution of fitness effects, we can do it more importantly, the relative fitness of Neanderthals and lot of humans at the time they met. The scales will have relative to the fitness of more humans. And this is the distribution of fitness. There will be a distribution of population, of course, some individuals who are random, you have more deleterious mutations than others. And what you can see here is that there's substantially lower relative fitness of Neanderthals. That's what you would predict simply based on what you estimate the humans on distribution of fitness effects and of the history of Neanderthals. And from that, we can then predict, okay, would we see a pattern like what we see in the real data that there's this positive of Neanderthal DNA around reaches of the genome that are functioning that there's too few Neanderthal fragments in the genome near protein-coded genes. And we are certainly too much through the details. Yes, we can explain exactly what you see in the real data. So this also makes another prediction. This makes that this selection that has been against Neanderthal DNA would actually mean that the proportion of Neanderthals that would have contributed to that makes it much larger initially. But then there was all this selection to get rid of it. And if you try to estimate it using these kind of laws, there's no way to get a good fit to the pattern you see in the genome without having about 10% Neanderthal mixture. Okay, so initially you would have an investor where about 10% of the DNA come from Neanderthals. And that's interesting because it corresponds to that one to 10 ratio of how many humans to Neanderthals has been estimated to be there. So what that suggests is really that the Neanderthal extinction was not really an extinction. It was more like an absorption. The two species met, and then they started interpreting. There were more humans than Neanderthals, so there's much more human DNA. And then the Neanderthal DNA had many more deleterious mutations that through time was a DNA from the population. That's in some sense the best fitting model if you should believe the genetic data that the Neanderthal extinction was perhaps an absorption. But it happened also because the Neanderthals already had really little fitness because they had no effective population sizes. So arguments about carrying capacity for Neanderthals and so on is part of their story as well. Because it only works because then to a start had very low population sizes. Okay, so that was the Neanderthal genome project and a little bit of the things that we were doing recently to try to understand the genomic pattern of the Neanderthals and humans and what it might mean with regards to the processes doing these Neanderthals and humans. So now it goes to a more recent timescale that perhaps some of you, it's more interesting and talk a little bit about various projects we've been involved in on more recent human remains. So the first ancient human that was ever sequenced was a project I was involved with with my long-time collaborator in Copenhagen at the Willis level. It used to be before I was Berkeley, I was a professor at Copenhagen and started working together back then and he is one of the leading researchers in ancient DNA in the world. And so I've been helping him with many data analysis for many of his projects. And one of the first projects we did in humans was this saccharidinum project. That was the first ancient human genome that was ever sequenced. And there's a little background, many of them I know, a background better than me but I'm just gonna give you what I know about it. We have a saccharidum culture that existed from about 2,500 BCE to about 800 BCE. These are some of the archeological sites where you find that culture. The saccharidum, they were mostly reindeer and mosques, hundreds and hadn't been specialized on fishing and hunting marine mammals in the same way as some of the modern Arctic people that we live with. So if you look for time, later on, you will have a replacement of the Capcom culture with the Dolce culture in Eastern Canada and up in Greenland, the Dolce culture then later get replaced by the Fude culture which is an early culture associated at least to the modern Inuit culture. And that's a culture then that's associated with what we know about Inuit today, specialization in hunting, life of the ice and hunting from the marine mammals and so on, kayaks and all that. So the question is, at this point when this project was, was the saccharidum people were they, you know, there were not, there were not some cultural issues about this or the culturally there are answers of the Inuit, there's some similarities with a lot of differences too, was it just a replacement, you know, whether it was essentially just the saccharidum people that eventually became Fude culture and they invented the Inuit culture and became the Inuit or was these two different people and here we get into a little bit of my field because there are really two statements here I'm complaining myself. One about the history of the sort of biological history and then there's a cultural history, okay. And that always becomes a little bit dangerous. So what I can tell you about is the biological history and then I need people like you to tell me about the cultural history. I can tell you for the physical remains that we're looking at who are related to it, okay. And then you can help me with the cultural context of that and why that not meant and I realize that there might be different interpretation of that. So the same way we're working on was that tuft of hair that had been lying in the museum, I guess in their, you know, that's not to a column and that was an acolytist, an acolytist had gone out in Greenland and then part of, I also find human remains and those human remains then be lying in a museum in Denmark. So this is that tuft of hair here. And one of the first thing we look at, you can't really see it on this slide, I'm sorry about that, is when you look at what's the, you know, how well preserved is the hair compared to modern hair? Okay, it turns out it's quite well preserved. If it's not well preserved, what you'll see is that there's a lot of bicellium going through, you can see fungus that will be going through the hair and so on. And this as far as as ancient samples go, a lot of the samples, it's pretty well preserved. And it was perhaps not surprising when in the conditions it had been on. So very conducive for extracting DNA. So the DNA was extracted from the hair itself. You wanna make sure to, for ancient DNAs of what we have all ago, because that's usually highly contaminated with fungus and bacteria, so you take the hair itself. Now actually, the best thing right now is actually to work on the pitrus bone in the skull. The pitrus bone is, you know, not really talking about something and not anything like that. I've been told that it's very dense and it has conditions that are very good for DNA preservation and very, very rarely contaminating. Most studies time out to work on this pitrus bone, but hair is also good to have, although it can be heavily contaminated.  And then you find that maybe 98% of the DNA you get is bacterial DNA or it is fungal DNA or it's something else. But some of it is straight DNA. And so you just sequence and sequence and sequence until you have enough human DNA to make a genome. And that's one of the reasons why, and that's a technique that has been used in at least early studies and we're still using that in many studies. That's one of the reasons why ancient DNA studies are so expensive because you have to sequence so much to get the doctor's DNA out because it's used in so much contamination. You deal with it bioinformatically, you can rid up all the contamination, it's no longer really a problem for inferences and so on, but it's a financial problem because you have to spend so much money on DNA sequencing to get a genome. So what we have a genome like that and can sequence a genome, what we can do then is that we can then compare it to reference panel or modern treatments, for example. And back then we didn't really have any other reference panels, now we have a lot of the genomes of other ancient DNA, but we compare it to a reference panel. And one of the most simple ways that we do this is maybe a C8 model, and you might have seen these kind of cluster form, it takes a major axis of variation in your data and then summarizes rapidly how the different individuals you have to relate to these major axis of variation. And you see here, there are reference panels from people from the Americas, Europeans, East Asians and South Siberians. Then you also have some East Siberians here and then if you put this up, sample on it falls right here, near the Siberians. And that is one important question that the closest one to medical, the ones that the psychiatrist, relatives with the most recently, and we've shown in many other ways that are more refined than this sort of group we are doing it, that closest relatives are in fact people that today live in East Siberia, it's not on Inuit people. So that, and we can estimate, in fact, when this year ends. So the answers with Inuit people goes back quite, quite a time. And that's probably the distribution of more sophisticated estimates up and now. At that point we estimate that it's maybe something like 15,000 years, whereas the common ancestry with the East, the Siberians is maybe only 5,000 years. So that suggests that there must have been this expansion of the psychiatrists, also it's fixable, the archaeological evidence from an area in the Eastern parts of Siberia, in the Apparingia here, quite fast, eventually, we estimate the estimates of this time since they have ancestors. So of course, the whole movement of people, now that's an inference that we have here. I don't know that, I know who they're related to today, and from that we can sort of surmise that there might have been this migration. And if that also seems to have some support from archaeological evidence, we can build a case for this. But it's of course important that we're aware that the migration itself is an indirect inference, that it didn't relationship with the direct inference. Okay, so we kept working on various issues relating to Arctic people for a while, and one of the issues that we're also interested in was the Dorset culture, how did that fit in with it? And here's another way of visualizing some of the results. And this is in terms of a tree, and I should give you a warning when I tell you this tree that if you're able to lose your ability to describe in broad terms the way you lose that tree, this is a tree that gets described and type of genetic relatedness among individuals. And you'll get a tree, even if the way that these people have evolved from each other, it's not tree like at all, but by migration, back and forth, and the rest of it. It will still summarize the genetic relatedness in terms of the tree, and that's what we're doing here. We know that in fact this is not a really accurate representation of really the history because human divergence and evolution doesn't work by different populations splitting up from each other, and they were meeting again, as might be implicit, might be implied by tree like this. But what we see here is, one of the things we can see is that we find that the Dorset DNA remains from people from the Dorset culture, grew up with the Zakat culture, and not together with people from the Inuit cultures. We find that consistently no matter how we do that analysis. And what we think now is that in fact there's strong evidence that there's not much genetic relatedness between the Zakat and Dorset people and the Inuit people, except that there was some subsequent gene flow between them. So there was some interbreeding between them, but originally they were more of a separate structure. So people like to make figures like this, and again there's a lot of interpretation here of what's going on, but they make the sort of take home messages that it seems like that the genetic data are most compatible, are very compatible with the idea that there were two really, two Arctic migration work that both came from around the Bering Strait here. And that was first an early one that led to the Zakat culture, and then a data one that is associated with the Inuit culture that then replaced by a lot to replace the Zakat. And that seems at least to be the genetic story, and it's also compatible with evidence that you have the Inuit culture, culture between the cultures in Alaska, Western Alaska, so it seems to also be quite compatible with much of the archeological evidence, and there are a few of them for us that have proposed this scenario. This doesn't just come from the genetics, the net is certainly very compatible with it. Okay, so that was the Arctic people, which is one of the groups that we find in North America today. So we've been very interested in this problem of the keeping of the Americas. And one of the first study we did that was actually by accident, we're starting a completely different culture. So we're interested in this, the Metaparet culture, and so there was some cast out there actually, just as we're coming in here from that culture. That's kind of interesting. So the Metaparet culture I'm being told is a culture that you find in Southern part of Siberia, Northern Asia, about 24,000 to about 50,000 years before presence, and it's characterized by various logical means including they have these dwellings that they build up with reindeer and bones and so on, and it's been up top. And then it's also been associated with these seamless figurines that, you know, doing the autopilot living to also find Europe. So when first this culture was discovered, those are our interests. It's mainly is that shared culture that goes all the way from Europe and then into much of Asia. You can probably educate me much more about that discussion. But of course it leads to then some interest in at least people when you have remains from them. Are they then genetically related to people in Europe? That leads to that question. This was all by and several projects that was really led by questions posed to us from archaeologists. So we have one sample in this project. Actually we had a couple, but one that was sequenced really, really well. We've got really high quality data from it. The Metaparet one sample, which was dated about 24,000 years before presence. And just to show you on the map, that's here, we also had some other samples in the same store here. And then we ask the question again, okay, so these Matai people, who were they related to? And one way to visualize it, another way to visualize it, could be if we were mapped like this.  And the more blue we are down to black, the less related you are to those people genetically. And the more red it is, the more related you are. And if you take the Matai, this is for the Matai in the Victor. You can see when the Matai in the Victor is actually not closely related to many Europeans now, then they are too many people in Asia. So there seem to be a connection there. But, and this was a big surprise, there were way more related people in the Americas, to native Americans. They were strongly related to native Americans. That was a huge surprise. Way more strongly related to native Americans than in say East Asian side. How many of the, basically any of the Arctic people are living in Siberia today. So what we could infer what's going on, the genetic data sources it's going on, is that if we take modern native Americans, they can largely be understood as having two genetic components that help, that form that, that one genetic component that is related to this Matai in the Victor. And another genetic component related to East Asia. Okay, so Matai itself is mostly related, in fact, to Europeans. And that's sort of a problem in the field, that when people have been analyzing DNA from native Americans, they actually noticed that there was this sort of, genetic affinity to Europeans. In the beginning, everybody thought okay, it's just because of course, colonial, you know, post-colonial, that makes up between native Americans and European colonialists that come in and treat with DNA and so on. But then as we got better and better data, we could kind of exclude that, estimate that it couldn't be from that. So it seems to be that, I don't know how well you know that field, but there are all these salutary and hypothesis, hypothesis about Europeans coming into the Americas and so on. That whole problem was solved with this. It's because of ritual population that leads to the foundation of, pretty much all native Americans, except for some of these active people, they were themselves, and it makes a composite of different populations that live in Asia. People associated or related to the Mertabu Red culture and then individuals related to these nations. All right, so that's, so it's a little bit about what happens in the formation of native Americans biologically, genetically. Of course, we're also interested in what happens then inside the Americans. And of course, the first unique culture we really have in the Americas is the Clovis culture. Long time people felt that the Clovis culture was the first, those were the first people in the Americas, and now there's lots of evidence suggesting that they're not the first people that are older, archeological that remains in the Americas that are not Clovis. Again, now I'm lecturing about something that you know much better than I do. This is just the preamble for what I'm going to say next. Winston, of course, then what is, questions what's going on with the Clovis culture, where they come from, and how they relate to modern Native Americans. And for this particular project, I collaborated with Billus that was contacted by a person in the United States that had an old baby, essentially, in the closet, so to speak. That once those, as an antique one boy, as a boy that was once two years old, dated about 12,000,000 years old, that this family has had in the closet. There's nothing more sacred in America than the right to own your own property and anything you find on your own property. So if you find the remains of a person in your own property, that belongs to you, and you have ownership of that. So this family has had this antique one boy in there, literally in the closet, in the house for a long time. And this person then contacted, asked to say, oh, should we do some DNA on that? And he then contacted the local tribe. So there's lots of issues there. So it's private land, so all, you know, all the NACPRA that does apply when it's on private land. But, asked if contact had been working with Native American groups before, and he contacted some of the local Native Americans in the area and discussed the issue with it. And they said they would, you know, when the local tribal council branded it, I would say that now they would be okay with doing analysis and so on, as long as it was repatriated to their loved ones. So that was sort of an agreement that was made where, as we said, yes, to repatriating it, or repatriating these remains voluntarily. So if you look at doing the DNA analysis and like this again, you see again on that, you know, we see that this NACPRA one individual, the NACPRA one boy, in fact, is closely related to modern Native Americans. If you look at it in terms of this tree, or if you look at it this, in terms of reference panels who are dancing more mostly related to and mostly people in Central and South America. So another story is what we've been able to show is that there seem to be evidence of really sort of two major groups of Native Americans and normal group and some group is split up about 11, 12,000 years ago. You can estimate. And the answer for one more is, is partly closer related to this Southern group than actually the Northern group. And so anyway, we're not after analysis, the remains were given back to the Native Americans which have then reburied those remains. And that was called a lot of discussion. When you have some remains that are 12,000 years old, you know, who should it be repatriated back to? Who does it really belong to and so on? And that was not solved in this study and I'm not sure the way that it was handled was the right way, but it's certainly something to think about in the long run in terms of repatriation and so on. But remains that are really old, there might be dissidents of that police that remains come from many places in the world, in many places in the Americas in this case, who do the remains really belong to? And I'm not very sure I have the answer to that question, but it's certainly something that we should think about. It very much came up in another study we did which is on the Kenwick man. So we're probably familiar with some of the stories of the Kenwick man, some of the remains that were found by the Columbia River in Washington, dated about eight and a half thousand years ago, years before present, and it was found on public land, but it was not repatriated because people found that it actually, it was not made to be married. And then there was lots of research on the Kenwick man, there was a book written about the Kenwick man, and there were a lot of hypotheses of the Kenwick man, the biological anthropologists that looked at the Kenwick man, there was some of them were arguing that it was a European, going back to the solitary, that hypothesis may be a European comment, other people arguing that it was a Indonesian, the book about this would contribute many, many different papers in that book. And if I could take out my sort of, my type of being a statistician, I would say I'm horrified of the status of some of the research being done. In that field to be honest, it's clear that you take one single skull, that the ability to assign that to a particular position is extremely core, problem analysis, statistical analysis, will show that, but there seem to be sort of repeated claims about particular skulls, the lack of doing a probabilistic analysis that I think makes two sort of reasonable progress. So anyway, so somehow, it's the Muslim of the library that he managed to get allowed to do DNA analysis of the Kenwick man, and he did that, and this is again a map of who the Kenwick man is related to, and we can show in fact that the Kenwick man is highly closely related to some groups, and in fact there are some groups, including some of the local people that have contributed to this, the total track that donated DNAs that we can compare to, that in fact, and that's some of the analysis within my lab that will show that it's compatible with the Kenwick man being directly ancestral to those groups, that you couldn't reject the hypothesis that the Kenwick man falls directly on the ancestral lineage leading to that group. So it's not only clear that the Kenwick man is clearly American, it's also compatible with that the people that live in that area could be descendants of the population that the Kenwick man came from. So there's a map that shows, within the Americas, the affinities to the group by the anti-Brand boy here, you see there's very close signal of stronger affinity to more, so somebody's solving them, whereas the Kenwick man also has some of the affinity to some of these groups up here, particularly this COVID tribe, but there's also some genetic relatedness there. So the story of that, the way that ended was that the hypothesis paper and Albuber Chicago was then asked if they could verify our results, they verified our results and the remains were repatriated and repatriated. That's a consequence of this, and of course they raised a lot of questions about repatriation and the structured reburial and many other things, and I think those discussions there may be some select discussion, but that was sort of the conclusion of that. I should probably stop now so there's some time for questions. I'm making that people have some questions we have five minutes left. So I think I will just go on directly, jump towards some other studies and jump to just my endorsement. Particular one is about, of course endorsement, I don't have to elaborate the accessibility with more than many of these different stories. I also forgot to go to the side of power to elaborate on this slide, and then some of the people in my own group that do some work particularly Harris who is now a professor in the University of Washington, Young Lang, and many other people from there. Thanks for all your questions. Questions. So in terms of your working in the University of Washington, the HBAA work that you do, do you do your own training? No, so I don't, so I'm really on the computational side. So I'm doing it all together in collaboration. Co-director of the Center in Covey when they do all of the work. So this is all, all the work that work is done in Covey. They then said, stay in here and I can do anything else. I think I'll just do it by some people in Covey. So there's no plans of integrating biology to set up an HBAA last year? Sadly not, I've been pushing for that, but I haven't been, you know, it's not as difficult, it costs money, and all the things, you know, you want to study science. That's something that I'm interested in, though. That's something that, if all the people that will help me sort of generate some enthusiasm for that, I'm saying, it's your core facility for HBAA, I would be really, really excited to have to prove it. That's something we may want to check with them. I'll have to watch the research facility. Yeah. Okay. I can just sort of talk with all of today's researchers about that, that would be very interesting. I don't know, I think we should have a little dinner and drinks. That sounds pretty good. The hardware, I think they're coming to town, so that's a good idea. Well, it's nice to meet you. I just wanted to go back and see the first part of your talk for Tiana Bells. Specifically, the date of interbreeding at about 55,000, which strikes me as family-faring reasons. And I'd bet that it's an average. I mean, of course it's wiggle and I don't have that spectrum. But my question is more asking your opinion based on the work that you've done about how things might change thinking about the Near Eastern material. So I meant the Near Eastern material. And so there, there is Neanderthals and Homo sapiens in the same area. So it's both potentially cohabiting in the same area or ultimately in the same area or some combination of that. For, you know, our recent early dates now are about 200,000 years ago from this lead day. So we have the remains of no BGDNA from Homo sapiens or Neanderthals. And so I'm wondering that, you know, that is potentially if the Neanderthals are disappearing around 15,000 years ago in that area, has that 100,000 years? So that's what you're suggesting that the estimates should be not much older. Well, it was, okay, so let me see if I can get that out. So yes, I'm wondering what you would think might change if we were going to do that. So why do you change this estimate? First of all, you know, it could be this that we have several different maps of integration, right? So that could be, and what you see is that older integration, because of this natural selection, we'll have less of that relative to the more recent integration. And now I think that we're not really modeling here. In the now case, you know, sort of nerd article or something, but that's the natural selection. And the natural selection changed, as I can think, on these correct lengths. And that has not really been taken totally into account in any of our estimates. But I don't think it'll double the time, for example. I think that will be very, very unlikely. But so I think it's unlikely that you'll get an estimate of how much it actually is, right? So... It's just interesting to think of behaviorally. Like that time period matches well, which we'll be thinking about almost like we're moving into Western Europe, for example. And then there's some, you know, just some degree of overlap, but not actually a huge amount of time for integrating on the population there. But then there's trees that would suggest very little integrating for a long period of time and no integrating until the very end Yeah, no, I see the issue there. I'm certainly don't think that the majority of the integrating was from Europe, because in fact, by a little bit more near the end of the day, the stations that are up here. That means there's a time limit. Yeah, yeah. So don't think it's because the integrating, mostly how you do think it is, it must be done because it spreads about equally on minimum, so it must have habits in the Middle East, I would think. It's not really a good model that would allow us to say, oh, it's mostly your own. It's great. I think so. But given the station rates and the degree that you're seriously in, it's definitely a good model. Yeah, the mutation rates, this is so based on this recombination factor, which I think we know better than the mutation rates. So the mutation rates are a bit more uncertain. The reason why I like this dating is that no recombination rates much better than we know mutation rates. There will be, I feel that the more precise it is with how more reliable it is, the rest will be. That being said, I've been through, you know, having been in this field since, you know, I was, these two we had in Berkeley in the mid-90s. I've seen lots of estimates changed through time.  I'm not gonna do it. Okay? So let me put it like that. Folding in the head's opens. Yes. Because there was no mention of that about we had the information that there was one person who had an entertual parent and had an entertual parent. How does that sort of then get into the situation? Are you going to comment on that? Yeah, we worked on that a lot too. We worked on that, and I was peripherally, I bought also the sequencing of the first needs when the project, you know. Yeah, I mean, I think it doesn't change so much from the other folks. In fact, because when you had, when you, there matter, the needs of the integration that we find outside of California and Australia is very, very small. Okay, so it's maybe 0.1, 0.2%. Whereas we find 2 to 3% in the animal. So the pollution is all from, so that's the issue, yes, the typical issue is about how to plug and separate denissuant versus the NFO DNA. But with such a small portion of denissuant DNA, it probably doesn't matter much. But one of the things that we're finding is that many of, when we look at human adaptation to new environments, we often find denissuant DNA in that. So I'm very, very interested, I mean, the denissuants are, I think, some of the most interesting things to think about, right? Because we don't know anything about them. We just have the genome, and we find that the DNA is our humans, and it seems to really contribute importantly to adaptive variation in humans. And that is really, really interesting. So who are the environments for it adapted to be only known from this one cave in southern Siberia, the denissuant cave, right? So what's up with that? Why do we find all the DNA in Australia and pumpkin caves? So yeah, that's one of the things I'm most positive about. Let's keep in common about the recent debate between two competing labs about populating the Americas. I know you said you're going for the Copenhagen group and there's some, you know, these maps that have been coming out of these particles and coming out of waves. Yeah, so I've been heavily involved in research and I was in the NPR discussing this with David Bright on Science Friday, so I'm sorry. I've been involved in that, so you won't get at one pass from me on the other. But I think the short story is that the models and the inference are really very compatible. It's all in how it is being discussed. Brian, I think if you actually look at the data and the concrete inference, it's really what the DNA is, it's pretty much the same. It's more the verbal interpretations than the one on top that we are dealing with. And so most of us are always reluctant to go into a sort of strong debate on vascular interpretations and all that. Really, what we know that everybody agrees with me on is that we have these active migrations that's slight. They were right, so I feel that the NAPDN speakers, they got DNA from this attack migration. I feel that there's no evidence for that, I think it's true, it's not that. So all the Siberian people that contributed some DNA into the NAPDN speakers, there's one controversy there. Then we all agree on that most of the non-active Native American DNA material is really for one big migration that's been into this northern and southern, then into South America that started and we started two waves of migration in there. We all agree on that. We agree on that in some of these people that live in the Brazilian rainforest. We got this odd signal, so genetic relatedness to some people from Australia, from the Andaman Islands, and they were hard on trying to figure out what that is. We have some ideas that I can't really talk about. That's really very big, so I can't talk about that now. So, and all of that, yes, that's right. So I think, all of these things we agree on, but then it's sort of semantics. So, as people who said there was one big migration into the NAPDN, that's like that migration that doesn't include the active. And then David Frank said there were three more migration. But it's just semantics about various definitions of the air. It's really not, really what's been going on, but we know for sure it's the same. But then there's some sort of a layer of interpretation that can further and further and further away from the data. And that's where people start to disagree, right? It's like that last four sentences in the discussion section of the paper. And I feel maybe it's not worth spending too much time on because I really feel that both people say are the same, although they like to differentiate themselves by having to disagree with each other. Yeah, I'm there. That's just a good question, right, on the data. My recollection is when the Anders Hall modern human DNA studies first came out about eight or nine years ago, that the data size was more like 90,000. Yeah, that's been pushed to be more priceless. So this is the development of the order. So I think the early estimates really also, I mean lots of, sometimes you see, no, you kind of know what the answer should be, right? I mean, here, you know when sort of at that point it was thought that migration of modern genes out of the effort, it had as much more reason than it fit with the 19,000 data. So you ended up at least with that kind of data. So I think it was not really driven mostly by those innate data, that data. It was sort of compatible with the data around there. But of course now we know that the story's much more complex. What do you think about the use of sort of the, open to the public DNA analysis, like what it's really being and ancestry and so forth, that are trying to give people a sense of how much DNA they have or don't have? Yeah, I mean I get bombarded with emails from people that watch some movies and stuff. You know, people are telling me that the hospital must have more DNA than this and blah, blah, blah. I think it's terrible in some sense, right? I mean there's nothing really that people learn from this that will help them in their lives. And so there's sort of, sort of a lot of the science the way it's done is actually quite well, 23 and me in particular, I have a, students that post up the now jobs for both answers to the common 23 and me. And the science that they're doing, I think is very good and very good at both places. But it's in the issue of giving people information that they don't have a context to describe it. And then there's some degree set in a snaggle, right, because people don't have the context to fully understand what this means. And they think it means more than means. It doesn't really mean much most of the time, right? We have 5% increase of getting some disease. Well, you know, 5% over 0.001% is still really small, right? So generally, I think people don't understand that. It has a potential for doing more harm than good. So I'm in favor of that medical information so we can fully help, you know, the primary physician to give you medical information. Shouldn't be something where you send your stuff out to the internet and get information back, for example. I think the nianniful thing is pretty, that perhaps doesn't matter much, but it seems to some of the people's, you know, people think that the genetic information would all write their cultural identity somehow and it fits their cultural identity. And that's where I have the biggest problem, perhaps, right, that people think that genetics could sort of overrule their identity. And I think that the sort of liberation of 23 and me and the answers to common all those commonings help, you know, push that in some sense, who are your genes, that is more important than your real cultural identity. And that I have perhaps the biggest problem. Do you think it's possible 23 and 8 told me that my mother's half the group left the Middle Ages around 26,000 years ago? So that is from my to common DNA. So that's my little clock. Twitter's, you know, that would be a confidence interval of that estimate. But of course, the interpretation is here that you had some, you know, relatives there 26, 19 years ago, right? But actually how people, that was what I started by saying, there's not a dear location. So those answers could have moved around many different places as well. And DNA doesn't really tell you about that. So therefore, I do have a little bit of a problem with that. Just because we don't know when they actually were those answers, there's just an indirect inference between my relatedness to all the people that they were certainly to graduate ages today. Yeah, well, I really like it because I'm a penlet of archaeologists. And I worked around 17 to 20,000 years ago in San Francisco, Europe. But again, my mom's family is on the move and they're in Europe about my period. I don't think so. All right, so. So before I think we can stay over a little bit. All right, thank you. Thank you.